X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=mount_root.c;h=dffb0a6c48ee9d9581baba626359005c956f874d;hb=7d78836dac9e0ece57c51ab06589efa524276b9d;hp=bf70265d45cc49568562e58ecfe6bd6cf41929be;hpb=d90165cdbdac40e6e2699d831e13473479d8cb79;p=project%2Ffstools.git diff --git a/mount_root.c b/mount_root.c index bf70265..dffb0a6 100644 --- a/mount_root.c +++ b/mount_root.c @@ -12,6 +12,9 @@ */ #include +#include +#include +#include #include #include @@ -29,8 +32,9 @@ start(int argc, char *argv[1]) { struct volume *root; struct volume *data = volume_find("rootfs_data"); + struct stat s; - if (!getenv("PREINIT")) + if (!getenv("PREINIT") && stat("/tmp/.preinit", &s)) return -1; if (!data) { @@ -52,6 +56,7 @@ start(int argc, char *argv[1]) } /* There isn't extroot, so just try to mount "rootfs_data" */ + volume_init(data); switch (volume_identify(data)) { case FS_NONE: ULOG_WARN("no usable overlay filesystem found, using tmpfs overlay\n"); @@ -66,6 +71,8 @@ start(int argc, char *argv[1]) ULOG_NOTE("jffs2 not ready yet, using temporary tmpfs overlay\n"); return ramoverlay(); + case FS_EXT4: + case FS_F2FS: case FS_JFFS2: case FS_UBIFS: mount_overlay(data); @@ -104,6 +111,8 @@ done(int argc, char *argv[1]) case FS_DEADCODE: return jffs2_switch(v); + case FS_EXT4: + case FS_F2FS: case FS_JFFS2: case FS_UBIFS: fs_state_set("/overlay", FS_STATE_READY);