Blame SOURCES/coidracut.patch

b78e3a
diff --git a/dracut/50rdcore/module-setup.sh b/dracut/50rdcore/module-setup.sh
b78e3a
index 27a2ac3..443b5cf 100755
b78e3a
--- a/dracut/50rdcore/module-setup.sh
b78e3a
+++ b/dracut/50rdcore/module-setup.sh
b78e3a
@@ -1,5 +1,47 @@
b78e3a
 #!/bin/bash
b78e3a
 
b78e3a
+install_and_enable_unit() {
b78e3a
+    unit="$1"; shift
b78e3a
+    target="$1"; shift
b78e3a
+    inst_simple "$moddir/$unit" "$systemdsystemunitdir/$unit"
b78e3a
+    # note we `|| exit 1` here so we error out if e.g. the units are missing
b78e3a
+    # see https://github.com/coreos/fedora-coreos-config/issues/799
b78e3a
+    systemctl -q --root="$initdir" add-requires "$target" "$unit" || exit 1
b78e3a
+}
b78e3a
+
b78e3a
 install() {
b78e3a
     inst_simple "$moddir/rdcore" "/usr/bin/rdcore"
b78e3a
+
b78e3a
+    inst_simple "$moddir/coreos-installer" "/usr/bin/coreos-installer"
b78e3a
+
b78e3a
+    inst_simple "$moddir/coreos-installer-generator" \
b78e3a
+        "$systemdutildir/system-generators/coreos-installer-generator"
b78e3a
+
b78e3a
+    inst_script "$moddir/coreos-installer-service" \
b78e3a
+        "/usr/libexec/coreos-installer-service"
b78e3a
+
b78e3a
+    inst_script "$moddir/coreos-installer-disable-device-auto-activation" \
b78e3a
+        "/usr/libexec/coreos-installer-disable-device-auto-activation"
b78e3a
+
b78e3a
+    install_and_enable_unit "coreos-installer.service" \
b78e3a
+        "default.target" 
b78e3a
+
b78e3a
+    install_and_enable_unit "coreos-installer-reboot.service" \
b78e3a
+        "default.target" 
b78e3a
+
b78e3a
+#    install_and_enable_unit "coreos-installer-noreboot.service" \
b78e3a
+#        "basic.target" 
b78e3a
+#    inst_simple "$moddir/coreos-installer-reboot.service" \
b78e3a
+#        "$systemdsystemunitdir/coreos-installer-reboot.service"
b78e3a
+#    inst_simple "$moddir/coreos-installer-noreboot.service" \
b78e3a
+#        "$systemdsystemunitdir/coreos-installer-noreboot.service"
b78e3a
+#
b78e3a
+#    inst_simple "$moddir/coreos-installer.target" \
b78e3a
+#        "$systemdsystemunitdir/coreos-installer.target"
b78e3a
+#
b78e3a
+#    inst_simple "$moddir/coreos-installer-pre.target" \
b78e3a
+#        "$systemdsystemunitdir/coreos-installer-pre.target"
b78e3a
+#
b78e3a
+#    inst_simple "$moddir/coreos-installer-post.target" \
b78e3a
+#        "$systemdsystemunitdir/coreos-installer-post.target"
b78e3a
 }
b78e3a
diff --git a/systemd/coreos-installer-generator b/systemd/coreos-installer-generator
b78e3a
index 804d045..b2bcaec 100755
b78e3a
--- a/systemd/coreos-installer-generator
b78e3a
+++ b/systemd/coreos-installer-generator
b78e3a
@@ -30,11 +30,11 @@ karg_bool() {
b78e3a
 }
b78e3a
 
b78e3a
 if [ -n "$(karg coreos.inst.install_dev)" ]; then
b78e3a
-    ln -sf "/usr/lib/systemd/system/coreos-installer-post.target" \
b78e3a
-        "${UNIT_DIR}/default.target"
b78e3a
+#    ln -sf "/usr/lib/systemd/system/coreos-installer-post.target" \
b78e3a
+#        "${UNIT_DIR}/basic.target"
b78e3a
 
b78e3a
     # Create precondition for coreos-installer-reboot.service if requested
b78e3a
     if ! karg_bool coreos.inst.skip_reboot; then
b78e3a
-        touch /run/coreos-installer-reboot
b78e3a
+        > /run/coreos-installer-reboot
b78e3a
     fi
b78e3a
 fi
b78e3a
diff --git a/systemd/coreos-installer-reboot.service b/systemd/coreos-installer-reboot.service
b78e3a
index 18fdb4b..ad79614 100644
b78e3a
--- a/systemd/coreos-installer-reboot.service
b78e3a
+++ b/systemd/coreos-installer-reboot.service
b78e3a
@@ -1,7 +1,7 @@
b78e3a
 [Unit]
b78e3a
 Description=Reboot after CoreOS Installer
b78e3a
-Requires=coreos-installer.target
b78e3a
-After=coreos-installer.target
b78e3a
+#Requires=coreos-installer.target
b78e3a
+After=coreos-installer.service
b78e3a
 OnFailure=emergency.target
b78e3a
 OnFailureJobMode=replace-irreversibly
b78e3a
 ConditionPathExists=/run/coreos-installer-reboot
b78e3a
diff --git a/systemd/coreos-installer.service b/systemd/coreos-installer.service
b78e3a
index 5e222f2..716b783 100644
b78e3a
--- a/systemd/coreos-installer.service
b78e3a
+++ b/systemd/coreos-installer.service
b78e3a
@@ -1,12 +1,20 @@
b78e3a
 [Unit]
b78e3a
 Description=CoreOS Installer
b78e3a
-Before=coreos-installer.target
b78e3a
-After=network-online.target
b78e3a
-Wants=network-online.target
b78e3a
+#Before=coreos-installer.target
b78e3a
+#After=nm-run.service
b78e3a
+#After=network-online.target
b78e3a
+#Wants=network-online.target
b78e3a
 # Until we retry HTTP requests let's wait here until
b78e3a
 # systemd-resolved comes up if enabled.
b78e3a
 # https://github.com/coreos/coreos-installer/issues/283
b78e3a
-After=systemd-resolved.service
b78e3a
+#After=systemd-resolved.service
b78e3a
+
b78e3a
+After=basic.target
b78e3a
+# Network is enabled here
b78e3a
+After=nm-run.service
b78e3a
+# compat: remove when everyone is on dracut 053+
b78e3a
+After=dracut-initqueue.service
b78e3a
+
b78e3a
 ConditionKernelCommandLine=coreos.inst.install_dev
b78e3a
 OnFailure=emergency.target
b78e3a
 OnFailureJobMode=replace-irreversibly