Added Arch live system to the PXE menu

This commit is contained in:
nospoonuser 2018-05-27 15:07:46 +02:00
parent 6823d8712a
commit 293f3b48e4
3 changed files with 41 additions and 0 deletions

View File

@ -1,3 +1,4 @@
MEMTEST_BIN="/boot/memtest86+.bin" MEMTEST_BIN="/boot/memtest86+.bin"
UBUNTU_INSTALL_NETBOOT="http://de.archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/current/images/netboot/netboot.tar.gz" UBUNTU_INSTALL_NETBOOT="http://de.archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/current/images/netboot/netboot.tar.gz"
DEBIAN_INSTALL_NETBOOT="http://ftp.nl.debian.org/debian/dists/stretch/main/installer-amd64/current/images/netboot/netboot.tar.gz" DEBIAN_INSTALL_NETBOOT="http://ftp.nl.debian.org/debian/dists/stretch/main/installer-amd64/current/images/netboot/netboot.tar.gz"
ARCH_BASEDIR="arch/arch"

View File

@ -41,6 +41,24 @@ function menulivepxe {
# FETCH # FETCH
# ftp, http, tftp # ftp, http, tftp
if [ -n "$PXE_HTTP_BASE" ]
then
PXE_FETCH_HTTP="http://${PXE_SERVER}${PXE_HTTP_BASE}"
fi
if [ -n "$PXE_FTP_BASE" ]
then
PXE_FETCH_FTP="ftp://${PXE_SERVER}${PXE_FTP_BASE}"
fi
if [ -n "$PXE_TFTP_BASE" ]
then
PXE_FETCH_TFTP="ftp://${PXE_SERVER}${PXE_TFTP_BASE}"
fi
num=$(echo "$PXE_FETCH_FTP $PXE_FETCH_HTTP $PXE_FETCH_TFTP" | wc -w) num=$(echo "$PXE_FETCH_FTP $PXE_FETCH_HTTP $PXE_FETCH_TFTP" | wc -w)
if [ $num -gt 1 ];then if [ $num -gt 1 ];then
@ -175,3 +193,21 @@ menu end
EOF EOF
} }
menuarchlive(){
archbasedir=$ARCH_BASEDIR
localarchpath=$ARCH_LOCALPATH
if [ -n "$localarchpath" ] && [ -d $localarchpath/$archisobasedir ];
then
sed -r -e "s~boot~../${archbasedir}/boot~g" -n -e '/arch64_http/,/^$/p' ${localarchpath}${archbasedir}/boot/syslinux/archiso_pxe.cfg
else
#echo "http://${pxeserver}/${archbasedir}/boot/syslinux/archiso_pxe.cfg" 1>&2
curl -s http://${PXE_SERVER}${PXE_HTTP_BASE}/${archbasedir}/boot/syslinux/archiso_pxe.cfg | sed -r \
-e "s~boot~../${archbasedir}/boot~g" \
-e "s~basedir=arch~basedir=${PXE_HTTP_BASE}/${ARCH_BASEDIR}~g" \
-e "s/\\$\{pxeserver\}/${PXE_SERVER}/g" \
-n -e '/arch64_http/,/^$/p'
fi
}

View File

@ -27,6 +27,10 @@ menuhead > $PXEDIR/pxelinux/pxelinux.cfg/default
menulivehead >> $PXEDIR/pxelinux/pxelinux.cfg/default menulivehead >> $PXEDIR/pxelinux/pxelinux.cfg/default
menulivepxe >> $PXEDIR/pxelinux/pxelinux.cfg/default menulivepxe >> $PXEDIR/pxelinux/pxelinux.cfg/default
if [ "$PXE_INCLUDE_ARCH_LIVE" == "true" ]; then
menuarchlive >> $PXEDIR/pxelinux/pxelinux.cfg/default
fi
if [ "$PXE_INCLUDE_UBUNTU_INSTALLER" == "true" ] || [ "$PXE_INCLUDE_DEBIAN_INSTALLER" == "true" ]; then if [ "$PXE_INCLUDE_UBUNTU_INSTALLER" == "true" ] || [ "$PXE_INCLUDE_DEBIAN_INSTALLER" == "true" ]; then
menuinstallerhead >> $PXEDIR/pxelinux/pxelinux.cfg/default menuinstallerhead >> $PXEDIR/pxelinux/pxelinux.cfg/default
fi fi