diff options
author | Tobias Hunger <tobias.hunger@gmail.com> | 2015-03-24 00:52:59 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-03-24 00:12:03 -0400 |
commit | b0438462089d1e1460429a57718305de08985908 (patch) | |
tree | 302daa5456cb4898d7370e6740bbd5c53d1a5776 /src/fstab-generator/fstab-generator.c | |
parent | ea342a99fd4bbdb25e690186b25a8f1c88ed61b3 (diff) |
fstab-generator: Support root on tmpfs (or other deviceless FS)
This allows for stateless systems.
Diffstat (limited to 'src/fstab-generator/fstab-generator.c')
-rw-r--r-- | src/fstab-generator/fstab-generator.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c index 2ece12f792..77c97fdb29 100644 --- a/src/fstab-generator/fstab-generator.c +++ b/src/fstab-generator/fstab-generator.c @@ -397,15 +397,20 @@ static int add_root_mount(void) { _cleanup_free_ char *what = NULL; const char *opts; - if (isempty(arg_root_what)) { - log_debug("Could not find a root= entry on the kernel command line."); - return 0; - } + if (fstype_is_deviceless(arg_root_fstype)) { + if (free_and_strdup(&what, arg_root_what) < 0) + return log_oom(); + } else { + if (isempty(arg_root_what)) { + log_debug("Could not find a root= entry on the kernel command line."); + return 0; + } - what = fstab_node_to_udev_node(arg_root_what); - if (!path_is_absolute(what)) { - log_debug("Skipping entry what=%s where=/sysroot type=%s", what, strna(arg_root_fstype)); - return 0; + what = fstab_node_to_udev_node(arg_root_what); + if (!path_is_absolute(what)) { + log_debug("Skipping entry what=%s where=/sysroot type=%s", what, strna(arg_root_fstype)); + return 0; + } } if (!arg_root_options) |