diff --git a/overlay.d/05core/usr/lib/dracut/modules.d/20live/coreos-liveiso-reconfigure-nm-wait-online.service b/overlay.d/05core/usr/lib/dracut/modules.d/20live/coreos-liveiso-reconfigure-nm-wait-online.service new file mode 100644 index 000000000..1c910a2ee --- /dev/null +++ b/overlay.d/05core/usr/lib/dracut/modules.d/20live/coreos-liveiso-reconfigure-nm-wait-online.service @@ -0,0 +1,23 @@ +# Configure NetworkManager-wait-online in the real root for the +# Live ISO to timeout quicker and also not explicitly fail since +# booting the Live ISO without network is a valid use case. +# +# Doing this improves the user experience when booting the +# Live ISO without network. + +[Unit] +Description=Reconfigure NetworkManager-wait-online service +DefaultDependencies=no +# Make sure we are in the initramfs and we are booted to the live ISO +ConditionPathExists=/usr/lib/initrd-release +ConditionKernelCommandLine=coreos.liveiso +ConditionPathExists=/run/ostree-live + +[Service] +Type=oneshot +RemainAfterExit=yes +# Note keep this in sync with NetworkManager-wait-online.service +# Right now we are keeping the same ExecStart but we are making it +# OK to fail (`-`) and timeout sooner (5 seconds vs 30). +ExecStartPre=/usr/bin/mkdir -p /run/systemd/system/NetworkManager-wait-online.service.d +ExecStart=/bin/bash -c 'echo -e "[Service]\nExecStart=\nExecStart=-/usr/bin/nm-online -s -q --timeout=5" > /run/systemd/system/NetworkManager-wait-online.service.d/liveiso.conf' diff --git a/overlay.d/05core/usr/lib/dracut/modules.d/20live/live-generator b/overlay.d/05core/usr/lib/dracut/modules.d/20live/live-generator index d4b7c7535..ca7935ebf 100755 --- a/overlay.d/05core/usr/lib/dracut/modules.d/20live/live-generator +++ b/overlay.d/05core/usr/lib/dracut/modules.d/20live/live-generator @@ -28,6 +28,7 @@ add_requires sysroot-etc.mount initrd-root-fs.target add_requires sysroot-var.mount initrd-root-fs.target add_requires coreos-liveiso-network-kargs.service initrd.target +add_requires coreos-liveiso-reconfigure-nm-wait-online.service initrd.target mkdir -p "${UNIT_DIR}/ostree-prepare-root.service.d" cat > "${UNIT_DIR}/ostree-prepare-root.service.d/10-live.conf" <