From 66630efd28aaa1d719ef7ae47168b715834f311e Mon Sep 17 00:00:00 2001 From: Ivan Davidov Date: Sun, 16 Oct 2016 18:22:50 +0300 Subject: [PATCH] Added UEFI specific fix - we need to apply different kernel configurations for 32-bit and 64-bit targets. Tested the build process (works fine), UEFI boot from CD (works fine), BIOS boot from CD (works fine) and EFI boot from HDD after manual installation (works fine). The installer part is still not UEFI ready. --- src/02_build_kernel.sh | 11 +++++++++-- src/12_generate_iso.sh | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/02_build_kernel.sh b/src/02_build_kernel.sh index 01d6896ba..8984aee41 100755 --- a/src/02_build_kernel.sh +++ b/src/02_build_kernel.sh @@ -75,8 +75,15 @@ else # 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 + # Check if we are building 32-bit kernel. The exit code is '1' when we are + # building 64-bit kernel, otherwise the exit status is '0'. + grep -q "CONFIG_X86_32=y" .config + + # The '$?' variable holds the exit code of the last issued command. + if [ $? = 1 ] ; then + # Enable the mixed EFI mode when building 64-bit kernel. + echo "CONFIG_EFI_MIXED=y" > .config + fi 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 f2d78c705..670a2c5ac 100755 --- a/src/12_generate_iso.sh +++ b/src/12_generate_iso.sh @@ -136,7 +136,7 @@ echo 'default kernel.xz initrd=rootfs.xz vga=ask' > ./syslinux.cfg mkdir -p efi/boot cat << CEOF > ./efi/boot/startup.nsh echo -off -echo "Minimal Linux Live" is starting... +echo Minimal Linux Live is starting... \\kernel.xz initrd=\\rootfs.xz CEOF