mirror of
https://github.com/systemd/systemd.git
synced 2026-08-04 23:20:32 +00:00
generator: add root=off to explicitly turn search for rootfs off
This is useful when booting into storage target mode, where we do not want to enter a root fs, we just want to stay forever in the initrd, and hence there's value in not even generating and jobs to find the rootfs
This commit is contained in:
@@ -1132,6 +1132,11 @@ static bool validate_root_or_usr_mount_source(const char *what, const char *swit
|
||||
return false;
|
||||
}
|
||||
|
||||
if (streq(what, "off")) {
|
||||
log_debug("Skipping %s directory handling, as this was explicitly turned off.", switch_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (parse_gpt_auto_root(what) > 0) {
|
||||
/* This is handled by gpt-auto-generator */
|
||||
log_debug("Skipping %s directory handling, as gpt-auto was requested.", switch_name);
|
||||
|
||||
@@ -1114,6 +1114,10 @@ GptAutoRoot parse_gpt_auto_root(const char *value) {
|
||||
return GPT_AUTO_ROOT_DISSECT_FORCE;
|
||||
}
|
||||
|
||||
log_debug("Disabling root partition auto-detection, root= is neither unset, nor set to 'gpt-auto', 'gpt-auto-force', 'dissect' or 'dissect-force'.");
|
||||
if (streq(value, "off"))
|
||||
log_debug("Disabling root partition auto-detection, root= handling is explicitly turned off.");
|
||||
else
|
||||
log_debug("Disabling root partition auto-detection, root= is neither unset, nor set to 'gpt-auto', 'gpt-auto-force', 'dissect' or 'dissect-force'.");
|
||||
|
||||
return GPT_AUTO_ROOT_OFF;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user