]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fstab-generator: fix target of /sysroot/usr
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 26 Jul 2023 00:31:54 +0000 (09:31 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 26 Jul 2023 14:59:56 +0000 (23:59 +0900)
If /usr mount is picked from the main system's fstab file (prefix_sysroot
is true, and the path is prefixed as /sysroot/usr), then previously it
was installed in the wrong target unit.

src/fstab-generator/fstab-generator.c

index f54fb17065b83303a2982e05607e00e41dc092a4..218c13ad0c9272e662886484d5506b334619bff1 100644 (file)
@@ -919,9 +919,9 @@ static int parse_fstab_one(
         bool is_sysroot_usr = in_initrd() && path_equal(where, "/sysroot/usr");
 
         const char *target_unit =
-                        prefix_sysroot ?                    SPECIAL_INITRD_FS_TARGET :
                         is_sysroot ?                        SPECIAL_INITRD_ROOT_FS_TARGET :
                         is_sysroot_usr ?                    SPECIAL_INITRD_USR_FS_TARGET :
+                        prefix_sysroot ?                    SPECIAL_INITRD_FS_TARGET :
                         mount_is_network(fstype, options) ? SPECIAL_REMOTE_FS_TARGET :
                                                             SPECIAL_LOCAL_FS_TARGET;