summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-07-26 02:31:54 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-07-26 16:59:56 +0200
commitb93d9e06fc6abbd496ec3fb150a4e01c3b7ec72b (patch)
tree01237a00d9d45016ced9677f8fa447c91830e0f1
parentfstab-generator: rename 'initrd' flag to 'prefix_sysroot' (diff)
downloadsystemd-b93d9e06fc6abbd496ec3fb150a4e01c3b7ec72b.tar.xz
systemd-b93d9e06fc6abbd496ec3fb150a4e01c3b7ec72b.zip
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.
-rw-r--r--src/fstab-generator/fstab-generator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index f54fb17065..218c13ad0c 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -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;