summaryrefslogtreecommitdiffstats
path: root/source/installer
diff options
context:
space:
mode:
Diffstat (limited to 'source/installer')
-rw-r--r--source/installer/ChangeLog.txt4
-rwxr-xr-xsource/installer/build_installer.sh15
2 files changed, 19 insertions, 0 deletions
diff --git a/source/installer/ChangeLog.txt b/source/installer/ChangeLog.txt
index 56a049e16..65c91858b 100644
--- a/source/installer/ChangeLog.txt
+++ b/source/installer/ChangeLog.txt
@@ -1,3 +1,7 @@
+Sun Jan 12 20:36:57 UTC 2020
+ /sbin/reboot: Attempt to kill running processes and sync/umount/sync
+ filesystems before rebooting. Thanks to Jeebizz.
++--------------------------+
Mon Dec 30 20:05:46 UTC 2019
SeTEFI: Patched to remove extra whitespace from lsblk output.
Thanks to Didier Spaier.
diff --git a/source/installer/build_installer.sh b/source/installer/build_installer.sh
index e980207a2..755efe47d 100755
--- a/source/installer/build_installer.sh
+++ b/source/installer/build_installer.sh
@@ -1003,7 +1003,22 @@ rm -f $PKG/$ARCH-installer-filesystem/sbin/reboot
( cd $PKG/$ARCH-installer-filesystem/bin ; ln -sf busybox reboot )
cat << EOF > $PKG/$ARCH-installer-filesystem/sbin/reboot
#!/bin/sh
+echo "Sending all processes the SIGTERM signal."
+/sbin/killall5 -15
+/bin/sleep 2
+echo "Sending all processes the SIGKILL signal."
+/sbin/killall5 -9
+/bin/sleep 2
+echo "Syncing filesystems."
sync
+echo "Unmounting filesystems:"
+# Try to unmount these bind mounts first to prevent them from blocking unmount of the target /:
+umount /mnt/dev 2> /dev/null
+umount /mnt/proc 2> /dev/null
+umount /mnt/sys 2> /dev/null
+/bin/umount -v -a -t no,proc,sysfs,devtmpfs,fuse.gvfsd-fuse,tmpfs
+sync
+echo "Rebooting."
if [ -z "\$*" ]; then
/bin/reboot -f
else