]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/boot.d/06-mountrootfs
HinzugefĆ¼gt:
[people/teissler/ipfire-2.x.git] / src / boot.d / 06-mountrootfs
diff --git a/src/boot.d/06-mountrootfs b/src/boot.d/06-mountrootfs
new file mode 100644 (file)
index 0000000..a8abb42
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+STRING="Checking root filesystem"
+
+fsck -R -T -a -C /
+RC=$?  
+
+if [ "$RC" = "0" ]; then
+       echo "$STRING: Success"
+elif [ "$RC" = "1" ]; then
+       echo "$STRING: Passed"
+fi
+
+# A return of 2 or higher means there were serious problems.
+if [ $RC -gt 1 ]; then
+       echo "$STRING: Failed"
+       echo "*** An error occurred during the file system check."
+       echo "*** Dropping you to a shell; the system will reboot"
+       echo "*** when you leave the shell."
+       export PS1="(Repair filesystem) \# # "
+       sulogin
+       echo "Unmounting filesystems"
+       umount -a
+       mount -n -o remount,ro /
+       echo "Automatic reboot in progress."
+       reboot -f
+fi
+
+echo "Mounting root read/write"
+mount -n -o remount,rw /