Skip to content

Commit c02635b

Browse files
committed
minor tweaks
basically realigning with logging branch / halium PR Halium#39 Change-Id: I79bb285dce6b67aa36b6f5bd9218d92b1009c55b
1 parent c657a82 commit c02635b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

init-script

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
set -x
2424
exec > /init.log 2>&1
2525
echo "Running Mer Boat Loader"
26+
[ -f /dev/kmsg ] || mknod -m 600 /dev/kmsg c 1 11
2627

2728
BOOTLOGO=%BOOTLOGO%
2829
ALWAYSDEBUG=%ALWAYSDEBUG%
@@ -46,7 +47,6 @@ if [ "$0" = "/init-debug" ]; then
4647
fi
4748

4849
log(){
49-
5050
# log to std out
5151
echo "$*"
5252

@@ -55,7 +55,6 @@ log(){
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
147146
do_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-
260258
run_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

Comments
 (0)