[ostree] syslinux: Adapt to bootloader UI changes



commit 5c9e83c02caa429045d26e78b932bc54e853ec16
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Nov 9 19:54:37 2014 -0500

    syslinux: Adapt to bootloader UI changes
    
    This was a side-effect of the bootloader UI changes in bug 739416,
    but should now be sufficiently future-proofed with code comments.

 src/libostree/ostree-bootloader-syslinux.c |   10 ++++++++--
 src/libostree/ostree-sysroot-deploy.c      |    3 +++
 2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/libostree/ostree-bootloader-syslinux.c b/src/libostree/ostree-bootloader-syslinux.c
index 86b66fa..6c2b441 100644
--- a/src/libostree/ostree-bootloader-syslinux.c
+++ b/src/libostree/ostree-bootloader-syslinux.c
@@ -206,8 +206,14 @@ _ostree_bootloader_syslinux_write_config (OstreeBootloader          *bootloader,
                (g_str_has_prefix (line, "DEFAULT ")))
         {
           saw_default = TRUE;
-          if (g_str_has_prefix (line, "DEFAULT ostree:"))
-            regenerate_default = TRUE;
+          /* XXX Searching for patterns in the title is rather brittle,
+           *     but this hack is at least noted in the code that builds
+           *     the title to hopefully avoid regressions. */
+          if (g_str_has_prefix (line, "DEFAULT ostree:") ||  /* old format */
+              strstr (line, "(ostree") != NULL)              /* new format */
+            {
+              regenerate_default = TRUE;
+            }
           skip = TRUE;
         }
       
diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c
index 1ebae77..5cf4b2b 100644
--- a/src/libostree/ostree-sysroot-deploy.c
+++ b/src/libostree/ostree-sysroot-deploy.c
@@ -1365,6 +1365,9 @@ install_deployment_kernel (OstreeSysroot   *sysroot,
         }
     }
 
+  /* XXX The SYSLINUX bootloader backend actually parses the title string
+   *     (specifically, it looks for the substring "(ostree"), so further
+   *     changes to the title format may require updating that backend. */
   title_key = g_string_new (val);
   if (deployment_version && *deployment_version)
     {


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