Blame SOURCES/0148-Use-BLS-version-field-to-compare-entries-if-id-field.patch

8631a2
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
8631a2
From: Javier Martinez Canillas <javierm@redhat.com>
8631a2
Date: Fri, 27 Apr 2018 17:53:41 +0200
8631a2
Subject: [PATCH] Use BLS version field to compare entries if id field isn't
8631a2
 defined
8631a2
8631a2
The BootLoaderSpec fragments generated by OSTree don't have the id field,
8631a2
so grub2 will attempt to sort the entries by using the title field which
8631a2
may not be correct. The entries do have a version field though so use it.
8631a2
8631a2
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
8631a2
---
8631a2
 grub-core/commands/blscfg.c | 3 +++
8631a2
 1 file changed, 3 insertions(+)
8631a2
8631a2
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
8631a2
index 6ab85df6b3a..c52d2b2e05a 100644
8631a2
--- a/grub-core/commands/blscfg.c
8631a2
+++ b/grub-core/commands/blscfg.c
8631a2
@@ -418,6 +418,9 @@ static int bls_cmp(const void *p0, const void *p1, void *state UNUSED)
8631a2
 
8631a2
   rc = bls_keyval_cmp (e0, e1, "id");
8631a2
 
8631a2
+  if (rc == 0)
8631a2
+    rc = bls_keyval_cmp (e0, e1, "version");
8631a2
+
8631a2
   if (rc == 0)
8631a2
     rc = bls_keyval_cmp (e0, e1, "title");
8631a2