chiark / gitweb /
fstab-generator: don't accept missing root=, but accept root=none
[elogind.git] / src / fstab-generator / fstab-generator.c
index 77c97fdb2970b3878cc4d4cd45326a8997b3e075..cd1478e54dcaa70e48fe88c3220c68952bf81d0c 100644 (file)
@@ -397,22 +397,15 @@ static int add_root_mount(void) {
         _cleanup_free_ char *what = NULL;
         const char *opts;
 
-        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;
-                }
+        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 (!what)
+                log_oom();
+
         if (!arg_root_options)
                 opts = arg_root_rw > 0 ? "rw" : "ro";
         else if (arg_root_rw >= 0 ||
@@ -426,7 +419,7 @@ static int add_root_mount(void) {
                          "/sysroot",
                          arg_root_fstype,
                          opts,
-                         1,
+                         is_device_path(what) ? 1 : 0,
                          false,
                          false,
                          false,