From db5d39d48b9d9a77565015c1aafb3ef0d2925f02 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sun, 15 May 2016 16:20:20 +0200 Subject: [PATCH] mount_root: check for preinit sentinel file Signed-off-by: John Crispin --- mount_root.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 +#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) { -- 2.30.2