block: support extroot on already mounted overlay
authorLuca Barbato <lu_zero@gentoo.org>
Tue, 27 Dec 2022 09:05:15 +0000 (10:05 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Sun, 28 May 2023 16:01:12 +0000 (17:01 +0100)
Try to find extroot configuration on already mounted overlay

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
block.c

diff --git a/block.c b/block.c
index 4b45200ad3812f5b79bda5d53c72a13ca5e92636..28eac598b37fc7f998e9ed26843fd364968983d8 100644 (file)
--- a/block.c
+++ b/block.c
@@ -1646,6 +1646,11 @@ static int main_extroot(int argc, char **argv)
        /* enable LOG_INFO messages */
        ulog_threshold(LOG_INFO);
 
+       /* try the currently mounted overlay if exists */
+       err = mount_extroot("/tmp/overlay");
+       if (!err)
+           return err;
+
        /*
         * Look for "rootfs_data". We will want to mount it and check for
         * extroot configuration.