summaryrefslogtreecommitdiffstats
path: root/config/binary_local-hooks
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2015-07-04 14:49:33 +0000
committerintrigeri <intrigeri@boum.org>2015-07-04 14:49:33 +0000
commitdc81627467dce47908d446e167f8e11642500daa (patch)
treeadec8b22de0e44677f5435f04b80a9b1b54eb8f9 /config/binary_local-hooks
parent42c4df2793a4897bb36362b2a8543de5ef0a9620 (diff)
parent9ed1bb430e439a1ac963de2133f8d1bf883b5945 (diff)
Merge branch 'feature/9381-ship-amd64-syslinux' into feature/jessie
Diffstat (limited to 'config/binary_local-hooks')
-rwxr-xr-xconfig/binary_local-hooks/40-include_syslinux_in_ISO_filesystem39
1 files changed, 30 insertions, 9 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
index aed5f33..4991739 100755
--- a/config/binary_local-hooks/40-include_syslinux_in_ISO_filesystem
+++ b/config/binary_local-hooks/40-include_syslinux_in_ISO_filesystem
@@ -21,23 +21,44 @@ Set_defaults
# Seems like we'll have work to do
Echo_message 'including syslinux in the ISO filesystem'
-# Variables
+### Functions
+
+syslinux_deb_version_in_chroot () {
+ chroot chroot dpkg-query -W -f='${Version}\n' syslinux
+}
+
+### Variables
LINUX_BINARY_UTILS_DIR='binary/utils/linux'
WIN32_BINARY_UTILS_DIR='binary/utils/win32'
BINARY_MBR_DIR='binary/utils/mbr'
CHROOT_SYSLINUX_BIN='chroot/usr/bin/syslinux'
CHROOT_SYSLINUX_MBR='chroot/usr/lib/SYSLINUX/gptmbr.bin'
CHROOT_TEMP_APT_SOURCES='chroot/etc/apt/sources.list.d/tmp-deb-src.list'
+SYSLINUX_DEB_VERSION_IN_CHROOT=$(syslinux_deb_version_in_chroot)
-# Functions
-
-syslinux_deb_version_in_chroot () {
- chroot chroot dpkg-query -W -f='${Version}\n' syslinux
-}
-
-# Main
+### Main
mkdir -p "$LINUX_BINARY_UTILS_DIR" "$WIN32_BINARY_UTILS_DIR" "$BINARY_MBR_DIR"
+
+# Copy 32-bit syslinux binary
cp "$CHROOT_SYSLINUX_BIN" "$LINUX_BINARY_UTILS_DIR/"
+
+# Copy 64-bit syslinux binary
+(
+ olddir=$(pwd)
+ workdir=$(mktemp -d)
+ cd "$workdir"
+ chroot="$olddir/chroot"
+ Chroot "$chroot" \
+ apt-get --yes download \
+ syslinux:amd64="$SYSLINUX_DEB_VERSION_IN_CHROOT"
+ dpkg-deb --extract "$chroot"/syslinux_*.deb .
+ rm "$chroot"/syslinux_*.deb
+ cp ./usr/bin/syslinux "$olddir/$LINUX_BINARY_UTILS_DIR/syslinux-amd64"
+ cd "$olddir"
+ rm -r "$workdir"
+)
+
+# Copy syslinux MBR
cp "$CHROOT_SYSLINUX_MBR" "$BINARY_MBR_DIR/mbr.bin"
cat chroot/etc/apt/sources.list chroot/etc/apt/sources.list.d/*.list \
@@ -47,7 +68,7 @@ cat chroot/etc/apt/sources.list chroot/etc/apt/sources.list.d/*.list \
> "$CHROOT_TEMP_APT_SOURCES"
Chroot chroot apt-get --yes update
Chroot chroot apt-get --yes install dpkg-dev
-Chroot chroot apt-get source syslinux="$(syslinux_deb_version_in_chroot)"
+Chroot chroot apt-get source syslinux="$SYSLINUX_DEB_VERSION_IN_CHROOT"
cp chroot/syslinux-*/bios/win32/syslinux.exe "$WIN32_BINARY_UTILS_DIR/"
rm -r chroot/syslinux*
rm "$CHROOT_TEMP_APT_SOURCES"