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



commit 6f6c87877eb1d9acafda3ad0b65c50ffab721d97
Author: Javier Martinez Canillas <javier martinez collabora co uk>
Date:   Tue Aug 20 14:28:34 2013 +0000

    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>

 src/ostree/ot-admin-deploy.c |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)
---
diff --git a/src/ostree/ot-admin-deploy.c b/src/ostree/ot-admin-deploy.c
index deda4eb..d437564 100644
--- a/src/ostree/ot-admin-deploy.c
+++ b/src/ostree/ot-admin-deploy.c
@@ -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,
-                                       cancellable, error))
-        goto out;
+      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))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]