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