pid1: use initrd.target in the initramfs by default

This makes the code do what the documentation says. The code had no inkling
about initrd.target, so I think this change is fairly risky. As a fallback,
default.target will be loaded, so initramfses which relied on current behaviour
will still work, as along as they don't have a different initrd.target.

In an initramfs created with recent dracut:
$ ls -l usr/lib/systemd/system/{default.target,initrd.target}
lrwxrwxrwx. usr/lib/systemd/system/default.target -> initrd.target
-rw-r--r--. usr/lib/systemd/system/initrd.target
So at least for dracut, there should be no difference.

Also avoid a pointless allocation.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2019-11-28 19:59:33 +01:00
parent 6e86b24db3
commit 8755dbad5b
2 changed files with 22 additions and 14 deletions
+1
View File
@@ -2,6 +2,7 @@
#pragma once
#define SPECIAL_DEFAULT_TARGET "default.target"
#define SPECIAL_INITRD_TARGET "initrd.target"
/* Shutdown targets */
#define SPECIAL_UMOUNT_TARGET "umount.target"