diff options
author | Simon Rettberg | 2017-02-09 15:49:13 +0100 |
---|---|---|
committer | root | 2017-02-09 15:49:13 +0100 |
commit | 6a9a8b6009469aa6eb0a65cfec9afedda14eaef1 (patch) | |
tree | 9aea0c7a25ab18a4dffe84a2819b782dbbf85ae3 /core | |
parent | [pam] Add missing config file for key handling (DFS, cifs.upcall etc.) (diff) | |
download | mltk-6a9a8b6009469aa6eb0a65cfec9afedda14eaef1.tar.gz mltk-6a9a8b6009469aa6eb0a65cfec9afedda14eaef1.tar.xz mltk-6a9a8b6009469aa6eb0a65cfec9afedda14eaef1.zip |
[rootfs-stage31] Don't open debug shell if we're booting with splash screen
This probably means the end user booted the system, so we don't want them to
have a way to open a root shell...
Diffstat (limited to 'core')
-rw-r--r-- | core/rootfs/rootfs-stage31/data/inc/functions | 12 | ||||
-rw-r--r-- | core/rootfs/rootfs-stage31/data/inc/setup_network | 12 |
2 files changed, 20 insertions, 4 deletions
diff --git a/core/rootfs/rootfs-stage31/data/inc/functions b/core/rootfs/rootfs-stage31/data/inc/functions index 248d0149..baf31afc 100644 --- a/core/rootfs/rootfs-stage31/data/inc/functions +++ b/core/rootfs/rootfs-stage31/data/inc/functions @@ -15,7 +15,17 @@ drop_shell() { exec 1>&4 2>&5 reset fi - [ $# -gt 0 ] && echo $@ + [ $# -gt 0 ] && echo "$*" + if [ "x$SPLASH" != "x0" ]; then + echo "System halted. If you want to spawn a debug shell, select" + echo "debug mode in the boot menu." + echo "" + echo "Press any key to reboot." + read -t 1 -s -n 999999 BLA + read -n 1 -s BLA + echo b > /proc/sysrq-trigger + exit 1 + fi echo "CTRL + D will continue booting." setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1' } diff --git a/core/rootfs/rootfs-stage31/data/inc/setup_network b/core/rootfs/rootfs-stage31/data/inc/setup_network index 956df03c..0aa033b9 100644 --- a/core/rootfs/rootfs-stage31/data/inc/setup_network +++ b/core/rootfs/rootfs-stage31/data/inc/setup_network @@ -22,8 +22,13 @@ BRIDGE="br0" mkdir -p "${FUTURE_ROOT}/etc/udev/rules.d" -#IP_OUT=$(ip a | sed -r ':a;N;$!ba;s/: ([a-z0-9]+): /####\1####/g;s/ether ([a-f0-9:]+) /####\1####/g'| grep -E -o '####[^ ]+####' | sed 's/#//g' | grep -B 1 ':') -IP_OUT=$(ip a | grep -B 1 "/ether" | sed -r '/^--$/d;$!N;s#^[0-9]+: ([a-z0-9\.:]+): .*?/ether ([0-9a-fA-Z:]+) .*$#\1==\2#') +for i in 1 1 1 END; do + IP_OUT=$(ip a | grep -B 1 "/ether" | sed -r '/^--$/d;$!N;s#^[0-9]+: ([a-z0-9\.:]+): .*?/ether ([0-9a-fA-Z:]+) .*$#\1==\2#') + [ "x$i" == "xEND" ] && break + if ! echo "$IP_OUT" | grep -q -- "$MAC"; then + sleep "$i" + fi +done if ! echo "$IP_OUT" | grep -q -- "$MAC"; then drop_shell "--- @@ -32,7 +37,8 @@ $(ip a) $IP_OUT --- -Boot interface $MAC not found in interface list. NIC driver missing?" +Boot interface $MAC not found in interface list. NIC driver missing? +Check output of dmesg for missing firmware (dmesg | less)" : fi |