Simplify shutdown, no need for workarounds to remount / read-only

Calling sync is not needed, remount does this for us.

Remount with 'dummydev' causes warnings and is not needed.  It appears
sysvinit used this to try and fix a sparc related bug.  Instead, use the
rootfs keyword to ensure we don't accidentally remount a bind mounted /.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2022-04-02 11:09:29 +02:00
parent 6f802a7ff1
commit 7c42986800
+2 -5
View File
@@ -328,11 +328,8 @@ void do_shutdown(shutop_t op)
/* ... unmount remaining regular file systems. */
unmount_regular();
/* We sit on / so we must remount it ro, try all the things! */
sync();
run("mount -n -o remount,ro -t dummytype dummydev /", "mount");
run("mount -n -o remount,ro dummydev /", "mount");
run("mount -n -o remount,ro /", "mount");
/* We sit on / so we must remount it read-only */
run("mount -n -o remount,ro -t none rootfs /", "mount");
/* Call mdadm to mark any RAID array(s) as clean before halting. */
mdadm_wait();