Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rhcos-4.8] buildextend-live: drop shim fallback.efi from ISO #2437

Merged
merged 1 commit into from Sep 16, 2021
Merged

[rhcos-4.8] buildextend-live: drop shim fallback.efi from ISO #2437

merged 1 commit into from Sep 16, 2021

Conversation

bgilbert
Copy link
Contributor

UEFI boots from removable media via the arch-specific default EFI application in /EFI/BOOT. When booted that way, shim chains to fallback.efi if it exists, and fallback.efi creates an EFI boot entry. That's not appropriate for removable media boot, since the media will probably never be present again. If a TPM is present, fallback.efi will additionally reboot the machine, and on some machines this leads to boot loops. Instead of all this, we just want shim to chain directly to GRUB.

Drop fallback.efi and its associated CSV from the EFI image. Replace it with a copy of GRUB in the right place for shim to chain to it.

This is a lightweight backport of #2435.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2004449

UEFI boots from removable media via the arch-specific default EFI
application in /EFI/BOOT.  When booted that way, shim chains to
fallback.efi if it exists, and fallback.efi creates an EFI boot entry.
That's not appropriate for removable media boot, since the media will
probably never be present again.  If a TPM is present, fallback.efi will
additionally reboot the machine, and on some machines this leads to boot
loops.  Instead of all this, we just want shim to chain directly to GRUB.

Drop fallback.efi and its associated CSV from the EFI image.  Replace it
with a copy of GRUB in the right place for shim to chain to it.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2004449
Copy link
Member

@miabbott miabbott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Built locally, then build RHCOS 4.8. Verified the ISO boots in UEFI/BIOS. Confirmed that the fallback EFI binary and CSV file were missing.

$ buildah bud --pull-always -t localhost/coreos-assembler:rhcos-4.8 .
$ coreos-assembler fetch && coreos-assembler build && coreos-assembler buildextend-metal && coreos-assembler buildextend-metal4k && coreos-assembler buildextend-live
$ coreos-assembler run -p qemu-iso --qemu-firmware uefi --memory 8192 --devshell-console
$ coreos-assembler run -p qemu-iso --memory 8192 --devshell-console
$ sudo mount -o loop builds/latest/x86_64/rhcos-48.84.202109161903-0-live.x86_64.iso /mnt/iso
$ sudo mount -o loop,ro /mnt/iso/images/efiboot.img /mnt/efi
$ tree /mnt/efi
/mnt/efi
└── EFI
    ├── BOOT
    │   ├── BOOTX64.EFI
    │   └── grubx64.efi
    └── redhat
        ├── fonts
        ├── grub.cfg
        ├── grubx64.efi
        ├── mmx64.efi
        ├── shimx64.efi
        └── shimx64-redhat.efi

4 directories, 7 files

@miabbott miabbott merged commit 38be9e3 into coreos:rhcos-4.8 Sep 16, 2021
@bgilbert bgilbert deleted the fallback-iso-bp/rhcos-4.8 branch September 16, 2021 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants