From aad35bab1636386a93799691a19875ed38d0d44e Mon Sep 17 00:00:00 2001
From: Ludovic Pouzenc <ludovic@pouzenc.fr>
Date: Sun, 5 Jul 2020 11:10:11 +0200
Subject: Minor fix for eficast_end/reboot (don't randomly trigger rescue
 shell)

---
 make-boot-image.sh | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'make-boot-image.sh')

diff --git a/make-boot-image.sh b/make-boot-image.sh
index 943f10a..be002eb 100755
--- a/make-boot-image.sh
+++ b/make-boot-image.sh
@@ -1,6 +1,6 @@
 #!/bin/bash -xe
 PS4='+ ($LINENO) ' # To ease debugging
-VERSION="1.2-emac-rc2"
+VERSION="1.2-emac-rc3"
 
 # Config #
 ##########
@@ -462,11 +462,11 @@ eficast_end() {
 	[ -r /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...'
-				wait # if beep command is killed from sfx_success, internal speaker can't beep for a long anoying time
+				wait # if beep command is killed from sfx_success, internal speaker can beep for a long anoying time
 				poweroff
 				;;
 		reboot)		read -t10 -p 'Ctrl+C to have a shell, Enter to skip wait time for reboot...'
-				wait # if beep command is killed from sfx_success, internal speaker can't beep for a long anoying time
+				wait # if beep command is killed from sfx_success, internal speaker can beep for a long anoying time
 				reboot
 				;;
 		*)		echo "Dropping a shell (consider putting poweroff or reboot in /run/eficast_end)"
@@ -644,7 +644,8 @@ EOF
 add_initrd_script etc/rc.d/rc2-or-rescue <<"EOF"
 . /etc/rc.d/funcs		# Load helper functions
 if [ -f /run/rescue ]
-then	rm /run/rescue
+then	sleep 1 # reboot command in eficast_end kill all processes and could trigger rescue mode
+	rm /run/rescue
 	echo_color red black "/etc/rc.d/rc2 dead. Spawning rescue_shell on /dev/tty1 now"
 	rescue_shell
 else	touch /run/rescue
-- 
cgit v1.2.3