Commit 7c4a63a5 authored by Adam Wujek's avatar Adam Wujek 💬

rootfs: fix lack of reboot after update

The problem is that the "reboot" command sends the signal to the init. However,
it looks like init queues all incoming signals. They're handled after all
"sysinit" commands from the inittab are finished.
reboot -f skip sending the signal and triggers the reboot immediately.

This problem pop up after update of a buildroot to version 2016.02.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent ed314a01
......@@ -201,11 +201,23 @@ if $change_update_date; then
fi
# If we changed bloader or kernel or initramfs, we reboot. Otherwise proceed.
if $reboot; then
cd /
umount /update
umount /boot
echo "Gentle reboot"
reboot
# We notified init, but it takes time. Stop breathing while waiting to die.
sleep 9999
sleep 2
# If init ignores signals before all sysinit entires from inittab are done,
# we have to force the reboot.
echo "Force reboot"
# Firstly, remount / in case we use nfs
/bin/mount -o remount,ro /
# umount what is left
/bin/umount -a -r
# force reboot
reboot -f
# wait forever
while true; do sleep 1; done
fi
# Here we are: boot normally: if initrd, mount /usr and copy /etc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment