From ea0f3f709633a2c4258727e947e1fe42b6758e5b Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Mon, 10 Jul 2017 05:14:41 +0100 Subject: [PATCH] init: make break after behaviour really break after --- packages/sysutils/busybox/scripts/init | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/sysutils/busybox/scripts/init b/packages/sysutils/busybox/scripts/init index 4634302244..52e83cfe9a 100755 --- a/packages/sysutils/busybox/scripts/init +++ b/packages/sysutils/busybox/scripts/init @@ -62,6 +62,8 @@ LIVE="no" + BREAK_TRIPPED="no" + # Get a serial number if present (eg. RPi) otherwise use MAC address from eth0 MACHINE_UID="$(cat /proc/cpuinfo | awk '/^Serial/{s=$3; gsub ("^0*","",s); print s}')" [ -z "$MACHINE_UID" ] && MACHINE_UID="$(cat /sys/class/net/eth0/address 2>/dev/null | tr -d :)" @@ -182,7 +184,7 @@ } debug_shell() { - echo "### Starting debugging shell... type exit to quit ###" + echo "### Starting debugging shell for boot step: $BOOT_STEP... type exit to quit ###" showcursor @@ -197,12 +199,17 @@ } break_after() { - # Start debug shell after boot step $1 - case $BREAK in - all|*$1*) - debug_shell - ;; - esac + # Start debug shell after boot step $1, and all subsequent steps + if [ $BREAK_TRIPPED == yes ]; then + debug_shell + else + case $BREAK in + all|*$1*) + BREAK_TRIPPED=yes + debug_shell + ;; + esac + fi } # Mount handlers