admin: Don't fail to deploy if there isn't a bootloader config

Currently, when deploying an OSTree that does not contain a
bootloader configuration it fails with the following message:

"No known bootloader configuration detected"

A bootloader configuration is not strictly necessary if the
bootloader used is able to parse /boot/loader/entries on boot.

So, failing to deploy seems to be a little harsh. It is better
to just not write the bootloader configuration if a previous
one was not found but still swap the bootversion.

https://bugzilla.gnome.org/show_bug.cgi?id=706477

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
This commit is contained in:
Javier Martinez Canillas 2013-08-20 14:28:34 +00:00 committed by Colin Walters
parent 8abad0b452
commit 6f6c87877e
1 changed files with 7 additions and 12 deletions

View File

@ -975,15 +975,7 @@ ot_admin_write_deployments (GFile *sysroot,
{
gboolean ret = FALSE;
guint i;
gs_unref_object OtBootloader *bootloader = NULL;
bootloader = ot_admin_query_bootloader (sysroot);
if (!bootloader)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"No known bootloader configuration detected");
goto out;
}
gs_unref_object OtBootloader *bootloader = ot_admin_query_bootloader (sysroot);
if (current_bootversion == new_bootversion)
{
@ -1029,9 +1021,12 @@ ot_admin_write_deployments (GFile *sysroot,
goto out;
}
if (!ot_bootloader_write_config (bootloader, new_bootversion,
if (bootloader && !ot_bootloader_write_config (bootloader, new_bootversion,
cancellable, error))
{
g_prefix_error (error, "Bootloader write config: ");
goto out;
}
if (!swap_bootloader (sysroot, current_bootversion, new_bootversion,
cancellable, error))