fstab-generator: fix target of /sysroot/usr

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.
This commit is contained in:
Yu Watanabe
2023-07-26 09:31:54 +09:00
parent 8f88e57397
commit b93d9e06fc

View 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;