Merge pull request #1773 from MilhouseVH/init_break_after

init: make break after behaviour really break after
This commit is contained in:
Christian Hewitt 2017-09-13 20:56:12 +04:00 committed by GitHub
commit 63c0f2cb8c

View File

@ -62,6 +62,8 @@
LIVE="no" LIVE="no"
BREAK_TRIPPED="no"
# Get a serial number if present (eg. RPi) otherwise use MAC address from eth0 # 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}')" 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 :)" [ -z "$MACHINE_UID" ] && MACHINE_UID="$(cat /sys/class/net/eth0/address 2>/dev/null | tr -d :)"
@ -182,7 +184,7 @@
} }
debug_shell() { debug_shell() {
echo "### Starting debugging shell... type exit to quit ###" echo "### Starting debugging shell for boot step: $BOOT_STEP... type exit to quit ###"
showcursor showcursor
@ -200,12 +202,17 @@
} }
break_after() { break_after() {
# Start debug shell after boot step $1 # Start debug shell after boot step $1, and all subsequent steps
case $BREAK in if [ $BREAK_TRIPPED == yes ]; then
all|*$1*) debug_shell
debug_shell else
;; case $BREAK in
esac all|*$1*)
BREAK_TRIPPED=yes
debug_shell
;;
esac
fi
} }
# Mount handlers # Mount handlers