# We support EFI on x86_64
ifeq "$(BUILD_ARCH)" "x86_64"
EFI = 1
+ EFI_ARCH = x64
endif
+# Basic modules
+GRUB_EFI_MODULES = \
+ configfile \
+ efi_gop \
+ efi_uga \
+ gzio \
+ linux \
+ loadbios \
+ loadenv \
+ normal \
+ regexp
+
+# Stuff for accessing file systems
+GRUB_EFI_MODULES += \
+ ahci \
+ ext2 \
+ fat \
+ iso9660 \
+ part_gpt \
+ part_msdos \
+ udf
+
+# Graphics & IO
+GRUB_EFI_MODULES += \
+ all_video \
+ at_keyboard \
+ bitmap_scale \
+ font \
+ gfxmenu \
+ gfxterm \
+ jpeg \
+ png \
+ tga \
+ usb_keyboard
+
+# Commands
+GRUB_EFI_MODULES += \
+ boot \
+ cat \
+ chain \
+ echo \
+ halt \
+ help \
+ ls \
+ minicmd \
+ probe \
+ reboot \
+ search \
+ search_fs_file \
+ search_fs_uuid \
+ search_label \
+ test \
+ true
+
###############################################################################
# Common Macro Definitions
###############################################################################
cp /usr/lib/memtest86+/memtest.bin /install/cdrom/boot/isolinux/memtest
cp /usr/share/ipfire-netboot/ipxe.lkrn /install/cdrom/boot/isolinux/netboot
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
- # XXX Some bootloader needs to be put in this image
+ # Build a GRUB EFI image
+ grub-mkimage \
+ --format=$(BUILD_ARCH)-efi \
+ --output=/tmp/boot$(EFI_ARCH).efi \
+ --config=$(DIR_SRC)/config/cdrom/grub-efi.cfg \
+ --compression=xz \
+ --prefix=/EFI/BOOT \
+ $(GRUB_EFI_MODULES)
+
+ # 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
+
+ # Cleanup
+ umount /install/efiboot.img
+ rm -rf /install/efiboot.img /tmp/boot$(EFI_ARCH).efi
endif
+
cp /usr/share/hwdata/pci.ids /install/cdrom/boot/isolinux/pci.ids
cp -vf /usr/share/syslinux/*.c32 /install/cdrom/boot/isolinux/
sed -e "s/VERSION/$(VERSION) - Core $(CORE)/g" \