diff --git a/src/libostree/ostree-impl-system-generator.c b/src/libostree/ostree-impl-system-generator.c index e51584cda8..d8463171a4 100644 --- a/src/libostree/ostree-impl-system-generator.c +++ b/src/libostree/ostree-impl-system-generator.c @@ -261,17 +261,17 @@ _ostree_impl_system_generator (const char *normal_dir, const char *early_dir, co if (!cmdline) return glnx_throw (error, "Failed to read /proc/cmdline"); - g_autofree char *ostree_cmdline = otcore_find_proc_cmdline_key (cmdline, "ostree"); - + g_autoptr (GError) otcore_get_ostree_target_error = NULL; + g_autofree char *ostree_target = NULL; /* This could happen in CoreOS live environments, where we hackily mock * the `ostree=` karg for `ostree-prepare-root.service` specifically, but * otherwise that karg doesn't exist on the real command-line. */ - if (!ostree_cmdline) + if (!otcore_get_ostree_target (cmdline, &ostree_target, &otcore_get_ostree_target_error)) return TRUE; if (!require_internal_units (normal_dir, early_dir, late_dir, error)) return FALSE; - if (!fstab_generator (ostree_cmdline, normal_dir, early_dir, late_dir, error)) + if (!fstab_generator (ostree_target, normal_dir, early_dir, late_dir, error)) return FALSE; return TRUE;