projects
/
oweals
/
fstools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
block: fall back to external mount helper
[oweals/fstools.git]
/
mount_root.c
diff --git
a/mount_root.c
b/mount_root.c
index bf70265d45cc49568562e58ecfe6bd6cf41929be..dffb0a6c48ee9d9581baba626359005c956f874d 100644
(file)
--- a/
mount_root.c
+++ b/
mount_root.c
@@
-12,6
+12,9
@@
*/
#include <sys/mount.h>
*/
#include <sys/mount.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
@@
-29,8
+32,9
@@
start(int argc, char *argv[1])
{
struct volume *root;
struct volume *data = volume_find("rootfs_data");
{
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) {
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" */
}
/* 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");
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();
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);
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_DEADCODE:
return jffs2_switch(v);
+ case FS_EXT4:
+ case FS_F2FS:
case FS_JFFS2:
case FS_UBIFS:
fs_state_set("/overlay", FS_STATE_READY);
case FS_JFFS2:
case FS_UBIFS:
fs_state_set("/overlay", FS_STATE_READY);