diff options
author | John Crispin <john@phrozen.org> | 2016-05-15 16:20:20 +0200 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2016-05-15 16:20:20 +0200 |
commit | db5d39d48b9d9a77565015c1aafb3ef0d2925f02 (patch) | |
tree | d1982f83a38a5055d94cefd451c69fca5654333a | |
parent | 1ff0c23ce4f0fadfb24557db5c7987e9841bd6d7 (diff) | |
download | fstools-db5d39d48b9d9a77565015c1aafb3ef0d2925f02.tar.gz |
mount_root: check for preinit sentinel file
Signed-off-by: John Crispin <john@phrozen.org>
-rw-r--r-- | mount_root.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mount_root.c b/mount_root.c index bf70265..6e06b45 100644 --- a/mount_root.c +++ b/mount_root.c @@ -12,6 +12,9 @@ */ #include <sys/mount.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.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 stat s; - if (!getenv("PREINIT")) + if (!getenv("PREINIT") && stat("/tmp/.preinit", &s)) return -1; if (!data) { |