summaryrefslogtreecommitdiffstats
path: root/openwrt/package/base-files/default/etc/preinit
diff options
context:
space:
mode:
Diffstat (limited to 'openwrt/package/base-files/default/etc/preinit')
-rwxr-xr-xopenwrt/package/base-files/default/etc/preinit5
1 files changed, 5 insertions, 0 deletions
diff --git a/openwrt/package/base-files/default/etc/preinit b/openwrt/package/base-files/default/etc/preinit
index 88c8920c9..ac9039ca7 100755
--- a/openwrt/package/base-files/default/etc/preinit
+++ b/openwrt/package/base-files/default/etc/preinit
@@ -16,4 +16,9 @@ fi
mount_root ${FAILSAFE:+failsafe}
+# automagically run firstboot
+[ -z "$FAILSAFE" -a -z "$(nvram get no_root_swap)" ] && {
+ { mount|grep "on / type jffs2" 1>&-; } || firstboot
+}
+
exec /sbin/init