From 50fb618a0b7b8620bd4142be6357f2a7efb58794 Mon Sep 17 00:00:00 2001 From: Ivan Davidov Date: Sun, 16 Oct 2016 16:46:25 +0300 Subject: [PATCH] Added EFI support. Manually tested it in 64-bit mode. Not tested in 32-bit mode. The installer is BIOS based and needs to be reworked for EFI support. Manuall HDD installation (64-bit, EFI) works fine. --- src/02_build_kernel.sh | 6 ++++++ src/12_generate_iso.sh | 21 ++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/02_build_kernel.sh b/src/02_build_kernel.sh index 99af1b91b..01d6896ba 100755 --- a/src/02_build_kernel.sh +++ b/src/02_build_kernel.sh @@ -71,6 +71,12 @@ else # Disable debug symbols in kernel => smaller kernel binary. sed -i "s/^CONFIG_DEBUG_KERNEL.*/\\# CONFIG_DEBUG_KERNEL is not set/" .config + + # Enable the EFI stub + sed -i "s/.*CONFIG_EFI_STUB.*/CONFIG_EFI_STUB=y/" .config + + # Explicitly enable the mixed EFI mode. + echo "CONFIG_EFI_MIXED=y" > .config fi # Compile the kernel with optimization for 'parallel jobs' = 'number of processors'. diff --git a/src/12_generate_iso.sh b/src/12_generate_iso.sh index 41000f0ba..f2d78c705 100755 --- a/src/12_generate_iso.sh +++ b/src/12_generate_iso.sh @@ -60,11 +60,6 @@ fi cd work/isoimage -# Copy the precompiled files 'isolinux.bin' and 'ldlinux.c32' in the ISO image -# root folder. -cp $WORK_SYSLINUX_DIR/bios/core/isolinux.bin . -cp $WORK_SYSLINUX_DIR/bios/com32/elflink/ldlinux/ldlinux.c32 . - # Now we copy the kernel. cp $KERNEL_INSTALLED/kernel ./kernel.xz @@ -129,9 +124,22 @@ else echo "Generating ISO image with no overlay structure..." fi +# Copy the precompiled files 'isolinux.bin' and 'ldlinux.c32' in the ISO image +# root folder. +cp $WORK_SYSLINUX_DIR/bios/core/isolinux.bin . +cp $WORK_SYSLINUX_DIR/bios/com32/elflink/ldlinux/ldlinux.c32 . + # Create the ISOLINUX configuration file. echo 'default kernel.xz initrd=rootfs.xz vga=ask' > ./syslinux.cfg +# Create UEFI start script. +mkdir -p efi/boot +cat << CEOF > ./efi/boot/startup.nsh +echo -off +echo "Minimal Linux Live" is starting... +\\kernel.xz initrd=\\rootfs.xz +CEOF + # Now we generate the ISO image file. genisoimage \ -J \ @@ -146,8 +154,7 @@ genisoimage \ ./ # This allows the ISO image to be bootable if it is burned on USB flash drive. -# The -u option is used in EFI boot mode (still not supported) and it reduces -# the ISO image size. +# The -u option is used in EFI boot mode and it reduces the ISO image size. isohybrid -u ../minimal_linux_live.iso 2>/dev/null || true # Copy the ISO image to the root project folder.