Add 10validateroot to validate root device before accessing it.
authorMichael Prokop <mika@grml.org>
Sat, 20 Feb 2010 15:00:27 +0000 (16:00 +0100)
committerMichael Prokop <mika@grml.org>
Sat, 20 Feb 2010 16:19:20 +0000 (17:19 +0100)
grml/10validateroot [new file with mode: 0755]

diff --git a/grml/10validateroot b/grml/10validateroot
new file mode 100755 (executable)
index 0000000..8d42afc
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+        echo "${PREREQ}"
+}
+
+case "${1}" in
+        prereqs)
+                prereqs
+                exit 0
+                ;;
+esac
+
+. /scripts/live-functions
+. /scripts/live-helpers
+
+if ! [ -x "/root/sbin/init" ] ; then
+  panic "rootfs can not be mounted as supposed because of fatal error during bootup."
+fi
+