add preinit modularization work by Daniel Dickinson (cshore)
[openwrt-10.03/.git] / package / base-files / files / lib / preinit / 20_check_jffs2_ready
diff --git a/package/base-files/files/lib/preinit/20_check_jffs2_ready b/package/base-files/files/lib/preinit/20_check_jffs2_ready
new file mode 100644 (file)
index 0000000..3c5cf67
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Copyright (C) 2006-2010 OpenWrt.org
+# Copyright (C) 2010 Vertical Communications
+
+mount_no_jffs2() {
+    echo "jffs2 not ready yet; using ramdisk"
+    ramoverlay
+}
+
+check_for_jffs2() {
+    check_skip || {
+       jffs2_ready || {
+           mount_no_jffs2 && pi_mount_skip_next=true
+       }
+    }
+}
+
+boot_hook_add preinit_mount_root check_for_jffs2
+