mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-23 01:12:57 +02:00
cdrom: Install GRUB into EFI image
This will start GRUB on EFI systems when booting from CD Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
2
config/cdrom/grub-efi.cfg
Normal file
2
config/cdrom/grub-efi.cfg
Normal file
@@ -0,0 +1,2 @@
|
||||
search --file --no-floppy --set=root /EFI/BOOT/grub.cfg
|
||||
set prefix=($root)/EFI/BOOT/
|
||||
55
lfs/Config
55
lfs/Config
@@ -82,8 +82,63 @@ CCACHE_COMPILERCHECK += $(shell gcc -dumpspecs 2>/dev/null | md5sum | cut -d ' '
|
||||
# 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
|
||||
###############################################################################
|
||||
|
||||
24
lfs/cdrom
24
lfs/cdrom
@@ -119,12 +119,34 @@ ifneq "$(BUILD_PLATFORM)" "arm"
|
||||
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" \
|
||||
|
||||
Reference in New Issue
Block a user