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

Fedora UEFI Live images (re)create boot entry #2008

Open
ignatenkobrain opened this issue Dec 28, 2021 · 4 comments
Open

Fedora UEFI Live images (re)create boot entry #2008

ignatenkobrain opened this issue Dec 28, 2021 · 4 comments

Comments

@ignatenkobrain
Copy link
Collaborator

ignatenkobrain commented Dec 28, 2021

Problem description

Building Fedora image with following image type/bootloader, every time I boot it on a real system, it (re)creates a boot entry in EFI leading to very useless entries in the UEFI.

<type image="iso" primary="true" flags="overlay" firmware="uefi" hybridpersistent="false"/>
❯ sudo efibootmgr -v | grep Fedora
Boot0000* Fedora	HD(1,GPT,4d16e6d9-001c-460f-be90-59cdb1ef74fc,0x800,0x12c000)/File(\EFI\fedora\shimx64.efi)
Boot0002* Fedora	PciRoot(0x0)/Pci(0x14,0x0)/USB(13,0)/CDROM(1,0x207fc8,0x28000)/File(\EFI\fedora\shimx64.efi)
Boot0003* Fedora	PciRoot(0x0)/Pci(0x14,0x0)/USB(13,0)/CDROM(1,0x267210,0x28000)/File(\EFI\fedora\shimx64.efi)

I believe shim invokes fallback as described here https://github.com/rhboot/shim/blob/main/README.fallback.

If I understand the documentation correctly, Live systems are not supposed to have /boot/fedora at all and use /boot/EFI only but that's not what kiwi is producing.

For comparison, official Fedora Live image has:

media/brain/Fedora-WS-Live-35-1-2 
❯ find EFI -type f
EFI/BOOT/BOOT.conf
EFI/BOOT/BOOTIA32.EFI
EFI/BOOT/BOOTX64.EFI
EFI/BOOT/fonts/unicode.pf2
EFI/BOOT/grub.cfg
EFI/BOOT/grubia32.efi
EFI/BOOT/grubx64.efi
EFI/BOOT/mmia32.efi
EFI/BOOT/mmx64.efi

while what kiwi is producing:

[root@powerful-box tmp]# find EFI -type f
EFI/BOOT/BOOTX64.EFI
EFI/BOOT/bootx64.efi
EFI/BOOT/fbx64.efi
EFI/BOOT/grub.cfg
EFI/BOOT/grubx64.efi
EFI/BOOT/mmx64.efi
EFI/fedora/BOOTX64.CSV
EFI/fedora/grub.cfg
EFI/fedora/grubx64.efi
EFI/fedora/mmx64.efi
EFI/fedora/shim.efi
EFI/fedora/shimx64.efi

Expected behaviour

No entries are added on boot.

Steps to reproduce the behaviour

Build Fedora (35) image in Live ISO mode with UEFI support (as described in the kiwi-descriptions repo, just modify slightly). Then boot it on a real laptop (possibly with secure boot enabled?).

OS and Software information

  • KIWI version: 9.24.15
  • Operating system: Fedora 35
  • OBS version: N/A
@ignatenkobrain
Copy link
Collaborator Author

I've tried to figure out how lorax (the thing that produces Fedora images) is handling this and it seems that https://github.com/weldr/lorax/blob/fa2e465d51039e6172e5118c432b715316a70a48/share/templates.d/99-generic/live/efi.tmpl is relevant piece of code there.

Also from other places, it seems it just packs EFI/BOOT only, not anything else in the EFI folder.

@ignatenkobrain
Copy link
Collaborator Author

@schaefi ^^ as we were briefly touching this topic on the Matrix.

@schaefi
Copy link
Collaborator

schaefi commented Jan 2, 2022

Thanks for the details. You are right kiwi does differentiate the vendor setup for grub between a live image and any other type of image. We can change this.

I wonder about the contents of EFI/BOOT/BOOT.conf this file is new to me in the context of EFI boot and not created by kiwi at all. Can you provide details for what it is good for ? Maybe the contents ?

I think @Conan-Kudo wrote a good junk of all the live CD tools for Fedora, so he also should know what kiwi needs to do differently

Thanks

@Conan-Kudo
Copy link
Member

Most of the stuff that's been done with the bootloader stuff in the past few years in Fedora have been done by @martinezjavier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants