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