]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Use case insensitive comparison for the machine's architechture
authorDaniel Martinez <danielmartinez@cock.li>
Sun, 6 Oct 2024 03:39:43 +0000 (23:39 -0400)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sun, 6 Oct 2024 13:19:43 +0000 (14:19 +0100)
boot loader specification states:

architecture: refers to the architecture this entry is for. The argument
should be an architecture identifier, using the architecture vocabulary
defined by the EFI specification (i.e. IA32, x64, IA64, ARM, AA64, …).
If specified and it does not match the local system architecture this
entry should be hidden. The comparison should be done case-insensitively.

Example: architecture aa64

https://uapi-group.org/specifications/specs/boot_loader_specification/#type-1-boot-loader-entry-keys

src/boot/efi/boot.c

index 16d3d6a426fbbc6ab35cbed78112b655540eb0d7..213c012e3f9783b34bb77ca2fb4d6a59c46b38e8 100644 (file)
@@ -1491,7 +1491,7 @@ static void boot_entry_add_type1(
 
                 } else if (streq8(key, "architecture")) {
                         /* do not add an entry for an EFI image of architecture not matching with that of the image */
-                        if (!streq8(value, EFI_MACHINE_TYPE_NAME)) {
+                        if (!strcaseeq8(value, EFI_MACHINE_TYPE_NAME)) {
                                 entry->type = LOADER_UNDEFINED;
                                 break;
                         }