+static int add_root_mount(void) {
+ _cleanup_free_ char *o = NULL, *what = NULL;
+
+ if (isempty(arg_root_what)) {
+ log_debug("Could not find a root= entry on the kernel commandline.");
+ 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)
+ o = strdup(arg_root_rw > 0 ? "rw" : "ro");
+ else {
+ if (arg_root_rw >= 0 ||
+ (!mount_test_option(arg_root_options, "ro") &&
+ !mount_test_option(arg_root_options, "rw")))
+ o = strjoin(arg_root_options, ",", arg_root_rw > 0 ? "rw" : "ro", NULL);
+ else
+ o = strdup(arg_root_options);
+ }
+ if (!o)
+ return log_oom();
+
+ log_debug("Found entry what=%s where=/sysroot type=%s", what, strna(arg_root_fstype));
+ return add_mount(what,
+ "/sysroot",
+ arg_root_fstype,
+ o,
+ 1,
+ false,
+ false,
+ false,
+ SPECIAL_INITRD_ROOT_FS_TARGET,
+ "/proc/cmdline");
+}
+
+static int parse_proc_cmdline_item(const char *key, const char *value) {