[systemd-devel] [PATCH] Add support for "ROOT=" on the kernel command line
harald at redhat.com
harald at redhat.com
Thu Jan 15 07:24:32 PST 2015
From: Harald Hoyer <harald at redhat.com>
"ROOT=" mounts the initial ramdisk with a tmpfs filesystem.
---
src/fstab-generator/fstab-generator.c | 5 +++++
src/gpt-auto-generator/gpt-auto-generator.c | 7 +++++++
2 files changed, 12 insertions(+)
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index bc4c155..3d2e4dd 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -498,6 +498,11 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
if (free_and_strdup(&arg_root_what, value) < 0)
return log_oom();
+ } else if (streq(key, "ROOT") && value) {
+
+ if (free_and_strdup(&arg_root_what, value) < 0)
+ return log_oom();
+
} else if (streq(key, "rootfstype") && value) {
if (free_and_strdup(&arg_root_fstype, value) < 0)
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index 909fdda..85ceffd 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -613,6 +613,13 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
arg_root_enabled = streq(value, "gpt-auto");
+ } else if (streq(key, "ROOT") && value) {
+
+ /* Disable root disk logic if there's a ROOT= value
+ * specified (unless it happens to be "gpt-auto") */
+
+ arg_root_enabled = streq(value, "gpt-auto");
+
} else if (streq(key, "rw") && !value)
arg_root_rw = true;
else if (streq(key, "ro") && !value)
--
2.2.1
More information about the systemd-devel
mailing list