if (r < 0)
return r;
+ if (in_initrd() && path_equal(where, "/sysroot") && is_device_path(what)) {
+ r = generator_write_initrd_root_device_deps(dest, what);
+ if (r < 0)
+ return r;
+ }
+
r = write_mount_timeout(f, where, opts);
if (r < 0)
return r;
mount_is_network(fstype, options) ? SPECIAL_REMOTE_FS_TARGET :
SPECIAL_LOCAL_FS_TARGET;
- if (is_sysroot && is_device_path(what)) {
- r = generator_write_initrd_root_device_deps(arg_dest, what);
- if (r < 0)
- return r;
- }
-
r = add_mount(source,
arg_dest,
what,
log_debug("Found entry what=%s where=/sysroot type=%s opts=%s", what, strna(arg_root_fstype), strempty(opts));
- if (is_device_path(what)) {
- r = generator_write_initrd_root_device_deps(arg_dest, what);
- if (r < 0)
- return r;
- }
-
makefs = fstab_test_option(opts, "x-systemd.makefs\0");
flags = makefs * MOUNT_MAKEFS;