* [PATCH 1/2] efi/libstub: Enable apple-set-os for all Apple Devices
[not found] <20260125001111.1269-1-atharvatiwarilinuxdev@gmail.com>
@ 2026-01-25 0:11 ` Atharva Tiwari
0 siblings, 0 replies; only message in thread
From: Atharva Tiwari @ 2026-01-25 0:11 UTC (permalink / raw)
Cc: Atharva Tiwari, Ard Biesheuvel, Jani Nikula, Rodrigo Vivi,
Joonas Lahtinen, Tvrtko Ursulin, David Airlie, Simona Vetter,
Javier Martinez Canillas, Thomas Zimmermann, Ingo Molnar,
Borislav Petkov (AMD), Francesco Pompo, Lenny Szubowicz,
linux-efi, linux-kernel, intel-gfx, intel-xe, dri-devel
Enable apple-set-os on all macs, as
apple-set-os is needed to use eGPUs and the iGPU.
(tested on iMac20,1)
Signed-off-by: Atharva Tiwari <atharvatiwarilinuxdev@gmail.com>
---
drivers/firmware/efi/libstub/x86-stub.c | 22 +++++-----------------
1 file changed, 5 insertions(+), 17 deletions(-)
diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
index cef32e2c82d8..60e1a41bfe5f 100644
--- a/drivers/firmware/efi/libstub/x86-stub.c
+++ b/drivers/firmware/efi/libstub/x86-stub.c
@@ -303,32 +303,20 @@ static const struct efi_smbios_record *get_table_record(u8 type)
static bool apple_match_product_name(void)
{
- static const char type1_product_matches[][15] = {
- "MacBookPro11,3",
- "MacBookPro11,5",
- "MacBookPro13,3",
- "MacBookPro14,3",
- "MacBookPro15,1",
- "MacBookPro15,3",
- "MacBookPro16,1",
- "MacBookPro16,4",
- };
const struct efi_smbios_type1_record *record;
- const u8 *product;
+ const u8 *vendor;
record = (struct efi_smbios_type1_record *)
(efi_get_smbios_record(1) ?: get_table_record(1));
if (!record)
return false;
- product = efi_get_smbios_string(record, product_name);
- if (!product)
+ vendor = efi_get_smbios_string(record, manufacturer);
+ if (!vendor)
return false;
- for (int i = 0; i < ARRAY_SIZE(type1_product_matches); i++) {
- if (!strcmp(product, type1_product_matches[i]))
- return true;
- }
+ if (!strcmp(vendor, "Apple Inc."))
+ return true;
return false;
}
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-01-25 0:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260125001111.1269-1-atharvatiwarilinuxdev@gmail.com>
2026-01-25 0:11 ` [PATCH 1/2] efi/libstub: Enable apple-set-os for all Apple Devices Atharva Tiwari
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox