armhf cloud image fails to boot kernel

Bug #1788940 reported by dann frazier
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub2 (Debian)
Fix Released
Unknown
grub2 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

If you try to boot a pristine Ubuntu cloud image in EFI mode in QEMU, GRUB will fail to boot the kernel.

sudo qemu-system-aarch64 -enable-kvm -M virt,gic_version=host -smp 7 -m 2048 -cpu host,aarch64=off -nographic -pflash AAVMF32_CODE.fd -pflash AAVMF32_VARS.fd -drive if=none,file=bionic-server-cloudimg-armhf.img,id=hd0 -device virtio-blk-device,drive=hd0 -drive if=none,file=my-seed.img,id=hd1 -device virtio-blk-device,drive=hd1 -netdev type=tap,id=net0 -device virtio-net-device,netdev=net0,mac=00:16:3e:12:2c:a8

[...]
FS1:\EFI\BOOT\> BOOTARM.EFI
error: no suitable video mode found.

                             GNU GRUB version 2.02

 /----------------------------------------------------------------------------\
 |*Ubuntu |
 | Advanced options for Ubuntu |
 | System setup |
 | |
 | |
 | |
 | |
 | |
 | |
 | |
 | |
 | |
 | |
 \----------------------------------------------------------------------------/

      Use the ^ and v keys to select which entry is highlighted.
      Press enter to boot the selected OS, `e' to edit the commands
      before booting or `c' for a command-line.

error: no such device: root.

Press any key to continue...

Undefined OpCode Exception PC at 0x00000002 CPSR 0x20000133
Undefined OpCode Exception PC at 0x00000002 CPSR 0x20000133
Undefined OpCode Exception PC at 0x00000002 CPSR 0x20000133
Undefined OpCode Exception PC at 0x00000002 CPSR 0x20000133
Undefined OpCode Exception PC at 0x00000002 CPSR 0x20000133
Undefined OpCode Exception PC at 0x00000002 CPSR 0x20000133
Undefined OpCode Exception PC at 0x00000002 CPSR 0x20000133
[...]

Related branches

Revision history for this message
dann frazier (dannf) wrote :

FTR, a workaround for this that bypasses GRUB would be:

ubuntu@ubuntu:~$ cat /boot/efi/startup.nsh
# driver from https://efi.akeo.ie/
load fs0:\efi\ext2_arm.efi
map -r
# system partition moves from fs0: to fs1:

# We can't boot from ext4, so cache boot files in our system partition
cp fs0:\boot\vmlinuz fs1:\efi\boot\vmlinuz
cp fs0:\boot\initrd.img fs1:\efi\boot\initrd.img
fs1:
\efi\boot\vmlinuz initrd=\efi\boot\initrd.img root=LABEL=cloudimg-rootfs

dann frazier (dannf)
Changed in grub2 (Ubuntu):
status: New → Triaged
Revision history for this message
dann frazier (dannf) wrote :

This is now supported upstream, and I was able to backport the necessary fixes to the GRUB in Debian/unstable (test builds at ppa:dannf/test). However, I haven't been able to get them working on top of the Ubuntu patches - that build just loops with the error:

Prefetch Abort Exception PC at 0x7D715000 CPSR 0x30000113
Prefetch Abort Exception PC at 0x7D715000 CPSR 0x30000113
Prefetch Abort Exception PC at 0x7D715000 CPSR 0x30000113
[...]

Revision history for this message
dann frazier (dannf) wrote :
Revision history for this message
dann frazier (dannf) wrote :
tags: added: patch
Changed in grub2 (Debian):
status: Unknown → New
tags: added: id-59e75aef0db68571b6cb822d
Changed in grub2 (Debian):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.04-1ubuntu46

---------------
grub2 (2.04-1ubuntu46) impish; urgency=medium

  * debian/grub-common.service: change type to oneshot, add wantedby
    sleep.target, after sleep.target. The service will now start after
    resume from hybernation. LP: #1929860
  * grub-initrd-fallback.service: add wantedby sleep.target, after
    sleep.target. The service will now start after resume from
    hybernation. LP: #1929860
  * cherrypick upstream fix to make armhf efi boot work. LP: #1788940
  * debian/rules: disable LTO. LP: #1922005
  * grub-initrd-fallback.service, debian/grub-common.service: only start
    units when booted with grub. Use presence of /boot/grub/grub.cfg as
    proxy. LP: #1925507
  * tests: patch qemu command to use ide-hd instead of the removed
    ide-drive.

 -- Dimitri John Ledkov <email address hidden> Fri, 16 Jul 2021 14:01:31 +0100

Changed in grub2 (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.