X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/efbc756b232a92ad8176ed8cc3d37846939c8245..ca2745c2818a64722ec0b159cd2a08eaf680652a:/package/base-files/default/etc/preinit diff --git a/package/base-files/default/etc/preinit b/package/base-files/default/etc/preinit index 88c8920c9..f82823ec9 100755 --- a/package/base-files/default/etc/preinit +++ b/package/base-files/default/etc/preinit @@ -16,4 +16,14 @@ fi mount_root ${FAILSAFE:+failsafe} +# automagically run firstboot +[ -z "$FAILSAFE" -a -z "$(nvram get no_root_swap)" ] && { + { mount|grep "on / type jffs2" 1>&-; } || firstboot +} + +grep sysfs /proc/filesystems >&- 2>&- && { + mkdir -p /sys + mount -t sysfs none /sys +} + exec /sbin/init