From: John Crispin Date: Tue, 10 May 2016 13:39:37 +0000 (+0200) Subject: mount_root: code failed in failsafe X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=09f8e0097fe1370700658542e7bda831c31de4bf;p=oweals%2Ffstools.git 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 --- 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);