From: Michael Tremer Date: Thu, 31 May 2018 14:08:53 +0000 (+0100) Subject: cdrom: Keep the EFI image on the ISO9660 file system as well X-Git-Tag: v2.21-core124~77^2~47 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=6b44fee76f2f086b8ac5378e1fdcf1fc000b70e6;ds=sidebyside cdrom: Keep the EFI image on the ISO9660 file system as well This allows systems to boot the EFI bootloader from the CDROM file system instead of using the FAT filesystem which is for USB keys. Signed-off-by: Michael Tremer --- diff --git a/lfs/cdrom b/lfs/cdrom index 08cbcb772d..7150153d70 100644 --- a/lfs/cdrom +++ b/lfs/cdrom @@ -121,39 +121,41 @@ ifneq "$(BUILD_PLATFORM)" "arm" cp /usr/share/syslinux/isolinux.bin /install/cdrom/boot/isolinux/isolinux.bin ifeq "$(EFI)" "1" - # Create the EFI Eltorito image - dd if=/dev/zero of=/install/cdrom/boot/isolinux/efiboot.img bs=1k count=1440 - mkdosfs -F 12 -n "IPFIRE_EFI" /install/cdrom/boot/isolinux/efiboot.img - # Generate embedded GRUB configuration sed -e "s/NAME/$(NAME)/g" -e "s/VERSION/$(VERSION)/g" -e "s/ARCH/$(BUILD_ARCH)/g" \ $(DIR_SRC)/config/cdrom/grub-efi.cfg > /tmp/grub-efi.cfg # Build a GRUB EFI image + mkdir -pv /install/cdrom/EFI/BOOT grub-mkimage \ --format=$(BUILD_ARCH)-efi \ - --output=/tmp/boot$(EFI_ARCH).efi \ + --output=/install/cdrom/EFI/BOOT/boot$(EFI_ARCH).efi \ --config=/tmp/grub-efi.cfg \ --compression=xz \ --prefix=/EFI/BOOT \ $(GRUB_EFI_MODULES) + # Install GRUB configuration + mkdir -pv /install/cdrom/EFI/BOOT + sed -e "s/NAME/$(NAME)/g" -e "s/VERSION/$(VERSION)/g" -e "s/ARCH/$(BUILD_ARCH)/g" \ + < $(DIR_SRC)/config/cdrom/grub.cfg > /install/cdrom/EFI/BOOT/grub.cfg + + # Create the EFI Eltorito image + dd if=/dev/zero of=/install/cdrom/boot/isolinux/efiboot.img bs=1k count=1440 + mkdosfs -F 12 -n "IPFIRE_EFI" /install/cdrom/boot/isolinux/efiboot.img + # Mount the EFI image mkdir -pv /install/efiboot.img mount -o loop /install/cdrom/boot/isolinux/efiboot.img /install/efiboot.img # Copy the bootloader into the image mkdir -pv /install/efiboot.img/EFI/BOOT - cp -a /tmp/boot$(EFI_ARCH).efi /install/efiboot.img/EFI/BOOT/boot$(EFI_ARCH).efi + cp -a /install/cdrom/EFI/BOOT/boot$(EFI_ARCH).efi \ + /install/efiboot.img/EFI/BOOT/boot$(EFI_ARCH).efi # Cleanup umount /install/efiboot.img - rm -rf /install/efiboot.img /tmp/boot$(EFI_ARCH).efi /tmp/grub-efi.cfg - - # Install GRUB configuration - mkdir -pv /install/cdrom/EFI/BOOT - sed -e "s/NAME/$(NAME)/g" -e "s/VERSION/$(VERSION)/g" -e "s/ARCH/$(BUILD_ARCH)/g" \ - < $(DIR_SRC)/config/cdrom/grub.cfg > /install/cdrom/EFI/BOOT/grub.cfg + rm -rf /install/efiboot.img /tmp/grub-efi.cfg endif cp /usr/share/hwdata/pci.ids /install/cdrom/boot/isolinux/pci.ids