20220310在MT6739的android8.1下增加VT设备tty1
2022/3/10 10:21
需求:鸿蒙(Openharmony3.1 beta)下需要使用MT6739的设备节点:/dev/tty1。
于是先在MT6739的android8.1下验证了。
OS:android8.1
内核:linux-4.4(SDK里面同时有linx-3.18)
1、你在X:\mt6739_android8.1\kernel-4.4
这个目录下是找不到编译成成的.config文件的!
好奇怪!我以前做的Rockchip的RK3399/RK3568,全志的A64等等平台都会在内核下面有.config文件的。
rootroot@rootroot-desktop:/home/rootroot/mt6739_android8.1$
rootroot@rootroot-desktop:/home/rootroot/mt6739_android8.1$ find . -name .config
./external/toybox/.config
./out/target/product/k39tv1_bsp_1g/obj/KERNEL_OBJ/.config
rootroot@rootroot-desktop:/home/rootroot/mt6739_android8.1$
rootroot@rootroot-desktop:/home/rootroot/mt6739_android8.1$
很容易发现CONFIG_VT没有打开:
(搜索:TTY)
#
# Character devices
#
CONFIG_TTY=y
# CONFIG_VT is not set
CONFIG_UNIX98_PTYS=y
# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=16
# CONFIG_SERIAL_NONSTANDARD is not set
# CONFIG_N_GSM is not set
# CONFIG_TRACE_SINK is not set
# CONFIG_DEVMEM is not set
# CONFIG_DEVKMEM is not set
![](https://img-blog.csdnimg.cn/8caee88277924af1bb8aa4bac97104e2.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA5Y2X5qOx56yR56yR55Sf,size_20,color_FFFFFF,t_70,g_se,x_16)
2、很容易/很不容易(根据您的熟练程序)定位到:
X:\mt6739_android8.1\kernel-4.4\arch\arm\configs\k39tv1_bsp_1g_debug_defconfig
根据你对MTK的平台(MT6739)和操作系统(Android8.1)的熟练程度绝对你花费时间的多少。
在# CONFIG_VT is not set 这一行下面增加:
CONFIG_GTP_CREATE_WR_NODE=y
CONFIG_GTP_POWER_CTRL_SLEEP=y
CONFIG_INPUT_MISC=y
CONFIG_INPUT_UINPUT=y
# CONFIG_VT is not set
CONFIG_TTY=y
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_VT_CONSOLE_SLEEP=y
CONFIG_HW_CONSOLE=y
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_UNIX98_PTYS=y
# CONFIG_LEGACY_PTYS is not set
CONFIG_LDISC_AUTOLOAD=y
CONFIG_LEGACY_PTY_COUNT=16
# CONFIG_DEVMEM is not set
# CONFIG_DEVKMEM is not set
# CONFIG_HW_RANDOM is not set
CONFIG_SPI=y
CONFIG_SPI_MT65XX=y
![](https://img-blog.csdnimg.cn/f9f910fcaf7f4187815f6f9607dc6fa9.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA5Y2X5qOx56yR56yR55Sf,size_20,color_FFFFFF,t_70,g_se,x_16)
patch的内容:
2208 CONFIG_TTY=y
2209 CONFIG_VT=y
2210 CONFIG_CONSOLE_TRANSLATIONS=y
2211 CONFIG_VT_CONSOLE=y
2212 CONFIG_VT_CONSOLE_SLEEP=y
2213 CONFIG_HW_CONSOLE=y
2214 CONFIG_VT_HW_CONSOLE_BINDING=y
2215 CONFIG_UNIX98_PTYS=y
2216 # CONFIG_LEGACY_PTYS is not set
2217 CONFIG_LDISC_AUTOLOAD=y
3、悄悄滴告诉你,我找到k39tv1_bsp_1g_debug_defconfig是很不容易的。
我使用的是grep查找的:
rootroot@rootroot-desktop:/home/rootroot/mt6739_android8.1$ grep CONFIG_VT . -R
D:\39_O1\kernel-4.4\drivers\tty\Kconfig
Y:\mt6739_android8.1\kernel-4.4\drivers\tty\Kconfig
config VT
bool "Virtual terminal" if EXPERT
depends on !S390 && !UML
select INPUT
default y
---help---
If you say Y here, you will get support for terminal devices with
display and keyboard devices. These are called "virtual" because you
can run several virtual terminals (also called virtual consoles) on
one physical terminal. This is rather useful, for example one
virtual terminal can collect system messages and warnings, another
one can be used for a text-mode user session, and a third could run
an X session, all in parallel. Switching between virtual terminals
is done with certain key combinations, usually Alt-<function key>.
The setterm command ("man setterm") can be used to change the
properties (such as colors or beeping) of a virtual terminal. The
man page console_codes(4) ("man console_codes") contains the special
character sequences that can be used to change those properties
directly. The fonts used on virtual terminals can be changed with
the setfont ("man setfont") command and the key bindings are defined
with the loadkeys ("man loadkeys") command.
You need at least one virtual terminal device in order to make use
of your keyboard and monitor. Therefore, only people configuring an
embedded system would want to say N here in order to save some
memory; the only way to log into such a system is then via a serial
or network connection.
If unsure, say Y, or else you won't be able to do much with your new
shiny Linux system :-)
想办法修改Kconfig打开config VT。没用!
最后是偶然的机会找到:k39tv1_bsp_1g_debug_defconfig了。
4、确认:
D:\39_O1\out\target\product\k39tv1_bsp_1g\obj\KERNEL_OBJ\.config
(编译进去了!)
# CONFIG_SERIO_ARC_PS2 is not set
# CONFIG_SERIO_APBPS2 is not set
# CONFIG_USERIO is not set
# CONFIG_GAMEPORT is not set
#
# Character devices
#
CONFIG_TTY=y
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_VT_CONSOLE_SLEEP=y
CONFIG_HW_CONSOLE=y
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_UNIX98_PTYS=y
# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
# CONFIG_LEGACY_PTYS is not set
# CONFIG_SERIAL_NONSTANDARD is not set
# CONFIG_N_GSM is not set
# CONFIG_TRACE_SINK is not set
# CONFIG_DEVMEM is not set
# CONFIG_DEVKMEM is not set
#
# Serial drivers
#
# CONFIG_SERIAL_8250 is not set
![](https://img-blog.csdnimg.cn/a711bf70b8834665a8f8632f49a44712.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA5Y2X5qOx56yR56yR55Sf,size_20,color_FFFFFF,t_70,g_se,x_16)
串口:
k39tv1_bsp_1g:/ $ su
k39tv1_bsp_1g:/ # echo "0 0 0 0" > /proc/sys/kernel/printk
k39tv1_bsp_1g:/ #
k39tv1_bsp_1g:/ # cd /dev
k39tv1_bsp_1g:/dev # ls -l tty*
crw-rw-rw- 1 root root 5, 0 2022-03-04 09:37 tty
crw-rw---- 1 root system 4, 0 2022-03-04 09:37 tty0
crw------- 1 root root 4, 1 2022-03-04 09:37 tty1
crw------- 1 root root 4, 10 2022-03-04 09:37 tty10
crw------- 1 root root 4, 11 2022-03-04 09:37 tty11
crw------- 1 root root 4, 12 2022-03-04 09:37 tty12
crw------- 1 root root 4, 13 2022-03-04 09:37 tty13
crw------- 1 root root 4, 14 2022-03-04 09:37 tty14
crw------- 1 root root 4, 15 2022-03-04 09:37 tty15
crw------- 1 root root 4, 16 2022-03-04 09:37 tty16
crw------- 1 root root 4, 17 2022-03-04 09:37 tty17
crw------- 1 root root 4, 18 2022-03-04 09:37 tty18
crw------- 1 root root 4, 19 2022-03-04 09:37 tty19
crw------- 1 root root 4, 2 2022-03-04 09:37 tty2
crw------- 1 root root 4, 20 2022-03-04 09:37 tty20
crw------- 1 root root 4, 21 2022-03-04 09:37 tty21
crw------- 1 root root 4, 22 2022-03-04 09:37 tty22
crw------- 1 root root 4, 23 2022-03-04 09:37 tty23
crw------- 1 root root 4, 24 2022-03-04 09:37 tty24
crw------- 1 root root 4, 25 2022-03-04 09:37 tty25
crw------- 1 root root 4, 26 2022-03-04 09:37 tty26
crw------- 1 root root 4, 27 2022-03-04 09:37 tty27
crw------- 1 root root 4, 28 2022-03-04 09:37 tty28
crw------- 1 root root 4, 29 2022-03-04 09:37 tty29
crw------- 1 root root 4, 3 2022-03-04 09:37 tty3
crw------- 1 root root 4, 30 2022-03-04 09:37 tty30
crw------- 1 root root 4, 31 2022-03-04 09:37 tty31
crw------- 1 root root 4, 32 2022-03-04 09:37 tty32
crw------- 1 root root 4, 33 2022-03-04 09:37 tty33
crw------- 1 root root 4, 34 2022-03-04 09:37 tty34
crw------- 1 root root 4, 35 2022-03-04 09:37 tty35
crw------- 1 root root 4, 36 2022-03-04 09:37 tty36
crw------- 1 root root 4, 37 2022-03-04 09:37 tty37
crw------- 1 root root 4, 38 2022-03-04 09:37 tty38
crw------- 1 root root 4, 39 2022-03-04 09:37 tty39
crw------- 1 root root 4, 4 2022-03-04 09:37 tty4
crw------- 1 root root 4, 40 2022-03-04 09:37 tty40
crw------- 1 root root 4, 41 2022-03-04 09:37 tty41
crw------- 1 root root 4, 42 2022-03-04 09:37 tty42
crw------- 1 root root 4, 43 2022-03-04 09:37 tty43
crw------- 1 root root 4, 44 2022-03-04 09:37 tty44
crw------- 1 root root 4, 45 2022-03-04 09:37 tty45
crw------- 1 root root 4, 46 2022-03-04 09:37 tty46
crw------- 1 root root 4, 47 2022-03-04 09:37 tty47
crw------- 1 root root 4, 48 2022-03-04 09:37 tty48
crw------- 1 root root 4, 49 2022-03-04 09:37 tty49
crw------- 1 root root 4, 5 2022-03-04 09:37 tty5
crw------- 1 root root 4, 50 2022-03-04 09:37 tty50
crw------- 1 root root 4, 51 2022-03-04 09:37 tty51
crw------- 1 root root 4, 52 2022-03-04 09:37 tty52
crw------- 1 root root 4, 53 2022-03-04 09:37 tty53
crw------- 1 root root 4, 54 2022-03-04 09:37 tty54
crw------- 1 root root 4, 55 2022-03-04 09:37 tty55
crw------- 1 root root 4, 56 2022-03-04 09:37 tty56
crw------- 1 root root 4, 57 2022-03-04 09:37 tty57
crw------- 1 root root 4, 58 2022-03-04 09:37 tty58
crw------- 1 root root 4, 59 2022-03-04 09:37 tty59
crw------- 1 root root 4, 6 2022-03-04 09:37 tty6
crw------- 1 root root 4, 60 2022-03-04 09:37 tty60
crw------- 1 root root 4, 61 2022-03-04 09:37 tty61
crw------- 1 root root 4, 62 2022-03-04 09:37 tty62
crw------- 1 root root 4, 63 2022-03-04 09:37 tty63
crw------- 1 root root 4, 7 2022-03-04 09:37 tty7
crw------- 1 root root 4, 8 2022-03-04 09:37 tty8
crw------- 1 root root 4, 9 2022-03-04 09:37 tty9
crw-rw---- 1 system radio 236, 0 2022-03-04 09:37 ttyGS0
crw-rw---- 1 system radio 236, 1 2022-03-04 09:37 ttyGS1
crw-rw---- 1 bluetooth bluetooth 236, 2 2022-03-04 09:37 ttyGS2
crw-rw---- 1 system radio 236, 3 2022-03-04 09:37 ttyGS3
crw------- 1 root root 204, 209 2022-03-04 09:37 ttyMT0
crw-rw---- 1 system system 204, 210 2022-03-04 09:37 ttyMT1
k39tv1_bsp_1g:/dev #
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)