init: make break after behaviour really break after

This commit is contained in:
MilhouseVH 2017-07-10 05:14:41 +01:00
parent 0609eddee6
commit ea0f3f7096

View File

@ -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