From: Mauricio Faria de Oliveira Date: Fri, 20 Aug 2021 13:15:06 +0000 (-0300) Subject: Call hwmatch only on the grub-pc platform X-Git-Tag: archive/raspbian/2.12-8+rpi1~11 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5c9555b71202df578e1096b0fcbeab514509262c;p=grub2.git Call hwmatch only on the grub-pc platform Call hwmatch only on i386/pc as it is only available there. This avoids "error: can't find command `hwmatch'." on e.g., x86_64/efi. The equivalent behavior is linux_gfx_mode=keep because grub is special: the `if hwmatch` clause is true on that error and `$match = 0` is true too, as it is undefined (confirmed in grub shell.) A quick fix for now. Before and After: grub> hwmatch error: can't find command `hwmatch'. grub> echo $grub_platform efi grub> echo $linux_gfx_mode keep Signed-off-by: Mauricio Faria de Oliveira Bug-Ubuntu: https://bugs.launchpad.net/bugs/1840560 Bug-Debian: https://bugs.debian.org/990836 Forwarded: no Last-Update: 2020-08-20 Gbp-Pq: Name hwmatch-only-on-grub-pc-platform.patch --- diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 4adb51d..a29f705 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -262,7 +262,9 @@ else cat << EOF if [ "\${recordfail}" != 1 ]; then if [ -e \${prefix}/gfxblacklist.txt ]; then - if hwmatch \${prefix}/gfxblacklist.txt 3; then + if [ \${grub_platform} != pc ]; then + set linux_gfx_mode=keep + elif hwmatch \${prefix}/gfxblacklist.txt 3; then if [ \${match} = 0 ]; then set linux_gfx_mode=keep else