From 09f8e0097fe1370700658542e7bda831c31de4bf Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 10 May 2016 15:39:37 +0200 Subject: [PATCH] mount_root: code failed in failsafe the code checks if we are in PREINIT before mounting root. change this to check if root is actually mounted. this is a regression caused by ssh login during failsafe. Signed-off-by: John Crispin --- mount_root.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mount_root.c b/mount_root.c index 47a3409..77d683b 100644 --- a/mount_root.c +++ b/mount_root.c @@ -27,14 +27,16 @@ static int start(int argc, char *argv[1]) { - struct volume *root; + struct volume *root = volume_find("rootfs"); struct volume *data = volume_find("rootfs_data"); - if (!getenv("PREINIT")) + if (data && find_mount_point(data->blk, 0)) + return -1; + + if (root && find_mount_point(root->blk, 0)) return -1; if (!data) { - root = volume_find("rootfs"); volume_init(root); ULOG_NOTE("mounting /dev/root\n"); mount("/dev/root", "/", NULL, MS_NOATIME | MS_REMOUNT, 0); -- 2.25.1