目录
修改的文件:
文件修改说明:文章来源:https://www.toymoban.com/news/detail-552447.html
这个 主要修改了Mediatek 打印串口 (uart0) 为普通串口,这样可以避免在使用uart0 不必要的调试信息。文章来源地址https://www.toymoban.com/news/detail-552447.html
修改的文件:
bootable/bootloader/lk/app/mt_boot/mt_boot.c
system/core/rootdir/init.rc
文件修改说明:
-
mt_boot.c
: 修改了启动 Linux 的函数boot_linux_fdt
,将printk.disable_uart
的值从 0 改为 1,这样在用户构建中就不会打印调试信息。 -
init.rc
: 注释掉了console
服务的定义和启动,这个服务在ro.debuggable=1
时会启动一个 shell 在控制台上,注释掉后就不会启动这个服务。
Subject: [PATCH] modify Print serial port(uart0) to ordinary serial port --- bootable/bootloader/lk/app/mt_boot/mt_boot.c | 5 +++-- system/core/rootdir/init.rc | 14 +++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/bootable/bootloader/lk/app/mt_boot/mt_boot.c b/bootable/bootloader/lk/app/mt_boot/mt_boot.c index 3912da6..7ccabdb 100755 --- a/bootable/bootloader/lk/app/mt_boot/mt_boot.c +++ b/bootable/bootloader/lk/app/mt_boot/mt_boot.c @@ -571,10 +571,11 @@ int boot_linux_fdt(void *kernel, unsigned *tags, if (!has_set_p2u) { + //shh modify print uart0 to normal uart0 #ifdef USER_BUILD - sprintf(cmdline,"%s%s",cmdline," printk.disable_uart=0"); + sprintf(cmdline,"%s%s",cmdline," printk.disable_uart=1"); #else - sprintf(cmdline,"%s%s",cmdline," printk.disable_uart=0 ddebug_query=\"file *mediatek* +p ; file *gpu* =_\""); + sprintf(cmdline,"%s%s",cmdline," printk.disable_uart=1 ddebug_query=\"file *mediatek* +p ; file *gpu* =_\""); #endif /*Append pre-loader boot time to kernel command line*/ diff --git a/system/core/rootdir/init.rc b/system/core/rootdir/init.rc index 6c4855f..9ac1f80 100755 --- a/system/core/rootdir/init.rc +++ b/system/core/rootdir/init.rc @@ -492,16 +492,16 @@ service healthd /sbin/healthd class core critical seclabel u:r:healthd:s0 - -service console /system/bin/sh - class core - console - disabled +#shh modify print uart0 to normal uart0 +#service console /system/bin/sh +# class core +# console +# disabled # user shell # seclabel u:r:shell:s0 -on property:ro.debuggable=1 - start console +#on property:ro.debuggable=1 +# start console # adbd is controlled via property triggers in init.<platform>.usb.rc service adbd /sbin/adbd --root_seclabel=u:r:su:s0 -- 1.9.1
到了这里,关于Android Mediatek 修改打印串口 (uart0) 为普通串口的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!