mklive/scripts/pxe.sh

67 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
source $(dirname $0)/defaults.conf
source ${WORKDIR}/mklive.conf
source $(dirname $0)/functions.sh
source $(dirname $0)/menufunction.sh
echo "Starting PXE creation"
PXELINUX_MODULES="ldlinux.c32 libmenu.c32 menu.c32"
PXELINUX_BIN="/usr/lib/PXELINUX/pxelinux.0"
checkstage live || err "Previous stage (live) was not finished"
startstage pxe
PXEDIR=${WORKDIR}/PXE
requiredir $PXEDIR
requiredir $PXEDIR/pxelinux
requiredir $PXEDIR/pxelinux/pxelinux.cfg
[ -L $PXEDIR/live ] || ln -s ../LIVE $PXEDIR/live
#copy pxelinux.bin
cp ${PXELINUX_BIN} $PXEDIR/pxelinux/
#create pxelinux.conf
menuhead > $PXEDIR/pxelinux/pxelinux.cfg/default
menulivehead >> $PXEDIR/pxelinux/pxelinux.cfg/default
menulivepxe >> $PXEDIR/pxelinux/pxelinux.cfg/default
if [ "$PXE_INCLUDE_UBUNTU_INSTALLER" == "true" ] || [ "$PXE_INCLUDE_DEBIAN_INSTALLER" == "true" ]; then
menuinstallerhead >> $PXEDIR/pxelinux/pxelinux.cfg/default
fi
if [ "$PXE_INCLUDE_UBUNTU_INSTALLER" == "true" ]; then
menuinstaller ubuntu >> $PXEDIR/pxelinux/pxelinux.cfg/default
[ -L $PXEDIR/ubuntu-installer ] || ln -s ../INSTALLER/ubuntu-installer $PXEDIR/ubuntu-installer
fi
if [ "$PXE_INCLUDE_HDT" == "true" ] || [ "$PXE_INCLUDE_MEMTEST" == "true" ]; then
menuhwhead >> $PXEDIR/pxelinux/pxelinux.cfg/default
fi
if [ "$PXE_INCLUDE_HDT" == "true" ]; then
PXELINUX_MODULES="${PXELINUX_MODULES} hdt.c32 libutil.c32 libgpl.c32 libcom32.c32"
menuhwhdt >> $PXEDIR/pxelinux/pxelinux.cfg/default
[ -e /usr/share/misc/pci.ids ] && cp /usr/share/misc/pci.ids $PXEDIR/pxelinux/
fi
if [ "$PXE_INCLUDE_MEMTEST" == "true" ]; then
cp $MEMTEST_BIN $PXEDIR/memtest
menuhwmemtest >> $PXEDIR/pxelinux/pxelinux.cfg/default
fi
#copy all modules
for m in $PXELINUX_MODULES
do
cp ${SYSLINUX_MODULESDIR}/$m $PXEDIR/pxelinux/
done
#create tarball
endstage pxe