summaryrefslogtreecommitdiffstats
path: root/src/getty-generator
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-06-30 10:23:10 +0200
committerLennart Poettering <lennart@poettering.net>2023-07-04 23:15:36 +0200
commit3ed075cf6158b2fadd904aba0abfe9bfe020dbf5 (patch)
tree4b14fa7ef5763cd1ac43eee5004e0aae956c5f64 /src/getty-generator
parenttest: verify that the getty generator with creds works (diff)
downloadsystemd-3ed075cf6158b2fadd904aba0abfe9bfe020dbf5.tar.xz
systemd-3ed075cf6158b2fadd904aba0abfe9bfe020dbf5.zip
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.
Diffstat (limited to 'src/getty-generator')
-rw-r--r--src/getty-generator/getty-generator.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/getty-generator/getty-generator.c b/src/getty-generator/getty-generator.c
index 24c35ae987..4379b4b648 100644
--- a/src/getty-generator/getty-generator.c
+++ b/src/getty-generator/getty-generator.c
@@ -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");