ffd055
From 045aa82701ecdebf8482b25dc0abf1b3b7cc3ce5 Mon Sep 17 00:00:00 2001
ffd055
From: Lukas Nykryn <lnykryn@redhat.com>
ffd055
Date: Mon, 30 Nov 2020 11:04:42 +0100
ffd055
Subject: [PATCH] fix backport of 70b19acf
ffd055
ffd055
The patch was missing an important hunk of the original diff which
ffd055
converted another `ln_r` to `systemctl set-default`. Without it, the
ffd055
initrd would try to boot `multi-user.target` instead of `initrd.target`.
ffd055
The reason is that `systemctl set-default` modifies `/etc` while `ln_r`
ffd055
modifies `/usr`. And so the `set-default multi-user.target` in 00systemd
ffd055
takes priority over the `ln_r initrd.target` in `01systemd-initrd`.
ffd055
ffd055
Thanks Jonathan Lebon for spotting this.
ffd055
ffd055
Resolves: #1888779
ffd055
---
ffd055
 modules.d/01systemd-initrd/module-setup.sh | 2 +-
ffd055
 1 file changed, 1 insertion(+), 1 deletion(-)
ffd055
ffd055
diff --git a/modules.d/01systemd-initrd/module-setup.sh b/modules.d/01systemd-initrd/module-setup.sh
ffd055
index cb8a8fa6..a42e220a 100755
ffd055
--- a/modules.d/01systemd-initrd/module-setup.sh
ffd055
+++ b/modules.d/01systemd-initrd/module-setup.sh
ffd055
@@ -36,7 +36,7 @@ install() {
ffd055
         $systemdsystemunitdir/initrd-udevadm-cleanup-db.service \
ffd055
         $systemdsystemunitdir/initrd-parse-etc.service
ffd055
 
ffd055
-    ln_r "${systemdsystemunitdir}/initrd.target" "${systemdsystemunitdir}/default.target"
ffd055
+    systemctl -q --root "$initdir" set-default initrd.target
ffd055
 
ffd055
     local VERSION=""
ffd055
     local PRETTY_NAME=""
ffd055