android 9.0 MTK平台关闭调试口ttyS0

这篇博客介绍了Android设备中针对MT6771平台的一项系统配置修改,目的是为了解决外设过多导致的资源紧张问题。通过更新factory_init.rc、meta_init.rc、ueventd.mt6771.rc等文件,释放s0接口供外设通信使用,并调整了相关服务权限和设备权限设置,确保系统的稳定性和安全性。同时,还涉及到了adb服务的控制以及串口打印信息的开关配置。
摘要由CSDN通过智能技术生成

引言

外接设备过多,腾出s0口用作外设通信

修改方案

diff --git a/device/mediatek/mt6771/factory_init.rc b/device/mediatek/mt6771/factory_init.rc
index a1b5d00589..30c54bd849 100755
--- a/device/mediatek/mt6771/factory_init.rc
+++ b/device/mediatek/mt6771/factory_init.rc
@@ -701,13 +701,6 @@ service ueventd /sbin/ueventd
     critical
     seclabel u:r:ueventd:s0

-service console /system/bin/sh
-    class core
-    console
-    disabled
-    user shell
-    group shell log readproc
-    seclabel u:r:shell:s0

 on property:sys.powerctl=*
     powerctl ${sys.powerctl}
@@ -720,7 +713,6 @@ on property:ro.debuggable=1
     # Give writes to anyone for the trace folder on debug builds.
     # The folder is used to store method traces.
     chmod 0773 /data/misc/trace
-    start console

 # adbd is controlled via property triggers in init.<platform>.usb.rc
 service adbd /system/bin/adbd --root_seclabel=u:r:su:s0
diff --git a/device/mediatek/mt6771/meta_init.rc b/device/mediatek/mt6771/meta_init.rc
index 52a3872efa..5c23eafd1a 100644
--- a/device/mediatek/mt6771/meta_init.rc
+++ b/device/mediatek/mt6771/meta_init.rc
@@ -590,14 +590,6 @@ service ueventd /sbin/ueventd
     critical
     seclabel u:r:ueventd:s0

-service console /system/bin/sh
-    class core
-    console
-    disabled
-    user shell
-    group shell log readproc
-    seclabel u:r:shell:s0
-
 #Log too much setting
 on property:ro.vendor.mtklog_internal=1
     setprop vendor.logmuch.value 10000
@@ -606,7 +598,6 @@ on property:ro.debuggable=1
     # Give writes to anyone for the trace folder on debug builds.
     # The folder is used to store method traces.
     chmod 0773 /data/misc/trace
-    start console

 # adbd is controlled via property triggers in init.<platform>.usb.rc
 service adbd /system/bin/adbd --root_seclabel=u:r:su:s0
diff --git a/device/mediatek/mt6771/ueventd.mt6771.rc b/device/mediatek/mt6771/ueventd.mt6771.rc
index 813a1a3de5..8d6bbd4351 100755
--- a/device/mediatek/mt6771/ueventd.mt6771.rc
+++ b/device/mediatek/mt6771/ueventd.mt6771.rc
@@ -136,7 +136,8 @@
 /dev/tkcoredrv            0666   root       root

-/dev/ttyS1                0660   system     root
+/dev/ttyS*                0660   system     root
+/dev/ttyS0                0777   system     root
 /dev/ttyACM*              0666   system     system
+++ b/device/mediatek/mt6771/ueventd.mt6771.rc
@@ -136,7 +136,8 @@
 /dev/tkcoredrv            0666   root       root

-/dev/ttyS1                0660   system     root
+/dev/ttyS*                0660   system     root
+/dev/ttyS0                0777   system     root
 /dev/ttyACM*              0666   system     system
 /dev/ttyUSB*              0666   system     system

diff --git a/device/mediateksample/tb8788p1_64_bsp/mid/PS580UX/items.ini b/device/mediateksample/tb8788p1_64_bsp/mid/PS580UX/items.ini
index e5272bebf0..8528794bb3 100755
--- a/device/mediateksample/tb8788p1_64_bsp/mid/PS580UX/items.ini
+++ b/device/mediateksample/tb8788p1_64_bsp/mid/PS580UX/items.ini
@@ -31,8 +31,8 @@
 items.start
 #######################################################################
 #adb.root                                                  0                                   # 启用adb root功能
-uart.printk 1                  #是否打印串口信息
-#persist.uartconsole.enable 1
+uart.printk 0                  #是否打印串口信息
+persist.uartconsole.enable 0
 #DDR.model                                             1
 LCM                                            ps580_at_icn6202_mipi_2_lvds                    #所使用屏驱动
 #LCM.backlight.level                           41                              # 默认背光等级
diff --git a/system/core/rootdir/init.rc b/system/core/rootdir/init.rc
index 48d2cd212a..ac19b0e7fc 100755
--- a/system/core/rootdir/init.rc
+++ b/system/core/rootdir/init.rc
@@ -759,22 +759,12 @@ service ueventd /sbin/ueventd
     seclabel u:r:ueventd:s0
     shutdown critical

-service console /system/bin/sh
-    class core
-    console
-    disabled
-    user shell
-    group shell log readproc
-    seclabel u:r:shell:s0
-    setenv HOSTNAME console
-
 on property:ro.debuggable=1
     # Give writes to anyone for the trace folder on debug builds.
     # The folder is used to store method traces.
     chmod 0773 /data/misc/trace
     # Give reads to anyone for the window trace folder on debug builds.
     chmod 0775 /data/misc/wmtrace
-    start console

 service flash_recovery /system/bin/install-recovery.sh
     class main
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值