generator: run various generators only run on the host, not in initrd

These 5 generators only make sense on the host,not in the initrd, hence
if they end up in the initrd anyway, make them exit quickly.
This commit is contained in:
Lennart Poettering
2023-07-04 23:15:36 +02:00
parent 53888c3393
commit 3ed075cf61
5 changed files with 26 additions and 2 deletions
+6
View File
@@ -10,6 +10,7 @@
#include "fd-util.h"
#include "fileio.h"
#include "generator.h"
#include "initrd-util.h"
#include "log.h"
#include "mkdir-label.h"
#include "parse-util.h"
@@ -212,6 +213,11 @@ static int run(const char *dest, const char *dest_early, const char *dest_late)
assert_se(arg_dest = dest);
if (in_initrd()) {
log_debug("Skipping generator, running in the initrd.");
return EXIT_SUCCESS;
}
r = proc_cmdline_parse(parse_proc_cmdline_item, NULL, 0);
if (r < 0)
log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m");