pxe: allow personalization of boot menus

This commit is contained in:
pedro 2024-09-27 18:02:37 -03:00
parent 5dbb4a58f3
commit d2e5b1f824
1 changed files with 5 additions and 18 deletions

View File

@ -114,24 +114,10 @@ install_netboot() {
${SUDO} cp /usr/lib/syslinux/memdisk "${tftp_path}/" ${SUDO} cp /usr/lib/syslinux/memdisk "${tftp_path}/"
${SUDO} cp /usr/lib/syslinux/modules/bios/* "${tftp_path}/" ${SUDO} cp /usr/lib/syslinux/modules/bios/* "${tftp_path}/"
${SUDO} tee "${tftp_path}/pxelinux.cfg/default" <<END envsubst < ./pxe-menu.cfg | ${SUDO} tee "${tftp_path}/pxelinux.cfg/default"
DEFAULT menu.c32
PROMPT 0
TIMEOUT 50
ONTIMEOUT wb
MENU TITLE PXE Boot Menu
LABEL wb
MENU LABEL Boot Workbench
KERNEL vmlinuz
INITRD initrd
APPEND ip=dhcp netboot=nfs nfsroot=${server_ip}:${nfs_path}/ boot=live text forcepae
END
cd -
fi fi
rsync -av "${PXE_DIR}/../iso/staging/live/filesystem.squashfs" "${nfs_path}/live/" ${SUDO} rsync -av "${PXE_DIR}/../iso/staging/live/filesystem.squashfs" "${nfs_path}/live/"
} }
init_config() { init_config() {
@ -151,8 +137,9 @@ init_config() {
fi fi
VERSION_CODENAME="${VERSION_CODENAME:-bookworm}" VERSION_CODENAME="${VERSION_CODENAME:-bookworm}"
tftp_path="${tftp_path:-/srv/pxe-tftp}" tftp_path="${tftp_path:-/srv/pxe-tftp}"
server_ip="${server_ip}" # vars used in envsubst require to be exported:
nfs_path="${nfs_path:-/srv/pxe-nfs}" export server_ip="${server_ip}"
export nfs_path="${nfs_path:-/srv/pxe-nfs}"
} }
main() { main() {