Merge ~mfo/grub:lp1840560 into ~ubuntu-core-dev/grub/+git/ubuntu:ubuntu

Proposed by Mauricio Faria de Oliveira
Status: Merged
Approved by: Julian Andres Klode
Approved revision: 19b7423ac52e6c75290ca4f2f99e5f0a7ce5ed13
Merged at revision: f7ce633228cf1210a4c58a46a842361af31a5e09
Proposed branch: ~mfo/grub:lp1840560
Merge into: ~ubuntu-core-dev/grub/+git/ubuntu:ubuntu
Diff against target: 78 lines (+56/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/0241-Call-hwmatch-only-on-the-grub-pc-platform.patch (+47/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Julian Andres Klode Approve
Ubuntu Core Development Team Pending
Review via email: mp+407470@code.launchpad.net

Description of the change

Fix "error: can't find command `hwmatch'." on non-i386/pc platforms such as x86_64/efi.
LP: #1840560

To post a comment you must log in.
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Rebased on top of latest grub on impish.

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Updated changelog for jammy (new development release).

Revision history for this message
Julian Andres Klode (juliank) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index 043136b..ae31123 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
1grub2 (2.04-1ubuntu48) jammy; urgency=medium
2
3 * d/p/0241-Call-hwmatch-only-on-the-grub-pc-platform.patch:
4 Fix "error: can't find command `hwmatch'." on non-i386/pc
5 platforms such as x86_64/efi. (LP: #1840560)
6
7 -- Mauricio Faria de Oliveira <mfo@canonical.com> Thu, 04 Nov 2021 10:48:06 -0300
8
1grub2 (2.04-1ubuntu47) impish; urgency=medium9grub2 (2.04-1ubuntu47) impish; urgency=medium
210
3 * Drop grub.cfg-400.patch (LP: #1933826)11 * Drop grub.cfg-400.patch (LP: #1933826)
diff --git a/debian/patches/0241-Call-hwmatch-only-on-the-grub-pc-platform.patch b/debian/patches/0241-Call-hwmatch-only-on-the-grub-pc-platform.patch
4new file mode 10064412new file mode 100644
index 0000000..9ae2fdf
--- /dev/null
+++ b/debian/patches/0241-Call-hwmatch-only-on-the-grub-pc-platform.patch
@@ -0,0 +1,47 @@
1From: Mauricio Faria de Oliveira <mfo@canonical.com>
2Date: Fri, 20 Aug 2021 10:15:06 -0300
3Subject: Call hwmatch only on the grub-pc platform
4
5Call hwmatch only on i386/pc as it is only available there.
6This avoids "error: can't find command `hwmatch'." on e.g., x86_64/efi.
7
8The equivalent behavior is linux_gfx_mode=keep because grub is special:
9the `if hwmatch` clause is true on that error and `$match = 0` is true
10too, as it is undefined (confirmed in grub shell.) A quick fix for now.
11
12Before and After:
13
14 grub> hwmatch
15 error: can't find command `hwmatch'.
16
17 grub> echo $grub_platform
18 efi
19
20 grub> echo $linux_gfx_mode
21 keep
22
23Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
24
25Bug-Ubuntu: https://bugs.launchpad.net/bugs/1840560
26Bug-Debian: https://bugs.debian.org/990836
27Forwarded: no
28Last-Update: 2020-08-20
29---
30 util/grub.d/10_linux.in | 4 +++-
31 1 file changed, 3 insertions(+), 1 deletion(-)
32
33diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
34index 47daf51..6aad5ba 100644
35--- a/util/grub.d/10_linux.in
36+++ b/util/grub.d/10_linux.in
37@@ -378,7 +378,9 @@ else
38 cat << EOF
39 if [ "\${recordfail}" != 1 ]; then
40 if [ -e \${prefix}/gfxblacklist.txt ]; then
41- if hwmatch \${prefix}/gfxblacklist.txt 3; then
42+ if [ \${grub_platform} != pc ]; then
43+ set linux_gfx_mode=keep
44+ elif hwmatch \${prefix}/gfxblacklist.txt 3; then
45 if [ \${match} = 0 ]; then
46 set linux_gfx_mode=keep
47 else
diff --git a/debian/patches/series b/debian/patches/series
index 9b9ca92..11c2a0f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -237,3 +237,4 @@ cherry-fix-crash-on-http.patch
2370238-util-grub-install-Fix-NULL-pointer-dereferences.patch2370238-util-grub-install-Fix-NULL-pointer-dereferences.patch
2380239-arm-linux-Fix-ARM-Linux-header-layout.patch2380239-arm-linux-Fix-ARM-Linux-header-layout.patch
2390240-tests-ahci_test.in-Replace-ide-drive-with-ide-hd.patch2390240-tests-ahci_test.in-Replace-ide-drive-with-ide-hd.patch
2400241-Call-hwmatch-only-on-the-grub-pc-platform.patch

Subscribers

People subscribed via source and target branches