From: Danilo Spinella Date: Thu, 11 Sep 2025 08:51:27 +0000 (+0200) Subject: boot: Strip boot counter from entry id X-Git-Tag: v258.1~68 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e67e5145675b1849a554aeab4a32badd7d260f9f;p=thirdparty%2Fsystemd.git boot: Strip boot counter from entry id When boot counter is found in the boot entry filename, strip it from the id to match bootctl id. Fixes #38813. (cherry picked from commit 4301ad00ef715885be5c3bdf84c152030b7d36ff) --- diff --git a/src/boot/boot.c b/src/boot/boot.c index fc658e49d6d..582e17c70ad 100644 --- a/src/boot/boot.c +++ b/src/boot/boot.c @@ -1165,6 +1165,10 @@ static void boot_entry_parse_tries( if (!strcaseeq16(counter, suffix)) return; + entry->id = xasprintf("%.*ls%ls", + (int) prefix_len - 1, + file, + suffix); entry->tries_left = tries_left; entry->tries_done = tries_done; entry->path = xstrdup16(path); @@ -1395,7 +1399,9 @@ static void boot_entry_add_type1( } entry->device = device; - entry->id = xstrdup16(file); + + if (!entry->id) + entry->id = xstrdup16(file); strtolower16(entry->id); config_add_entry(config, entry);