2323set -x
2424exec > /init.log 2>&1
2525echo " Running Mer Boat Loader"
26+ [ -f /dev/kmsg ] || mknod -m 600 /dev/kmsg c 1 11
2627
2728BOOTLOGO=%BOOTLOGO%
2829ALWAYSDEBUG=%ALWAYSDEBUG%
@@ -46,7 +47,6 @@ if [ "$0" = "/init-debug" ]; then
4647fi
4748
4849log (){
49-
5050 # log to std out
5151 echo " $* "
5252
5555 [ -w $ANDROID_USB /iSerial ] && echo -n " $* " > $ANDROID_USB /iSerial ; sleep 1
5656
5757 # log to kernel log
58- # this only works after do_mount_devprocsys()
5958 [ -w /dev/kmsg ] && echo " init-script: $* " >> /dev/kmsg
6059}
6160
@@ -146,7 +145,7 @@ get_opt() {
146145# Minimal mounts for initrd or pre-init debug session
147146do_mount_devprocsys ()
148147{
149- echo " mounting devprocsys"
148+ log " mounting devprocsys"
150149 mkdir /dev
151150 mount -t devtmpfs devtmpfs /dev
152151 # telnetd needs /dev/pts/ entries
@@ -256,11 +255,10 @@ usb_setup() {
256255 write $ANDROID_USB /enable 1
257256}
258257
259-
260258run_debug_session () {
261259 breathe
262260 CUSTOMPRODUCT=$1
263- log " Debug session : $1 "
261+ log " run_debug_session : $1 "
264262 log " DONE_SWITCH=$DONE_SWITCH "
265263
266264 USB_IFACE=notfound
@@ -372,7 +370,7 @@ if [ "$DONE_SWITCH" = "no" ]; then
372370 COUNT_VOLUP=$( dmesg | grep " Pressed KEY_VOLUMEUP" | wc -l )
373371 [ " $COUNT_VOLUP " -ge 3 ] && DBG_REASON=" Repeated VOLUMEUP"
374372
375- log " DBG_REASON=$DBG_REASON "
373+ log " DBG_REASON=\" $DBG_REASON \" "
376374 if ! [ " $DBG_REASON " = " " ] ; then
377375 # During debug we export mmc too (some variations in location here)
378376 lun=/sys/class/android_usb/f_mass_storage/lun/file
@@ -405,7 +403,7 @@ if [ "$DONE_SWITCH" = "no" ]; then
405403 else
406404 # Prefer /sbin/preinit over /sbin/init
407405 [ -x /target/sbin/preinit ] && INIT=/sbin/preinit || INIT=/sbin/init
408- echo " hybris-boot: Booting $INIT in real rootfs" > /target/data/init-stderrout
406+ log " hybris-boot: Booting $INIT in real rootfs" > /target/data/init-stderrout
409407 exec switch_root /target $INIT >> /target/data/init-stderrout 2>&1
410408 fi
411409 log " after exec switch_root"
0 commit comments