2007-09-23 08:04:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# lh_binary_syslinux(1) - installs syslinux
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Source common functions
|
|
|
|
for FUNCTION in /usr/share/live-helper/functions/*.sh
|
|
|
|
do
|
|
|
|
. ${FUNCTION}
|
|
|
|
done
|
|
|
|
|
|
|
|
# Reading configuration files
|
|
|
|
Read_conffile config/common
|
|
|
|
Read_conffile config/bootstrap
|
|
|
|
Read_conffile config/image
|
|
|
|
Set_defaults
|
|
|
|
|
|
|
|
# Requiring stage file
|
2007-09-23 08:04:47 +00:00
|
|
|
Require_stagefile .stage/bootstrap
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Checking lock file
|
2007-09-23 08:04:47 +00:00
|
|
|
Check_lockfile .lock
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Creating lock file
|
2007-09-23 08:04:47 +00:00
|
|
|
Create_lockfile .lock
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Checking stage file
|
2007-09-23 08:04:47 +00:00
|
|
|
Check_stagefile .stage/binary_syslinux
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
if [ "${LIVE_ARCHITECTURE}" != "amd64" ] && [ "${LIVE_ARCHITECTURE}" != "i386" ]
|
|
|
|
then
|
|
|
|
echo "W: skipping binary_syslinux, foreign architecture."
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${LIVE_SYSLINUX}" = "enabled" ]
|
|
|
|
then
|
2007-09-23 08:04:47 +00:00
|
|
|
if [ ! -f chroot/usr/bin/syslinux ]
|
2007-09-23 08:04:46 +00:00
|
|
|
then
|
|
|
|
PACKAGES="${PACKAGES} syslinux"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${PACKAGES}" ]
|
|
|
|
then
|
|
|
|
# Installing symlinks
|
|
|
|
case "${LH_APT}" in
|
2007-09-23 08:04:47 +00:00
|
|
|
apt|apt-get)
|
2007-09-23 08:04:46 +00:00
|
|
|
Chroot "apt-get install --yes ${PACKAGES}"
|
|
|
|
;;
|
|
|
|
|
|
|
|
aptitude)
|
|
|
|
Chroot "aptitude install --assume-yes ${PACKAGES}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${LIVE_ENCRYPTION}" ]
|
|
|
|
then
|
|
|
|
LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} encryption=${LIVE_ENCRYPTION}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
case "${LIVE_BINARY_IMAGE}" in
|
|
|
|
iso)
|
|
|
|
# Copying syslinux
|
2007-09-23 08:04:47 +00:00
|
|
|
mkdir -p binary/isolinux
|
|
|
|
cp chroot/usr/lib/syslinux/isolinux.bin binary/isolinux
|
|
|
|
cp -r "${LIVE_TEMPLATES}"/syslinux/* binary/isolinux
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Copying splash screen
|
|
|
|
if [ -n "${LIVE_SYSLINUX_SPLASH}" ]
|
|
|
|
then
|
2007-09-23 08:04:47 +00:00
|
|
|
cp "${LIVE_SYSLINUX_SPLASH}" binary/isolinux/splash.rle
|
2007-09-23 08:04:46 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Configure syslinux templates
|
2007-09-23 08:04:47 +00:00
|
|
|
sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/isolinux/isolinux.cfg
|
|
|
|
sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" binary/isolinux/f1.txt
|
|
|
|
sed -i -e "s/LIVE_VERSION/${VERSION}/" binary/isolinux/f10.txt
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Remove unused files
|
2007-09-23 08:04:47 +00:00
|
|
|
rm -f binary/isolinux/pxelinux.cfg
|
2007-09-23 08:04:46 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
net)
|
|
|
|
# Copying syslinux
|
2007-09-23 08:04:47 +00:00
|
|
|
mkdir -p tftpboot
|
|
|
|
cp chroot/usr/lib/syslinux/pxelinux.0 tftpboot
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Install syslinux templates
|
2007-09-23 08:04:47 +00:00
|
|
|
mkdir -p tftpboot/pxelinux.cfg
|
|
|
|
cp -r "${LIVE_TEMPLATES}"/syslinux/* tftpboot/pxelinux.cfg
|
|
|
|
mv tftpboot/pxelinux.cfg/pxelinux.cfg tftpboot/pxelinux.cfg/default
|
|
|
|
sed -i -e 's#splash.rle#pxelinux.cfg/splash.rle#' tftpboot/pxelinux.cfg/isolinux.txt
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Copying splash screen
|
|
|
|
if [ -n "${LIVE_SYSLINUX_SPLASH}" ]
|
|
|
|
then
|
2007-09-23 08:04:47 +00:00
|
|
|
cp "${LIVE_SYSLINUX_SPLASH}" ftpboot/pxelinux.cfg/splash.rle
|
2007-09-23 08:04:46 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Configure syslinux templates
|
2007-09-23 08:04:47 +00:00
|
|
|
sed -i -e "s/LIVE_SERVER_ADDRESS/${LIVE_SERVER_ADDRESS}/" -e "s#LIVE_SERVER_PATH#${LIVE_SERVER_PATH}#" -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" tftpboot/pxelinux.cfg/default
|
|
|
|
sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" tftpboot/pxelinux.cfg/f1.txt
|
|
|
|
sed -i -e "s/LIVE_VERSION/${VERSION}/" tftpboot/pxelinux.cfg/f10.txt
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Remove unused files
|
2007-09-23 08:04:47 +00:00
|
|
|
rm -f tftpboot/pxelinux.cfg/isolinux.cfg
|
2007-09-23 08:04:46 +00:00
|
|
|
;;
|
|
|
|
|
2007-09-23 08:04:47 +00:00
|
|
|
usb|hdd)
|
2007-09-23 08:04:46 +00:00
|
|
|
# Copying syslinux
|
2007-09-23 08:04:47 +00:00
|
|
|
mkdir -p binary
|
|
|
|
cp chroot/usr/lib/syslinux/isolinux.bin binary/syslinux.bin
|
|
|
|
cp -r "${LIVE_TEMPLATES}"/syslinux/* binary
|
|
|
|
mv binary/isolinux.cfg binary/syslinux.cfg
|
|
|
|
mv binary/isolinux.txt binary/syslinux.txt
|
|
|
|
sed -i -e "s/isolinux.txt/syslinux.txt/" binary/syslinux.cfg
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Copying splash screen
|
|
|
|
if [ -n "${LIVE_SYSLINUX_SPLASH}" ]
|
|
|
|
then
|
2007-09-23 08:04:47 +00:00
|
|
|
cp "${LIVE_SYSLINUX_SPLASH}" binary/splash.rle
|
2007-09-23 08:04:46 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Configure syslinux templates
|
2007-09-23 08:04:47 +00:00
|
|
|
sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/syslinux.cfg
|
|
|
|
sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" binary/f1.txt
|
|
|
|
sed -i -e "s/LIVE_VERSION/${VERSION}/" binary/f10.txt
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Remove unused files
|
2007-09-23 08:04:47 +00:00
|
|
|
rm -f binary/pxelinux.cfg
|
2007-09-23 08:04:46 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [ -n "${PACKAGES}" ]
|
|
|
|
then
|
|
|
|
# Removing syslinux
|
|
|
|
case "${LH_APT}" in
|
2007-09-23 08:04:47 +00:00
|
|
|
apt|apt-get)
|
2007-09-23 08:04:46 +00:00
|
|
|
Chroot "apt-get remove --purge --yes ${PACKAGES}"
|
|
|
|
;;
|
|
|
|
|
|
|
|
aptitude)
|
|
|
|
Chroot "aptitude purge --assume-yes ${PACKAGES}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Creating stage file
|
2007-09-23 08:04:47 +00:00
|
|
|
Create_stagefile .stage/binary_syslinux
|
2007-09-23 08:04:46 +00:00
|
|
|
fi
|