Call hwmatch only on the grub-pc platform
authorMauricio Faria de Oliveira <mfo@canonical.com>
Fri, 20 Aug 2021 13:15:06 +0000 (10:15 -0300)
committerFelix Zielcke <fzielcke@z-51.de>
Wed, 11 Jun 2025 15:42:34 +0000 (17:42 +0200)
commit56f9f1dd05f34c798c20f51ccfe7a3e75705bc1f
tree5d4b0b5d3aa49e098b8a0e011a5e2fbaceae9d96
parenteb2eb9db1e1cc5d434dc04f4a1a9e020ee4b0f20
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 <mfo@canonical.com>
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
util/grub.d/10_linux.in