diff options
author | Harald Hoyer <harald@redhat.com> | 2013-03-04 21:00:56 +0100 |
---|---|---|
committer | Harald Hoyer <harald@redhat.com> | 2013-03-04 21:00:56 +0100 |
commit | 135b5212d4234f5b75c9b86c9f924047c8d07589 (patch) | |
tree | f30c7d971babc348e9b82d8087076f76874981d5 /src/fstab-generator | |
parent | fstab-generator: place initrd /sysroot mounts in initrd-fs.target (diff) | |
download | systemd-135b5212d4234f5b75c9b86c9f924047c8d07589.tar.xz systemd-135b5212d4234f5b75c9b86c9f924047c8d07589.zip |
fstab-generator: only handle block devices with root= kernel command line parameter
skip s.th. like root=nfs:... root=iscsi:... root=nbd:...
Diffstat (limited to 'src/fstab-generator')
-rw-r--r-- | src/fstab-generator/fstab-generator.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c index a8436e6233..986f72d7e6 100644 --- a/src/fstab-generator/fstab-generator.c +++ b/src/fstab-generator/fstab-generator.c @@ -530,18 +530,21 @@ static int parse_new_root_from_proc_cmdline(void) { free(word); } - if (what) { + if (!what) { + log_error("Could not find a root= entry on the kernel commandline."); + return 0; + } - log_debug("Found entry what=%s where=/sysroot type=%s", what, type); - r = add_mount(what, "/sysroot", type, opts, 0, false, false, false, - false, false, true, "/proc/cmdline"); + if (what[0] != '/') { + log_debug("Skipping entry what=%s where=/sysroot type=%s", what, type); + return 0; + } - if (r < 0) - return r; - } else - log_error("Could not find a root= entry on the kernel commandline."); + log_debug("Found entry what=%s where=/sysroot type=%s", what, type); + r = add_mount(what, "/sysroot", type, opts, 0, false, false, false, + false, false, true, "/proc/cmdline"); - return 0; + return (r < 0) ? r : 0; } static int parse_proc_cmdline(void) { |