From: Michael Prokop Date: Fri, 17 Jul 2020 12:35:24 +0000 (+0200) Subject: Support UEFI PXE boot with DHCPv4 X-Git-Url: http://git.grml.org/?a=commitdiff_plain;h=refs%2Fheads%2Fmika%2Fefi;p=grml-terminalserver.git Support UEFI PXE boot with DHCPv4 Useful resource: https://wiki.ubuntu.com/UEFI/SecureBoot/PXE-IPv6 This work was funded by Grml-Forensic. --- diff --git a/debian/control b/debian/control index 901e857..8f7c431 100644 --- a/debian/control +++ b/debian/control @@ -17,11 +17,13 @@ Depends: atftpd (>=0.7.dfsg-1.2), dialog, grml-shlib (>=1.02.03), grml2usb (>=0.9.14), + grub-efi-amd64-signed | grub-efi-amd64-bin | pxelinux, ipcalc, isc-dhcp-server | dhcp3-server, nfs-kernel-server, pxelinux | syslinux-common (<= 2:4.05+dfsg-6+deb7u1), - ${misc:Depends} + shim-signed:amd64 | pxelinux, + ${misc:Depends}, Description: terminalserver for grml to boot via PXE These packages provides all what's needed to boot grml over the network (PXE). An easy to use interface diff --git a/grml-terminalserver b/grml-terminalserver index 3fcfa37..3e7a6aa 100755 --- a/grml-terminalserver +++ b/grml-terminalserver @@ -221,7 +221,11 @@ function createTftpConf execute "install -m 644 $PXE_BOOT_MSG_ $TFTPD_DATA_DIR_" die [ -f "$PXE_BOOT_LOGO_" ] && execute "install -m 644 $PXE_BOOT_LOGO_ $TFTPD_DATA_DIR_" die + # PXE / BIOS boot (pxelinux) execute "source $TEMPLATE_CONFIG_DIR_/grub-pxelinux_config" die + + # PXE / EFI boot (GRUB) + execute "source $TEMPLATE_CONFIG_DIR_/grub-shim_config" die } function stopTftp diff --git a/templates/dhcpd_config b/templates/dhcpd_config index 824b42e..5bf9ded 100644 --- a/templates/dhcpd_config +++ b/templates/dhcpd_config @@ -45,21 +45,27 @@ cat >"$DHCPD_CONFIG_FILE_" < "${TFTPD_DATA_DIR_}/grub/grub.cfg" << EOT +# GRUB PXE configuration file + +# adjust according to your needs +#set timeout=300 + +insmod png +set gfxmode=auto +insmod gfxterm +terminal_output gfxterm + +set menu_color_normal=white/black +set menu_color_highlight=black/yellow + +# this needs some tuning, so not enabled by default +# set theme=/boot/grub/grml-theme/theme.txt +# export theme + +EOT + +# theme support requires e.g. icons/submenu.png within the theme directory, +# which we don't ship though, so not enabled by default +#mkdir -p "${TFTPD_DATA_DIR_}"/grub/themes/boot/grub +#ln -s "${TFTPD_DATA_DIR_}"/boot/grub/grml-theme "${TFTPD_DATA_DIR_}"/grub/themes/boot/grub/ + +for file in "${TFTPD_DATA_DIR_}"/boot/grub/*_default.cfg "${TFTPD_DATA_DIR_}"/boot/grub/*_options.cfg ; do + filename="$(basename "${file}")" + echo "source boot/grub/${filename}" >> "${TFTPD_DATA_DIR_}/grub/grub.cfg" +done + +cat >> "${TFTPD_DATA_DIR_}/grub/grub.cfg" << EOT + +menuentry "Boot OS of first partition on first disk" { + set root=(hd0,1) + chainloader +1 +} +EOT + +(( ret_=ret_+ $? )) +return "$ret_"