mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
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.
This commit is contained in:
committed by
Luca Boccassi
parent
ff33c8f87d
commit
4301ad00ef
@@ -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->directory = xstrdup16(directory);
|
||||
@@ -1395,13 +1399,16 @@ static void boot_entry_add_type1(
|
||||
}
|
||||
|
||||
entry->device = device;
|
||||
entry->id = xstrdup16(file);
|
||||
strtolower16(entry->id);
|
||||
|
||||
config_add_entry(config, entry);
|
||||
|
||||
if (path)
|
||||
boot_entry_parse_tries(entry, path, file, u".conf");
|
||||
|
||||
if (!entry->id)
|
||||
entry->id = xstrdup16(file);
|
||||
|
||||
strtolower16(entry->id);
|
||||
|
||||
config_add_entry(config, entry);
|
||||
TAKE_PTR(entry);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user