From: Zbigniew Jędrzejewski-Szmek Date: Tue, 3 Dec 2019 13:48:27 +0000 (+0100) Subject: initrd: fix systemd.debug-shell & friends X-Git-Tag: v245-rc1~320^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14177%2Fhead;p=thirdparty%2Fsystemd.git initrd: fix systemd.debug-shell & friends They would get assigned to an inactive target in the initramfs. --- diff --git a/src/debug-generator/debug-generator.c b/src/debug-generator/debug-generator.c index bc8714c4c7f..4e41eca3521 100644 --- a/src/debug-generator/debug-generator.c +++ b/src/debug-generator/debug-generator.c @@ -126,7 +126,15 @@ static int generate_wants_symlinks(void) { STRV_FOREACH(u, arg_wants) { _cleanup_free_ char *p = NULL, *f = NULL; - const char *target = arg_default_unit ?: SPECIAL_DEFAULT_TARGET; + const char *target; + + /* This should match what do_queue_default_job() in core/main.c does. */ + if (arg_default_unit) + target = arg_default_unit; + else if (in_initrd()) + target = SPECIAL_INITRD_TARGET; + else + target = SPECIAL_DEFAULT_TARGET; p = strjoin(arg_dest, "/", target, ".wants/", *u); if (!p)