]> git.pld-linux.org Git - projects/geninitrd.git/commitdiff
don't try to mount /usr if it's not on separate fs
authorJan Palus <atler@pld-linux.org>
Wed, 28 Sep 2022 20:04:22 +0000 (22:04 +0200)
committerJan Palus <atler@pld-linux.org>
Wed, 28 Sep 2022 20:04:22 +0000 (22:04 +0200)
geninitrd

index 2cb8d34fc6fefa96c5b55d1c28581fc675fe344e..0a422ee4c9820f1517773ed0d09d71f1de6f3eaa 100755 (executable)
--- a/geninitrd
+++ b/geninitrd
@@ -1085,8 +1085,10 @@ initrd_gen_initramfs_switchroot() {
                # probably break (sometimes even silently) in mysterious ways. Consult
                # http://freedesktop.org/wiki/Software/systemd/separate-usr-is-broken
                # for more information.
-               echo trying to mount /usr
-               chroot /newroot mount -n /usr
+               if chroot /newroot findmnt -s -n /usr > /dev/null 2> /dev/null; then
+                       echo trying to mount /usr
+                       chroot /newroot mount -n /usr
+               fi
 
                exec switch_root /newroot $init ${1:+"$@"}
 
This page took 0.044792 seconds and 4 git commands to generate.