From 36c1925742b1b6bdd0aaebad6522cb50c7e48175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Stefanik?= Date: Fri, 12 Jan 2024 13:07:34 +0100 Subject: [PATCH] Fix panic due to after.sh prematurely quitting on shutdown The sysrq shutdown trigger takes some time to fully shut down the system, during which init is expected to continue running. Since after.sh is the last step in our init, if it quits before shutdown is complete, Linux will panic with "Attempted to kill init". Add an infinite loop after shutdown is issued via sysrq to prevent this. --- steps/improve/after.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/steps/improve/after.sh b/steps/improve/after.sh index b71bf43..32d445c 100644 --- a/steps/improve/after.sh +++ b/steps/improve/after.sh @@ -21,4 +21,5 @@ if [ "${CHROOT}" = False ]; then echo u > /proc/sysrq-trigger mount -o remount,ro / echo o > /proc/sysrq-trigger # power off + while true; do sleep 1; done fi