]> git.pld-linux.org Git - projects/geninitrd.git/commitdiff
don't fail if root device cannot be determined
authorJan Palus <atler@pld-linux.org>
Mon, 1 Nov 2021 21:46:34 +0000 (22:46 +0100)
committerJan Palus <atler@pld-linux.org>
Tue, 2 Nov 2021 00:46:28 +0000 (01:46 +0100)
useful when creating generic images on loop device (/dev not mounted,
root referenced by either LABEL or UUID, required modules added manually)

functions
geninitrd

index 3a521907ce436b8466ce4d74acf920e8a1dcb79d..186b96751f33a205e7649e71de0c9a74929360f4 100644 (file)
--- a/functions
+++ b/functions
@@ -109,8 +109,7 @@ find_root() {
        fi
 
        if [ ! -r "$rootdev" ]; then
-               echo >&2 "$function: rootfs device file $rootdev doesn't exist"
-               return 1
+               echo >&2 "WARNING: $function: rootfs device file $rootdev doesn't exist"
        fi
 
        return 0
index 8baaffabaabb50698b88d35311bfc98aa8bb57b3..2cb8d34fc6fefa96c5b55d1c28581fc675fe344e 100755 (executable)
--- a/geninitrd
+++ b/geninitrd
@@ -952,7 +952,7 @@ initrd_gen_initramfs_switchroot() {
        if [ "$rootdev" = "/dev/nfs" ]; then
                echo "rootfs on NFS root=/dev/nfs"
        else
-               [ ! -e "$DESTDIR/$rootdev" ] && inst $rootdev $rootdev
+               [ -e $rootdev ] && [ ! -e "$DESTDIR/$rootdev" ] && inst $rootdev $rootdev
        fi
 
        # parse 'root=xxx' kernel commandline
This page took 0.222471 seconds and 4 git commands to generate.