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.
This commit is contained in:
Gábor Stefanik 2024-01-12 13:07:34 +01:00
parent 754d967b29
commit 36c1925742
1 changed files with 1 additions and 0 deletions

View File

@ -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