diff options
author | Ludovic Pouzenc <ludovic.pouzenc@mines-albi.fr> | 2018-06-28 10:21:38 +0200 |
---|---|---|
committer | Ludovic Pouzenc <ludovic.pouzenc@mines-albi.fr> | 2018-06-28 10:21:38 +0200 |
commit | 3bb366c6b9334969177e760779dbe6df0f641312 (patch) | |
tree | a163598204e4552c32028212ea5d4017468c2224 /make-boot-image.sh | |
parent | 6df4974a7857d94005cd8a56e30880ad063e5b07 (diff) | |
download | eficast-3bb366c6b9334969177e760779dbe6df0f641312.tar.gz eficast-3bb366c6b9334969177e760779dbe6df0f641312.tar.bz2 eficast-3bb366c6b9334969177e760779dbe6df0f641312.zip |
Eviter les clonages de master en boucle si le BIOS redémarre sur eficast
Diffstat (limited to 'make-boot-image.sh')
-rwxr-xr-x | make-boot-image.sh | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/make-boot-image.sh b/make-boot-image.sh index b8654b9..8852256 100755 --- a/make-boot-image.sh +++ b/make-boot-image.sh @@ -365,13 +365,23 @@ echo_color() { [ "x$4" == "xversion" ] && echo " (eficast v"$(cat /etc/eficast_version)")" || echo } -# if no args, print colored message, wait 10 sec and reboot +# no args, print colored message, wait 10 sec and reboot eficast_end() { - ( sfx_success ; touch /run/nosound ) & - message reboot "in 10s" + echo -e "\e]2;eficast_end\007" # Term title (tmux), intentionnal carriage return echo_color white green "----- EFICAST end of execution ------" - read -t10 -p 'Ctrl+C to have a shell, Enter to skip wait time...' - reboot + ( sfx_success ; touch /run/nosound ) & + [ -r touch /run/eficast_end ] && action=$(cat /run/eficast_end) + case $action in + poweroff) read -t10 -p 'Ctrl+C to have a shell, Enter to skip wait time for poweroff...' + poweroff + ;; + reboot) read -t10 -p 'Ctrl+C to have a shell, Enter to skip wait time for reboot...' + reboot + ;; + *) echo "Dropping a shell (consider putting poweroff or reboot in /run/eficast_end)" + PS1='\h:\w# ' HOME='/root/' /bin/busybox sh + ;; + esac } # note : rcS rescue_shell is slighly different because most of the env is not ready in rcS |