From 7f9f3f55ab925ffb2b6e2798e8bdedc90891dabe Mon Sep 17 00:00:00 2001 From: David Runge Date: Fri, 28 Jul 2023 01:45:37 +0200 Subject: [PATCH] src/bootchooser: support the changed output of efibootmgr 18 Since efibootmgr 18, the default output of `efibootmgr` is now more verbose [1], which breaks the assumptions made by RAUC in regards to parsing the output. This issue is also affecting others [2]. Fix the parsing logic by unconditionally removing anything after a tab in the detected name part of the boot entry, so that the unused data part is discarded. Emit a debug message for each found boot entry, as this helps in detecting issues in the future. [1] https://github.com/rhboot/efibootmgr/commit/8ec3e9dedb3cb62f19847794012420b90f475398 [2] https://github.com/rhboot/efibootmgr/issues/169 Signed-off-by: David Runge --- src/bootchooser.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/bootchooser.c b/src/bootchooser.c index 679c93977..2e8caebfe 100644 --- a/src/bootchooser.c +++ b/src/bootchooser.c @@ -1159,11 +1159,20 @@ static gboolean efi_bootorder_get(GList **bootorder_entries, GList **all_entries } while (g_match_info_matches(match)) { + gchar *tab_point = NULL; efi_bootentry *entry = g_new0(efi_bootentry, 1); entry->num = g_match_info_fetch(match, 1); entry->name = g_match_info_fetch(match, 2); + + /* Remove anything after a tab, as it is most likely path + * information which we don't need. */ + tab_point = strchr(entry->name, '\t'); + if (tab_point) + *tab_point = '\0'; + entries = g_list_append(entries, entry); g_match_info_next(match, NULL); + g_debug("Detected EFI boot entry %s: %s", entry->num, entry->name); } g_clear_pointer(®ex, g_regex_unref);