summaryrefslogtreecommitdiffstats
path: root/config/binary_local-hooks
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2014-06-13 16:23:06 +0000
committerTails developers <amnesia@boum.org>2014-06-13 18:46:59 +0000
commit31a7b84bb23475989272ccbd868ac38ef53a8f57 (patch)
tree6ca1c45905ec20d5b7f78b61e29cf643dfa3ab75 /config/binary_local-hooks
parente5900edfae6d6e8dd70c60bee355914223adcacc (diff)
Include the syslinux binary, and its MBR, in the ISO filesystem.
This in turn allows Tails Installer to use this binary and MBR, which is critical for avoiding problems (such as #7345) on "Upgrade from ISO".
Diffstat (limited to 'config/binary_local-hooks')
-rwxr-xr-xconfig/binary_local-hooks/40-include_syslinux_in_ISO_filesystem33
1 files changed, 33 insertions, 0 deletions
diff --git a/config/binary_local-hooks/40-include_syslinux_in_ISO_filesystem b/config/binary_local-hooks/40-include_syslinux_in_ISO_filesystem
new file mode 100755
index 0000000..6b74f9a
--- /dev/null
+++ b/config/binary_local-hooks/40-include_syslinux_in_ISO_filesystem
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+set -e
+
+# Including common functions
+. "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh
+
+# Setting static variables
+DESCRIPTION="$(Echo 'including syslinux in the ISO filesystem')"
+HELP=""
+USAGE="${PROGRAM}"
+
+# Reading configuration files
+Read_conffiles config/all config/bootstrap config/common config/binary
+Set_defaults
+
+# Safeguards
+[ "${LB_BOOTLOADER}" = "syslinux" ] || exit 0
+[ "${LB_ARCHITECTURE}" = "i386" ] || exit 0
+
+# Seems like we'll have work to do
+Echo_message 'including syslinux in the ISO filesystem'
+
+# Variables
+BINARY_UTILS_DIR='binary/utils/linux'
+BINARY_MBR_DIR='binary/utils/mbr'
+CHROOT_SYSLINUX_BIN='chroot/usr/bin/syslinux'
+CHROOT_SYSLINUX_MBR='chroot/usr/lib/SYSLINUX/gptmbr.bin'
+
+# Main
+mkdir -p "$BINARY_UTILS_DIR" "$BINARY_MBR_DIR"
+cp "$CHROOT_SYSLINUX_BIN" "$BINARY_UTILS_DIR/"
+cp "$CHROOT_SYSLINUX_MBR" "$BINARY_MBR_DIR/mbr.bin"