Skip to content

Commit ba73a8c

Browse files
authored
Use GRUB2 legacy loader for Macbook Air A1370 (#3593)
Fix loading issues on this Intel-based platform as well. As described in the patch commit message, there will be likely bigger collateral effect by referring just to the CPU ID but it shouldn't have major detrimental effects. [1] #3305 (comment)
1 parent 0fdf920 commit ba73a8c

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

buildroot-external/patches/grub2/0002-loader-efi-linux-use-legacy-loader-for-broken-Intel-.patch

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 545edfcbb505dfa0fc007416dc8b69a8e65f9557 Mon Sep 17 00:00:00 2001
1+
From 6c0a2197bad3c339a638ea59b1eb36b5e449f7b8 Mon Sep 17 00:00:00 2001
22
From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= <[email protected]>
33
Date: Tue, 30 Jul 2024 18:27:24 +0200
44
Subject: [PATCH] loader/efi/linux: use legacy loader for broken Intel NM10
@@ -29,13 +29,22 @@ Also AMD GX-212JC in HP t520 seems to be affected as reported in [3].
2929

3030
[3] https://github.com/home-assistant/operating-system/issues/3557
3131

32+
----
33+
34+
Added CPU ID for Macbook Air's Intel i5 CPU reported in [4]. This will
35+
likely target also other i5-based systems that are not affected by the
36+
EFI bug but it should cause no harm, as the legacy loader was used in
37+
pre-2.12 GRUB anyway.
38+
39+
[4] https://github.com/home-assistant/operating-system/issues/3305#issuecomment-2360633688
40+
3241
Signed-off-by: Jan Čermák <[email protected]>
3342
---
34-
grub-core/loader/efi/linux.c | 66 +++++++++++++++++++++++++++++++++++-
35-
1 file changed, 65 insertions(+), 1 deletion(-)
43+
grub-core/loader/efi/linux.c | 67 +++++++++++++++++++++++++++++++++++-
44+
1 file changed, 66 insertions(+), 1 deletion(-)
3645

3746
diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c
38-
index bfbd95aee..efeb692f8 100644
47+
index bfbd95a..98ac99c 100644
3948
--- a/grub-core/loader/efi/linux.c
4049
+++ b/grub-core/loader/efi/linux.c
4150
@@ -24,6 +24,7 @@
@@ -46,7 +55,7 @@ index bfbd95aee..efeb692f8 100644
4655
#include <grub/types.h>
4756
#include <grub/efi/efi.h>
4857
#include <grub/efi/fdtload.h>
49-
@@ -452,6 +453,68 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
58+
@@ -452,6 +453,69 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
5059
return grub_errno;
5160
}
5261

@@ -97,7 +106,8 @@ index bfbd95aee..efeb692f8 100644
97106
+ */
98107
+ return (processor_id == 0xbfebfbff00030661 // D2xxx/N2xxx
99108
+ || processor_id == 0xbfebfbff000106ca // D525
100-
+ || processor_id == 0x00730f01178bfbff); // AMD GX-212JC (HP t520)
109+
+ || processor_id == 0x00730f01178bfbff // AMD GX-212JC (HP t520)
110+
+ || processor_id == 0xbfebfbff000206a7); // Intel i5-2xxx (Macbook Air A1370)
101111
+ }
102112
+ else
103113
+ {
@@ -115,7 +125,7 @@ index bfbd95aee..efeb692f8 100644
115125
static grub_err_t
116126
grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
117127
int argc, char *argv[])
118-
@@ -490,7 +553,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
128+
@@ -490,7 +554,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
119129

120130
kernel_size = grub_file_size (file);
121131

0 commit comments

Comments
 (0)