Improve support for 32-bit EFI firmware in ISOs and installer

mklive:
- include support for booting both 32- and 64-bit UEFI firmware with
  32- and 64-bit images.
- require grub packages for both firmware bitness types
  (build-x86-images)

Installer:
- include support for installing both 32- and 64-bit UEFI grub loaders
- detect UEFI platform (firmware) bitness at install time

Closes: #102 [via git-merge-pr]
This commit is contained in:
masato9000
2017-02-21 14:38:01 -08:00
committed by Michael Aldridge
parent fe57bb4b06
commit a4b3dd36c9
3 changed files with 36 additions and 33 deletions

View File

@@ -60,6 +60,12 @@ fi
# Detect if this is an EFI system.
if [ -e /sys/firmware/efi/systab ]; then
EFI_SYSTEM=1
EFI_FW_BITS=$(cat /sys/firmware/efi/fw_platform_size)
if [ $EFI_FW_BITS -eq 32 ]; then
EFI_TARGET=i386-efi
else
EFI_TARGET=x86_64-efi
fi
fi
# dialog colors
@@ -768,7 +774,7 @@ set_bootloader() {
# Check if it's an EFI system via efivars module.
if [ -n "$EFI_SYSTEM" ]; then
grub_args="--target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=void_grub --recheck"
grub_args="--target=$EFI_TARGET --efi-directory=/boot/efi --bootloader-id=void_grub --recheck"
fi
echo "Running grub-install $grub_args $dev..." >$LOG
chroot $TARGETDIR grub-install $grub_args $dev >$LOG 2>&1
@@ -1137,7 +1143,11 @@ install_packages() {
local _grub= _syspkg=
if [ -n "$EFI_SYSTEM" ]; then
_grub="grub-x86_64-efi"
if [ $EFI_FW_BITS -eq 32 ]; then
_grub="grub-i386-efi"
else
_grub="grub-x86_64-efi"
fi
else
_grub="grub"
fi