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:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "fs-util.h"
|
||||
#include "generator.h"
|
||||
#include "initrd-util.h"
|
||||
#include "log.h"
|
||||
#include "path-util.h"
|
||||
#include "proc-cmdline.h"
|
||||
@@ -61,6 +62,11 @@ static int run(const char *dest, const char *dest_early, const char *dest_late)
|
||||
|
||||
assert_se(arg_dest = dest_early);
|
||||
|
||||
if (in_initrd()) {
|
||||
log_debug("Skipping generator, running in the initrd.");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
r = generate_symlink();
|
||||
if (r <= 0)
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user