diff --git a/overlay.d/05core/usr/lib/dracut/modules.d/35coreos-live/live-generator b/overlay.d/05core/usr/lib/dracut/modules.d/35coreos-live/live-generator index add4e6dcca..c59bd13fc5 100755 --- a/overlay.d/05core/usr/lib/dracut/modules.d/35coreos-live/live-generator +++ b/overlay.d/05core/usr/lib/dracut/modules.d/35coreos-live/live-generator @@ -28,8 +28,6 @@ fi > /run/ostree-live add_requires sysroot.mount initrd-root-fs.target -add_requires sysroot-etc.mount initrd-root-fs.target -add_requires sysroot-var.mount initrd-root-fs.target # make sure we enable network if required for coreos-livepxe-rootfs # https://github.com/coreos/fedora-coreos-tracker/issues/1423 add_requires coreos-enable-network.service initrd-root-fs.target @@ -53,12 +51,22 @@ ExecStartPre=/usr/sbin/ostree-cmdline start ExecStartPost=/usr/sbin/ostree-cmdline stop EOF +# Determine what to mount in sysroot.mount based on if we were asked to run +# completely from RAM via coreos.liveiso.fromram or coreos.live.fromram karg. +if getargbool 0 coreos.liveiso.fromram || getargbool 0 coreos.live.fromram; then + isorootmount=isoroot + isorootwhere=/isoroot +else + isorootmount=sysroot + isorootwhere=/sysroot +fi + isoroot=$(getarg coreos.liveiso= ||:) if [ -z "${isoroot}" ]; then # In this case, the rootfs is already unpacked into the initrd, or we need # to retrieve it - cat >"${UNIT_DIR}/sysroot.mount" <"${UNIT_DIR}/${isorootmount}.mount" <"${UNIT_DIR}/coreos-liveiso-run-media-iso-cp-rootfsimg.service" <"${UNIT_DIR}/sysroot.mount" <"${UNIT_DIR}/${isorootmount}.mount" <"${UNIT_DIR}/sysroot-xfs-ephemeral-setup.service" <"${UNIT_DIR}/sysroot-xfs-ephemeral-setup.service" <>"${UNIT_DIR}/sysroot.mount" <>"${UNIT_DIR}/sysroot-relabel.service" <"${UNIT_DIR}/sysroot-xfs-ephemeral-setup.service" < "${UNIT_DIR}/sysroot-etc.mount" -cat >>"${UNIT_DIR}/sysroot-etc.mount" < "${UNIT_DIR}/sysroot-etc.mount" + cat >>"${UNIT_DIR}/sysroot-etc.mount" <"${UNIT_DIR}/sysroot-var.mount" -cat >>"${UNIT_DIR}/sysroot-var.mount" <"${UNIT_DIR}/sysroot-var.mount" + cat >>"${UNIT_DIR}/sysroot-var.mount" <>"${UNIT_DIR}/sysroot-relabel.service" <>"${UNIT_DIR}/sysroot-relabel.service" <