The logic for checking which bootversion to use tries to access
sysroot->bootversion if the user didn't specify an explicit bootversion
on the command-line nor through the env var. However, at that point, the
sysroot object is not yet initialized, so it will always return 0, even
when it's 1.
This would cause e.g. `grub2-mkconfig` to have no output for the BLS
entries whenever the entries were under `/boot/loader.1`.
Related: RHBZ1293986
&sysroot, cancellable, error))
goto out;
+ if (!ostree_sysroot_load (sysroot, cancellable, error))
+ goto out;
+
if (argc >= 2)
{
bootversion = (guint) g_ascii_strtoull (argv[1], NULL, 10);
g_assert (bootversion == 0 || bootversion == 1);
}
- if (!ostree_sysroot_load (sysroot, cancellable, error))
- goto out;
-
if (!ostree_cmd__private__()->ostree_generate_grub2_config (sysroot, bootversion, 1, cancellable, error))
goto out;