diff --git a/dracut/10diskless-generator/diskless-generator b/dracut/10diskless-generator/diskless-generator index d5381b5..b2fca01 100755 --- a/dracut/10diskless-generator/diskless-generator +++ b/dracut/10diskless-generator/diskless-generator @@ -25,6 +25,13 @@ add_requires() { ln -sf "../${name}" "${requires_dir}/${name}" } +add_wants() { + local name="$1" + local wants_dir="${UNIT_DIR}/initrd-root-fs.target.wants" + mkdir -p "${wants_dir}" + ln -sf "../${name}" "${wants_dir}/${name}" +} + # set to 1 to enable copying /oem from the initrd copy_oem=0 # check both the new mount.usr and our old usr kernel options @@ -32,6 +39,8 @@ usr=$(cmdline_arg mount.usr "$(cmdline_arg usr)") root=$(cmdline_arg root) rootfstype=$(cmdline_arg rootfstype tmpfs) rootflags=$(cmdline_arg rootflags) +# check possible future systemd support for separate "/var" +var=$(cmdline_arg mount.var) # If usr= was not specified and a squashfs is bundled in the initrd use it. if [[ -z "${usr}" && -f /usr.squashfs ]]; then @@ -151,3 +160,20 @@ Type=auto Options=nodev EOF fi + +if [[ -z "${var}" ]]; then + add_wants sysroot-oem.mount + cat >"${UNIT_DIR}/sysroot-var.mount" <