Some UEFI images are not bootable in UEFI mode

Bug #1690205 reported by Ryan Harper
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-images
New
Undecided
Unassigned

Bug Description

Recently, changes to various cloud-images (grub2 I believe) has broken booting while in UEFI mode.
It's somewhat complicated to track the versions and files, but hopefully the table included can help track down where the change occurred. For 14.04 and 16.04, I used the -uefi1.img, from 16.10 onward, the .img file is UEFI boot-capable (and a separate -uefi1.img file is not published).

All testing occurred on a Xenial amd64 host.

I'll attach the script used to launch the images in UEFI mode,

The template command, note the cloud-imaige is set up as the
first bootable device (bootindex=0) and we use
pflash devices to load the uefi firmware, one for the readonly
code, and a second writable device to hold any NVRAM changes.

qemu-system-x86_64 -m 1024 --enable-kvm \
  -snapshot \
  -drive id=disk0,if=none,format=qcow2,file=${BOOT} \
  -device virtio-blk-pci,drive=disk0,bootindex=0 \
  -cdrom $SEED \
  -net user -net nic,model=virtio \
  -redir tcp:22222::22 \
  -monitor stdio \
  -drive if=pflash,format=raw,readonly,file=$OVMF_CODE \
  -drive if=pflash,format=raw,file=$OVMF_VARS \
  -serial telnet:localhost:2446,nowait,server

The following table document what works and what doesnt.
In case this formats poorly, it can also be found here

http://paste.ubuntu.com/24555863/

and will be attached to the bug as well.

#release #Ver #Type #Date #Grub version # Boots? #Comments
trusty 14.04 daily 20170510 2.02~beta2-9ubuntu1.12 WORKS menu has precise entries?
xenial 16.04 release 20160420 2.02~beta2-36ubuntu3 WORKS
xenial 16.04 release 20161020 2.02~beta2-36ubuntu3.2 WORKS
xenial 16.04 release 20170330 2.02~beta2-36ubuntu3.8 WORKS
xenial 16.04 daily 20170508 2.02~beta2-36ubuntu3.9 FAILS
xenial 16.04 daily 20170510 2.02~beta2-36ubuntu3.9 FAILS
yakkety 16.10 release 20161023 2.02~beta2-36ubuntu11 WORKS
yakkety 16.10 daily 20170510 2.02~beta2-36ubuntu11.2 FAILS
zesty 17.04 release 20170412 2.02~beta3-4ubuntu2 FAILS
zesty 17.04 daily 20170510 2.02~beta3-4ubuntu2 FAILS
artful 17.10 daily 20170510 2.02~beta3-4ubuntu2 WORKS

Revision history for this message
Ryan Harper (raharper) wrote :
Revision history for this message
Ryan Harper (raharper) wrote :

bash ./cloud.sh <path to image file> <user-data-file>

Revision history for this message
Ryan Harper (raharper) wrote :

When the uefi boot fails, this output is seen on the serial console:

Boot Failed. EFI Floppy
Boot Failed. EFI Floppy 1
Boot Failed. EFI DVD/CDROM
System BootOrder not found. Initializing defaults.
Reset System

And the VM continues to boot-loop.

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

They are *all* bootable in UEFI mode. You're running in the case where we started installing fbx64.efi and shimx64.efi to /EFI/BOOT; but both should only be installed in the /EFI/BOOT path when images are built without --removable. You're getting this message because as there is no ubuntu BootEntry when you first start the VM (since you start with an empty firmware when you run things with qemu/OVMF), so fallback is loaded and attempts to generate it -- but we are not yet installing /EFI/ubuntu/boot.csv to give it data to use to generate the new BootEntry.

The real fix for this is to:
a) make sure cloud-image builds pass --removable to grub-install (already being done)
b) SRU grub2/2.02~beta3-4ubuntu3 patches everywhere (bug 1684341)

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.