Android7系统开机后串口log没有输出
https://blog.csdn.net/xuecz1230/article/details/85335269
//解决:
setprop persist.console.silent.config 0
注意:这个值默认是1
//下面这个patch改了好像没起到作用
diff --git a/include/linux/printk.h b/include/linux/printk.h
index d78125f..679fcf4 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -40,7 +40,7 @@ static inline const char *printk_skip_level(const char *buffer)
#define CONSOLE_LOGLEVEL_SILENT 0 /* Mum's the word */
#define CONSOLE_LOGLEVEL_MIN 1 /* Minimum loglevel we let people use */
#define CONSOLE_LOGLEVEL_QUIET 4 /* Shhh ..., when booted with "quiet" */
-#define CONSOLE_LOGLEVEL_DEFAULT 7 /* anything MORE serious than KERN_DEBUG */
+#define CONSOLE_LOGLEVEL_DEFAULT 1 /* anything MORE serious than KERN_DEBUG */
#define CONSOLE_LOGLEVEL_DEBUG 10 /* issue debug messages */
#define CONSOLE_LOGLEVEL_MOTORMOUTH 15 /* You can't shut this one up */
开机过程中打印级别变化
//刚开机的时候
130|msm8953_64:/ # cat /proc/sys/kernel/printk
6 6 1 7
//系统开起来后,应该是有个进车关掉了这个
0 6 1 7
//手动设置打印后,控制台可以一直输出
echo "7 4 1 7" > /proc/sys/kernel/printk
getprop persist.console.silent.config
//解决:
setprop persist.console.silent.config 0
注意:这个值默认是1
//代码分析
device/qcom/common/rootdir/etc/init.qcom.sh
#check build variant for printk logging
#current default minimum boot-time-default
buildvariant=`getprop ro.build.type`
case "$buildvariant" in
"userdebug" | "eng")
#set default loglevel to KERN_INFO
echo "6 6 1 7" > /proc/sys/kernel/printk
;;
*)
#set default loglevel to KERN_WARNING
echo "4 4 1 4" > /proc/sys/kernel/printk
;;
esac
device/qcom/common/rootdir/etc/init.qcom.post_boot.sh
# Change console log level as per console config property
console_config=`getprop persist.console.silent.config`
case "$console_config" in
"1")
echo "Enable console config to $console_config"
echo 0 > /proc/sys/kernel/printk
;;
*)
echo "Enable console config to $console_config"
;;
esac