summaryrefslogtreecommitdiffstats
path: root/config/binary_local-hooks
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2015-02-12 00:22:17 +0000
committerintrigeri <intrigeri@boum.org>2015-05-08 14:42:33 +0000
commitba2c4f5ebca3940229e032fb61aedd7127cc1bae (patch)
treecf139866e1353136432b9d8789a670646df87733 /config/binary_local-hooks
parentf2205689ee409f731a5f663f1b08a78d86fd6965 (diff)
Also install the syslinux 32-bit UEFI boot loader.
Note that we install it in BOOT/TAILS32 (while the 64-bit boot loader lives in the BOOT/EFI fallback directory), since syslinux module files have the same name regardless of the architecture, so we cannot simply put them all in the same directory. The drawback is that some buggy UEFI firmware may pick the wrong bootloader, that's not made for their architecture. Or, that they present the user with confusing choice between "EFI" and "TAILS32". We'll see. Of course, alternatively we could try to rename the 32-bit module files, so we can put them in BOOT/EFI as well; this would require adjusting the configuration files accordingly, in order to 1. load the 32-bit modules when the UEFI firmware is 32-bit; and 2. convince syslinux to load a different configuration file depending on the UEFI firmware's architecture (*not* the CPU architecture, beware!). Refs: #8471
Diffstat (limited to 'config/binary_local-hooks')
-rwxr-xr-xconfig/binary_local-hooks/99-syslinux_uefi35
1 files changed, 28 insertions, 7 deletions
diff --git a/config/binary_local-hooks/99-syslinux_uefi b/config/binary_local-hooks/99-syslinux_uefi
index d67c69f..ad4ef2f 100755
--- a/config/binary_local-hooks/99-syslinux_uefi
+++ b/config/binary_local-hooks/99-syslinux_uefi
@@ -31,10 +31,31 @@ case "${LB_BINARY_IMAGES}" in
;;
esac
-# Main
-mkdir -p binary/EFI/BOOT
-cp chroot/usr/lib/SYSLINUX.EFI/efi64/syslinux.efi binary/EFI/BOOT/bootx64.efi
-cp chroot/usr/share/tails/bootx64.png binary/EFI/BOOT/
-cp "$SYSLINUX_PATH"/* binary/EFI/BOOT/
-cp -f chroot/usr/lib/syslinux/modules/efi64/* binary/EFI/BOOT/
-sed -r -i -e 's,^(menu background splash\.png)$,\#\1,' binary/EFI/BOOT/stdmenu.cfg
+### Main
+
+## 64-bit
+for bit in 32 64 ; do
+ case "$bit" in
+ 32)
+ TARGET_SUBDIR=TAILS32
+ BOOTLOADER_NAME=bootia32
+ SYSLINUX_SUBDIR=efi32
+ ;;
+ 64)
+ TARGET_SUBDIR=BOOT
+ BOOTLOADER_NAME=bootx64
+ SYSLINUX_SUBDIR=efi64
+ ;;
+ esac
+ TARGET_DIR="binary/EFI/${TARGET_SUBDIR}"
+ mkdir -p "${TARGET_DIR}"
+ cp "chroot/usr/lib/SYSLINUX.EFI/${SYSLINUX_SUBDIR}/syslinux.efi" \
+ "${TARGET_DIR}/${BOOTLOADER_NAME}.efi"
+ cp chroot/usr/share/tails/bootx64.png \
+ "${TARGET_DIR}/${BOOTLOADER_NAME}.png"
+ cp "$SYSLINUX_PATH"/* "${TARGET_DIR}"
+ cp -f "chroot/usr/lib/syslinux/modules/${SYSLINUX_SUBDIR}/"* \
+ "${TARGET_DIR}"
+ sed -r -i -e 's,^(menu background splash\.png)$,\#\1,' \
+ "${TARGET_DIR}/stdmenu.cfg"
+done