1 # the following variables are available in the template:
3 # $INTERFACE_ (interface for the terminalserver)
4 # $IP_ (ip for the terminalserver to bind)
5 # $NETMASK_ (network mask)
7 # $NAMESERVERS_ (nameservers for the nodes)
8 # $IPRANGE_FROM_ (user configured iprange, first ip)
9 # $IPRANGE_TO_ (user configured iprange, last ip)
10 # $NETWORK_ (first ip in this subnet)
11 # $OPTIONS_ (options for grml-terminalserver)
12 # $BOOT_ARGS_ (boot arguments for the nodes)
15 # templates are shellscript fragments and will be sourced from the
20 if [ -r "${TFTPD_DATA_DIR_}"/shim.efi ] ; then
21 echo "${TFTPD_DATA_DIR_}/shim.efi exists already, nothing to do."
22 elif [ -r /usr/lib/shim/shimx64.efi.signed ] ; then
23 echo "Installing /usr/lib/shim/shimx64.efi.signed as shim.efi for TFTP usage"
24 cp /usr/lib/shim/shimx64.efi.signed "${TFTPD_DATA_DIR_}"/shim.efi
25 elif [ -r /usr/lib/shim/shimx64.efi ] ; then
26 echo "Installing /usr/lib/shim/shimx64.efi as shim.efi for TFTP usage"
27 cp /usr/lib/shim/shimx64.efi "${TFTPD_DATA_DIR_}"/shim.efi
29 echo "WARN: No shimx64.efi for usage with PXE boot found, not setting up UEFI boot via GRUB."
34 if [ -r "${TFTPD_DATA_DIR_}"/grubx64.efi ] ; then
35 echo "${TFTPD_DATA_DIR_}/grubx64.efi exists already, nothing to do."
36 elif [ -r /usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed ] ; then
37 echo "Installing /usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed as grubx64.efi for TFTP usage"
38 cp /usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed "${TFTPD_DATA_DIR_}"/grubx64.efi
39 elif [ -r /usr/lib/grub/x86_64-efi/monolithic/grubnetx64.efi ] ; then
40 echo "Installing /usr/lib/grub/x86_64-efi/monolithic/grubnetx64.efi as grubx64.efi for TFTP usage"
41 cp /usr/lib/grub/x86_64-efi/monolithic/grubnetx64.efi "${TFTPD_DATA_DIR_}"/grubx64.efi
43 echo "WARN: No grubnetx64.efi for usage with PXE boot found, not setting up UEFI boot via GRUB."
48 echo "Setting up GRUB configuration for PXE/UEFI usage"
49 mkdir -p "${TFTPD_DATA_DIR_}/grub/"
50 cat > "${TFTPD_DATA_DIR_}/grub/grub.cfg" << EOT
51 # GRUB PXE configuration file
53 # adjust according to your needs
59 terminal_output gfxterm
61 set menu_color_normal=white/black
62 set menu_color_highlight=black/yellow
64 # this needs some tuning, so not enabled by default
65 # set theme=/boot/grub/grml-theme/theme.txt
70 # theme support requires e.g. icons/submenu.png within the theme directory,
71 # which we don't ship though, so not enabled by default
72 #mkdir -p "${TFTPD_DATA_DIR_}"/grub/themes/boot/grub
73 #ln -s "${TFTPD_DATA_DIR_}"/boot/grub/grml-theme "${TFTPD_DATA_DIR_}"/grub/themes/boot/grub/
75 for file in "${TFTPD_DATA_DIR_}"/boot/grub/*_default.cfg "${TFTPD_DATA_DIR_}"/boot/grub/*_options.cfg ; do
76 filename="$(basename "${file}")"
77 echo "source boot/grub/${filename}" >> "${TFTPD_DATA_DIR_}/grub/grub.cfg"
80 cat >> "${TFTPD_DATA_DIR_}/grub/grub.cfg" << EOT
82 menuentry "Boot OS of first partition on first disk" {