Blame SOURCES/coidracut.patch

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