Moving on with Ubuntu.
Attaching patch for impish for initial review.

** Description changed:

- Upon disabling my grub menu using grub-customizer, I've noticed that
- just before the system boots and goes into the crypto password prompt
- the following error message appears on the display:
+ [Impact]
+ 
+  * Users on non-pc/i386 platforms (e.g., efi/amd64) may observe
+    the message "error: can't find command `hwmatch'" every boot.
+ 
+  * Also observed on cloud instances, generating support tickets
+    asking for clarification/impacts. (which could be deflected.)
+ 
+  * There' little or no impact, as hwmatch is only used to check
+    hardware device ID against a list for issues w/ graphics/KMS.
+    When this error happens, the default is set to keep graphics.
+ 
+  * This has possibly always happened on non-pc/i386, as hwmatch
+    is patched/exists only in 'grub-core/commands/_i386/pc_' dir,
+    thus there doesn't seem to be any serious issues as a result.
+ 
+ [Fix]
+ 
+  * Check for `$grub_platform != pc` then do not call hwmatch;
+    just keep current behavior (ie, keep graphics/framebuffer.)
+ 
+ [Test Plan]
+ 
+  * Boot a VM with EFI (e.g., multipass/libvirt/ovmf) and see
+    the serial console show the error message (or not, w/ fix.)
+ 
+       sudo snap install multipass
+       sudo multipass set local.driver=libvirt
+       sudo snap connect multipass:libvirt
+ 
+         multipass launch -c 1 -d 4g -m 1g -n hwmatch-i daily:impish
+ 
+       sudo apt -y install ovmf
+       sudo mkdir -p /var/lib/libvirt/qemu/nvram
+ 
+       virsh edit hwmatch-i
+         # insert in <os> section:
+         <loader readonly='yes' 
type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
+         <nvram>/var/lib/libvirt/qemu/nvram/hwmatch-i.fd</nvram>
+ 
+       virsh shutdown hwmatch-i    
+       virsh start --console hwmatch-i
+       
+  * Before:
+       ...
+       BdsDxe: loading Boot0003 "ubuntu" from ...\shimx64.efi
+       BdsDxe: starting Boot0003 "ubuntu" from ...\shimx64.efi
+       error: can't find command `hwmatch'.
+       [    0.000000] Linux version ...
+ 
+  * After:
+       ...
+       BdsDxe: loading Boot0003 "ubuntu" from ...\shimx64.efi
+       BdsDxe: starting Boot0003 "ubuntu" from ...\shimx64.efi
+       [    0.000000] Linux version ...
+   
+ [Where problems could occur]
+ 
+  * Issues with graphics/flickering during boot on systems with
+    graphics adapters in use might be hit in case of regression.
+    
+  * Theoretically the risk is low, since hwmatch apparently has
+    never worked on non-pc/i386, and we replace the broken call
+    while keeping current behavior observed with it ("no change".)
+ 
+ [Other Info]
+  
+  * While it might be interesting to try and enable/fix it for
+    other platforms, let's have a trivial fix to be considered
+    to backport to stable releases, at this time (less changes.)
+ 
+  * The same behavior is linux_gfx_mode=keep, despite the error.
+    This happens because in the error case, grub shell evaluates
+    if hwmatch ...; then` to true, and `if [ $match = 0 ]; then`
+    to true too (as it's undefined) so `set linux_gfx_mode=keep`.
+ 
+    Before/After in grub shell (same behavior):
+    
+     grub> hwmatch
+     error: can't find command `hwmatch'.
+ 
+     grub> echo $grub_platform
+     efi
+ 
+     grub> echo $linux_gfx_mode
+     keep
+ 
+  * Other details in Debian bug 990836 [1].
+  
+  * It looks like grub2-unsigned follows grub2 automatically,
+    so not providing debdiffs to it/just grub2.
+ 
+ [Links]
+  * [1] https://bugs.debian.org/990836
+  
+ [Original Description]
+ Upon disabling my grub menu using grub-customizer, I've noticed that just 
before the system boots and goes into the crypto password prompt the following 
error message appears on the display:
  
  ```
  error: can't find command hwmatch
  ```
  
  Looks like this command is referenced from /boot/grub/grub/cfg
  
  ```
-     if hwmatch ${prefix}/gfxblacklist.txt 3; then
+     if hwmatch ${prefix}/gfxblacklist.txt 3; then
  ```
  However, the mod doesn't exist on grub's mod folder:
  
  ```
  ~ ls -la /boot/grub/x86_64-efi/*.mod|wc -l
  269
  
  ~ ls -la /boot/grub/x86_64-efi/hw*
  fish: No matches for wildcard “/boot/grub/x86_64-efi/hw*”
  
  ```
  
  ProblemType: Bug
  DistroRelease: Ubuntu 19.04
  Package: grub-efi-amd64-signed 1.115+2.02+dfsg1-12ubuntu2
  ProcVersionSignature: Ubuntu 5.0.0-25.26-generic 5.0.18
  Uname: Linux 5.0.0-25-generic x86_64
  ApportVersion: 2.20.10-0ubuntu27.1
  Architecture: amd64
  CurrentDesktop: Unity
  Date: Sun Aug 18 00:22:41 2019
  InstallationDate: Installed on 2019-08-17 (0 days ago)
  InstallationMedia: Ubuntu 19.04 "Disco Dingo" - Release amd64 (20190416)
  SourcePackage: grub2-signed
  UpgradeStatus: No upgrade log present (probably fresh install)

