Commit 21a1df43 authored by intrigeri's avatar intrigeri
Browse files

Merge branch 'bug/11873+upgrade_32-bit_to_64-bit_ISO' into feature/stretch

refs: #11873
parents 88c181ed a11b1223
......@@ -21,23 +21,47 @@ Set_defaults
# Seems like we'll have work to do
Echo_message 'including syslinux in the ISO filesystem'
### 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'
### Functions
syslinux_deb_version_in_chroot () {
chroot chroot dpkg-query -W -f='${Version}\n' syslinux
}
SYSLINUX_DEB_VERSION_IN_CHROOT=$(syslinux_deb_version_in_chroot)
### Main
mkdir -p "$LINUX_BINARY_UTILS_DIR" "$WIN32_BINARY_UTILS_DIR" "$BINARY_MBR_DIR"
cp "$CHROOT_SYSLINUX_BIN" "$LINUX_BINARY_UTILS_DIR/"
# We need the 32-bit binary until most of the users have upgraded to 64-bit.
# Copy 32-bit syslinux binary
(
olddir=$(pwd)
workdir=$(mktemp -d)
cd "$workdir"
chroot="$olddir/chroot"
echo "Configuring APT architectures for the installation of syslinux"
Chroot "$chroot" \
echo 'APT::Architectures {"i386"; "amd64";};' \
> /etc/apt/apt.conf.d/13architectures
Chroot "$chroot" dpkg --add-architecture i386
Chroot "$chroot" apt-get update
echo "Downloading syslinux:i386 version ${SYSLINUX_DEB_VERSION_IN_CHROOT}"
Chroot "$chroot" \
apt-get --yes download \
syslinux:i386="${SYSLINUX_DEB_VERSION_IN_CHROOT}"
echo "Extracting syslinux:i386"
dpkg-deb --extract "$chroot"/syslinux_*.deb .
rm "$chroot"/syslinux_*.deb
cp ./usr/bin/syslinux "$olddir/$LINUX_BINARY_UTILS_DIR/"
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 \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment