]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(dracut-systemd): run systemctl daemon-reload after remove_hostonly_files
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Wed, 9 Nov 2022 07:27:15 +0000 (08:27 +0100)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Fri, 11 Nov 2022 20:10:30 +0000 (20:10 +0000)
Dependencies to systemd .device unit files are marked as "hostonly" in the
special file hostonly-files. These .device unit files can be removed using the
`rd.hostonly=0` command line parameter. But, since systemd v252
(https://github.com/systemd/systemd/pull/24054), the initrd-parse-etc.service
service does not run `systemctl daemon-reload`, so systemd keeps waiting
for these .device units to show up.
This means that if a hostonly device is not available for any reason at boot
time, using `rd.hostonly=0` has no effect and the system will not boot.

modules.d/98dracut-systemd/dracut-cmdline.sh

index 44d5b31b966e1501037ac54545979b1a9ee99307..646fead801825169fd59dd0d1d116fc3331d5408 100755 (executable)
@@ -11,6 +11,7 @@ type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
 if ! getargbool 1 'rd.hostonly'; then
     [ -f /etc/cmdline.d/99-cmdline-ask.conf ] && mv /etc/cmdline.d/99-cmdline-ask.conf /tmp/99-cmdline-ask.conf
     remove_hostonly_files
+    systemctl --no-block daemon-reload
     [ -f /tmp/99-cmdline-ask.conf ] && mv /tmp/99-cmdline-ask.conf /etc/cmdline.d/99-cmdline-ask.conf
 fi