--- a/arch/arm/mach-apple/board.c 2023-08-02 13:05:39.000000000 +0200 +++ b/arch/arm/mach-apple/board.c 2023-08-29 13:05:02.433002064 +0200 @@ -6,11 +6,8 @@ #include #include #include -#include #include -#include #include -#include #include #include @@ -614,88 +611,6 @@ #define KERNEL_COMP_SIZE SZ_128M -static void efi_seed_boot_options(void) -{ - struct efi_load_option lo; - struct blk_desc *desc; - efi_uintn_t size; - efi_status_t ret; - u16 *bootorder; - u32 boot_index; - u16 varname[9]; - u16 devname[BOOTMENU_DEVICE_NAME_MAX]; - char buf[BOOTMENU_DEVICE_NAME_MAX]; - char *optional_data; - u16 *tmp = devname; - void *p; - - /* - * Don't create a boot option if we don't have a designated - * EFI System Partition. - */ - if (efi_system_partition.uclass_id == UCLASS_INVALID) - return; - - ret = efi_init_obj_list(); - if (ret != EFI_SUCCESS) - return; - - /* - * If the "BootOrder" UEFI variable already exists we don't - * need to create a boot option. - */ - bootorder = efi_get_var(u"BootOrder", &efi_global_variable_guid, - &size); - if (bootorder) - return; - - desc = blk_get_devnum_by_uclass_id(efi_system_partition.uclass_id, - efi_system_partition.devnum); - if (desc == NULL) - return; - - snprintf(buf, sizeof(buf), "%s %d:%d", - blk_get_uclass_name(efi_system_partition.uclass_id), - efi_system_partition.devnum, efi_system_partition.part); - utf8_utf16_strcpy(&tmp, buf); - - /* - * Create a boot option for the designated EFI System - * Partition. This makes sure that the EFI boot manager will - * be used and that it will attempt to boot from this - * partition first. Mark the boot option as automatically - * generated to prevent eficonfig_enumerate_boot_option() from - * generating another one for the same partition. - */ - lo.label = devname; - lo.file_path = efi_dp_from_part(desc, efi_system_partition.part); - lo.file_path_length = efi_dp_size(lo.file_path) + sizeof(END); - lo.attributes = LOAD_OPTION_ACTIVE; - lo.optional_data = "1234567"; - size = efi_serialize_load_option(&lo, (u8 **)&p); - if (size == 0) - return; - optional_data = (char *)p + (size - u16_strsize(u"1234567")); - memcpy(optional_data, &efi_guid_bootmenu_auto_generated, - sizeof(efi_guid_t)); - - ret = eficonfig_get_unused_bootoption(varname, sizeof(varname), - &boot_index); - if (ret != EFI_SUCCESS) - return; - - ret = efi_set_variable_int(varname, &efi_global_variable_guid, - EFI_VARIABLE_NON_VOLATILE | - EFI_VARIABLE_BOOTSERVICE_ACCESS | - EFI_VARIABLE_RUNTIME_ACCESS, - size, p, false); - free(p); - if (ret != EFI_SUCCESS) - return; - - eficonfig_append_bootorder(boot_index); -} - int board_late_init(void) { struct lmb lmb; @@ -723,8 +638,6 @@ if (status) log_warning("late_init: Failed to set run time variables\n"); - efi_seed_boot_options(); - return 0; }