vmware / photon

Minimal Linux container host
https://vmware.github.io/photon
Other
3.05k stars 697 forks source link

Photon 5 ISO images appear to not contain UEFI boot loaders #1493

Open sygibson opened 1 year ago

sygibson commented 1 year ago

Describe the bug

Network installing via Kickstart of Photon 5 dde71ec57 (Full, Minimal, or RT) all appear to be missing UEFI boot loaders to boot successfully on UEFI based systems.

root@sm-drp:/mnt# mount | grep photon-5
/srv/isos/photon-5.0-dde71ec57.x86_64.iso on /mnt type iso9660 (ro,relatime,nojoliet,check=s,map=n,blocksize=2048,iocharset=utf8)
root@sm-drp:/mnt# ls EFI/BOOT boot/efi/EFI/BOOT boot/efi
ls: cannot access 'EFI/BOOT': No such file or directory
ls: cannot access 'boot/efi/EFI/BOOT': No such file or directory
boot/efi:
root@sm-drp:/mnt# find . -type f -name "bootx*"
root@sm-drp:/mnt# find . -type f -name "*efi"
root@sm-drp:/mnt#

Unable to successfully boot a Photon 5 system via the network to perform kickstart install.

Reproduction steps

  1. download iso: https://packages.vmware.com/photon/5.0/GA/iso/photon-5.0-dde71ec57.x86_64.iso
  2. mount iso
  3. inspect iso; search for EFI boot loaders ...

Expected behavior

For amd64/x86_64 - expect EFI boot loader: EFI/BOOT/bootx64.efi

For arm64/aarch64 - expect EFI boot loader: EFI/BOOT/bootaa64.efi

Additional context

Network install from DHCP/PXE server. Environment successfully builds about 50 other Linux distros/versions via Legacy BIOS and UEFI boot (both secure boot, and non-secure boot) currently without issues. Only the Photon Linux ISOs seem to be missing the UEFI boot loaders.

jaankit commented 1 year ago

Hi @sygibson ,

Boot loader binaries are packaged inside /boot/grub2/efiboot.img in iso [1] . efiboot.img is a boot image file , there is a "El Torito" boot data which tells the UEFI loader where this efiboot.img is located [2].

root@photon-b88997fc2c38 [ ~ ]# mount /mnt/iso/boot/grub2/efiboot.img /mnt/efi/
root@photon-b88997fc2c38 [ ~ ]# ls /mnt/efi/
EFI
root@photon-b88997fc2c38 [ ~ ]# ls /mnt/efi/EFI/BOOT/
bootx64.efi  grubx64.efi

For chroot creation, these boot loader binaries comes from "grub2-efi-image" package [3] during installation process.

As per my knowledge, we verified PXE boot during 5.0 GA testing phase. @prashant1221, can confirm the steps with which we validated PXE boot.

[1] : https://github.com/vmware/photon/blob/5.0/support/image-builder/iso/mk-install-iso.sh#L100-L109 [2] : https://github.com/vmware/photon/blob/5.0/support/image-builder/iso/mk-install-iso.sh#L304 [3] : https://github.com/vmware/photon/blob/5.0/SPECS/grub2/grub2.spec#L199

Thanks.

sygibson commented 4 days ago

@jaankit - thank you for the info. This seems to be a very highly unusual policy to embed the EFI bootloaders inside an el torito image inside the ISO image. We build an automation and orchestration platform that installs 100s of various Linux (and other OS) distros, and this is the first time we've encountered this.

Subsequently, our automated mounting methodology will require downstream code changes to know that we're mounting a Photon ISO, and then how to find, extract, and place the bootloades appropriately for our PXE boot template engine to utilize.

I would ask that during the build of the ISO - these files are extracted to the base ISO in the correct standards defined and expected location of EFI/BOOT/ which most other Linux distros follow.

Thank you for your consideration.