** Patch added: "lp1840560_grub2_impish.debdiff"
   
https://bugs.launchpad.net/ubuntu/+source/grub2-signed/+bug/1840560/+attachment/5512983/+files/lp1840560_grub2_impish.debdiff

** Also affects: grub2 (Ubuntu Groovy)
   Importance: Undecided
       Status: New

** Also affects: grub2-signed (Ubuntu Groovy)
   Importance: Undecided
       Status: New

** Also affects: grub2 (Ubuntu Hirsute)
   Importance: Undecided
       Status: New

** Also affects: grub2-signed (Ubuntu Hirsute)
   Importance: Undecided
       Status: New

** Also affects: grub2 (Ubuntu Focal)
   Importance: Undecided
       Status: New

** Also affects: grub2-signed (Ubuntu Focal)
   Importance: Undecided
       Status: New

** Also affects: grub2 (Ubuntu Impish)
   Importance: Medium
     Assignee: Mauricio Faria de Oliveira (mfo)
       Status: In Progress

** Also affects: grub2-signed (Ubuntu Impish)
   Importance: Undecided
       Status: Invalid

** Changed in: grub2-signed (Ubuntu Hirsute)
       Status: New => Invalid

** Changed in: grub2-signed (Ubuntu Groovy)
       Status: New => Invalid

** Changed in: grub2-signed (Ubuntu Focal)
       Status: New => Invalid

** Changed in: grub2 (Ubuntu Hirsute)
       Status: New => In Progress

** Changed in: grub2 (Ubuntu Hirsute)
     Assignee: (unassigned) => Mauricio Faria de Oliveira (mfo)

** Changed in: grub2 (Ubuntu Groovy)
       Status: New => Invalid

** Changed in: grub2 (Ubuntu Focal)
       Status: New => In Progress

** Changed in: grub2 (Ubuntu Focal)
     Assignee: (unassigned) => Mauricio Faria de Oliveira (mfo)

** Changed in: grub2 (Ubuntu Impish)
   Importance: Medium => Low

** Changed in: grub2 (Ubuntu Hirsute)
   Importance: Undecided => Low

** Changed in: grub2 (Ubuntu Focal)
   Importance: Undecided => Low

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1840560

Title:
  "error: can't find command hwmatch" during grub

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1840560/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to