summaryrefstree
path: root/vendor/bin/init.asus.check_cmdline.sh
blob: c038b8e35f2209bab4a2d00baba0d31b862a044c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/system/bin/sh
cmdline_uart=`cat /proc/cmdline | grep dbg=y`
cmdline_klog=`cat /proc/cmdline | grep klog=y`
is_factory_build=`getprop ro.asus.factory`
is_user_build=`getprop ro.build.type`
is_audbg=`getprop persist.asus.audbg`
startlog_flag=`getprop persist.asus.startlog`

if test "$cmdline_uart"; then
	if [ ".$is_user_build" == ".userdebug"  -o ".$is_user_build" == ".eng"  ];then
		if [ ".$is_audbg" == ".1" ]; then
			echo dbg > /proc/asusdebug
		else
			echo ndbg > /proc/asusdebug
		fi
		if test "$cmdline_klog"; then
			setprop persist.asus.kernelmessage 7
		else
			setprop persist.asus.kernelmessage 0
		fi
	fi
else
	setprop persist.asus.audbg 0
	echo ndbg > /proc/asusdebug
	if test "$cmdline_klog"; then
		if [ ".$startlog_flag" == ".1" ];then
			setprop persist.asus.kernelmessage 7
		else
			setprop persist.asus.kernelmessage 0
		fi
	fi
fi