|
|
7dd7e2 |
diff --git a/systemd/coreos-installer-generator b/systemd/coreos-installer-generator
|
|
|
7dd7e2 |
index b2bcaec..2b85dc5 100755
|
|
|
7dd7e2 |
--- a/systemd/coreos-installer-generator
|
|
|
7dd7e2 |
+++ b/systemd/coreos-installer-generator
|
|
|
7dd7e2 |
@@ -2,6 +2,8 @@
|
|
|
7dd7e2 |
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
|
|
7dd7e2 |
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
|
|
7dd7e2 |
|
|
|
7dd7e2 |
+command -v getarg >/dev/null || . /usr/lib/dracut-lib.sh
|
|
|
7dd7e2 |
+
|
|
|
7dd7e2 |
set -e
|
|
|
7dd7e2 |
|
|
|
7dd7e2 |
# Generators don't have logging right now
|
|
|
7dd7e2 |
@@ -10,6 +12,14 @@ exec 1>/dev/kmsg; exec 2>&1
|
|
|
7dd7e2 |
|
|
|
7dd7e2 |
UNIT_DIR="${1:-/tmp}"
|
|
|
7dd7e2 |
|
|
|
7dd7e2 |
+add_requires() {
|
|
|
7dd7e2 |
+ local name="$1"; shift
|
|
|
7dd7e2 |
+ local target="$1"; shift
|
|
|
7dd7e2 |
+ local requires_dir="${UNIT_DIR}/${target}.requires"
|
|
|
7dd7e2 |
+ mkdir -p "${requires_dir}"
|
|
|
7dd7e2 |
+ ln -sf "../${name}" "${requires_dir}/${name}"
|
|
|
7dd7e2 |
+}
|
|
|
7dd7e2 |
+
|
|
|
7dd7e2 |
cmdline=( $(
|
|
|
7dd7e2 |
karg() {
|
|
|
7dd7e2 |
local name="$1" value="$2"
|
|
|
7dd7e2 |
@@ -38,3 +48,38 @@ if [ -n "$(karg coreos.inst.install_dev)" ]; then
|
|
|
7dd7e2 |
> /run/coreos-installer-reboot
|
|
|
7dd7e2 |
fi
|
|
|
7dd7e2 |
fi
|
|
|
7dd7e2 |
+
|
|
|
7dd7e2 |
+add_requires run-media-iso.mount default.target
|
|
|
7dd7e2 |
+
|
|
|
7dd7e2 |
+isoroot=$(getarg edge.liveiso= ||:)
|
|
|
7dd7e2 |
+
|
|
|
7dd7e2 |
+mkdir -p /run/media/iso
|
|
|
7dd7e2 |
+isosrc=dev/disk/by-label/${isoroot}
|
|
|
7dd7e2 |
+isosrc_escaped=$(systemd-escape -p --suffix=device "${isosrc}")
|
|
|
7dd7e2 |
+
|
|
|
7dd7e2 |
+if [ -n "${isoroot}" ]; then
|
|
|
7dd7e2 |
+cat >"${UNIT_DIR}/run-media-iso.mount" <
|
|
|
7dd7e2 |
+# Automatically generated by live-generator
|
|
|
7dd7e2 |
+[Unit]
|
|
|
7dd7e2 |
+DefaultDependencies=false
|
|
|
7dd7e2 |
+# HACK for https://github.com/coreos/fedora-coreos-config/issues/437
|
|
|
7dd7e2 |
+Wants=systemd-udev-settle.service
|
|
|
7dd7e2 |
+Wants=systemd-udevd.service
|
|
|
7dd7e2 |
+After=systemd-udevd.service
|
|
|
7dd7e2 |
+After=basic.target
|
|
|
7dd7e2 |
+# Network is enabled here
|
|
|
7dd7e2 |
+After=nm-run.service
|
|
|
7dd7e2 |
+# compat: remove when everyone is on dracut 053+
|
|
|
7dd7e2 |
+After=dracut-initqueue.service
|
|
|
7dd7e2 |
+
|
|
|
7dd7e2 |
+Before=coreos-installer.service
|
|
|
7dd7e2 |
+After=${isosrc_escaped}
|
|
|
7dd7e2 |
+Requires=${isosrc_escaped}
|
|
|
7dd7e2 |
+ConditionKernelCommandLine=coreos.inst.image_file
|
|
|
7dd7e2 |
+[Mount]
|
|
|
7dd7e2 |
+What=/${isosrc}
|
|
|
7dd7e2 |
+Where=/run/media/iso
|
|
|
7dd7e2 |
+Options=ro
|
|
|
7dd7e2 |
+Type=iso9660
|
|
|
7dd7e2 |
+EOF
|
|
|
7dd7e2 |
+fi
|
|
|
7dd7e2 |
\ No newline at end of file
|
|
|
7dd7e2 |
diff --git a/systemd/growfs.service b/systemd/growfs.service
|
|
|
7dd7e2 |
index 6d77aaa..fee934d 100644
|
|
|
7dd7e2 |
--- a/systemd/growfs.service
|
|
|
7dd7e2 |
+++ b/systemd/growfs.service
|
|
|
7dd7e2 |
@@ -5,7 +5,6 @@ DefaultDependencies=false
|
|
|
7dd7e2 |
After=coreos-installer.service
|
|
|
7dd7e2 |
Before=coreos-installer-reboot.service
|
|
|
7dd7e2 |
Requires=dev-disk-by\x2dlabel-root.device
|
|
|
7dd7e2 |
-After=dev-disk-by\x2dlabel-root.device
|
|
|
7dd7e2 |
|
|
|
7dd7e2 |
[Service]
|
|
|
7dd7e2 |
Type=oneshot
|