Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ Architecture: all
Depends: atftpd,
dialog,
grml2usb,
grub-efi-amd64-signed | grub-efi-amd64-bin | pxelinux,
grub-efi-amd64-signed | grub-efi-amd64-bin | grub-efi-arm64-signed | grub-efi-arm64-bin | pxelinux,
ipcalc,
iptables,
isc-dhcp-server,
nfs-kernel-server,
pxelinux,
shim-signed:amd64 | pxelinux,
shim-signed:amd64 | shim-signed:arm64 | pxelinux,
${misc:Depends},
Description: terminalserver for grml to boot via PXE
These packages provides all what's needed to boot
Expand Down
5 changes: 3 additions & 2 deletions templates/dhcpd_config
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@ subnet $NETWORK_ netmask $NETMASK_ {
class "pxeclients" {
match if substring (option vendor-class-identifier, 0 ,9) = "PXEClient";
if option architecture-type = 00:07 {
filename "shim.efi";
filename "bootx64.efi";
} elsif option architecture-type = 00:0b {
filename "bootaa64.efi";
} else {
filename "pxelinux.0";
}
}
}

EOT

77 changes: 53 additions & 24 deletions templates/grub-shim_config
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,61 @@
#
# GLOBAL_README_END

if [ -r "${TFTPD_DATA_DIR_}"/shim.efi ] ; then
echo "${TFTPD_DATA_DIR_}/shim.efi exists already, nothing to do."
elif [ -r /usr/lib/shim/shimx64.efi.signed ] ; then
echo "Installing /usr/lib/shim/shimx64.efi.signed as shim.efi for TFTP usage"
cp /usr/lib/shim/shimx64.efi.signed "${TFTPD_DATA_DIR_}"/shim.efi
elif [ -r /usr/lib/shim/shimx64.efi ] ; then
echo "Installing /usr/lib/shim/shimx64.efi as shim.efi for TFTP usage"
cp /usr/lib/shim/shimx64.efi "${TFTPD_DATA_DIR_}"/shim.efi
else
echo "WARN: No shimx64.efi for usage with PXE boot found, not setting up UEFI boot via GRUB."
(( ret_=ret_+ $? ))
return "$ret_"
if [ "$(uname -m)" = "x86_64" ]; then
if [ -r "${TFTPD_DATA_DIR_}"/grubx64.efi ] ; then
echo "${TFTPD_DATA_DIR_}/grubx64.efi exists already, nothing to do."
elif [ -r /usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed ] ; then
echo "Installing /usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed as grubx64.efi for TFTP usage"
cp /usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed "${TFTPD_DATA_DIR_}"/grubx64.efi
elif [ -r /usr/lib/grub/x86_64-efi/monolithic/grubnetx64.efi ] ; then
echo "Installing /usr/lib/grub/x86_64-efi/monolithic/grubnetx64.efi as grubx64.efi for TFTP usage"
cp /usr/lib/grub/x86_64-efi/monolithic/grubnetx64.efi "${TFTPD_DATA_DIR_}"/grubx64.efi
else
echo "WARN: No grubnetx64.efi for usage with PXE boot found, not setting up UEFI boot via GRUB."
(( ret_=ret_+ $? ))
return "$ret_"
fi

if [ -r "${TFTPD_DATA_DIR_}"/bootx64.efi ] ; then
echo "${TFTPD_DATA_DIR_}/bootx64.efi exists already, nothing to do."
elif [ -r /usr/lib/shim/shimx64.efi.signed ] ; then
echo "Installing /usr/lib/shim/shimx64.efi.signed as bootx64.efi for TFTP usage"
cp /usr/lib/shim/shimx64.efi.signed "${TFTPD_DATA_DIR_}"/bootx64.efi
elif [ -r /usr/lib/shim/shimx64.efi ] ; then
echo "Installing /usr/lib/shim/shimx64.efi as bootx64.efi for TFTP usage"
cp /usr/lib/shim/shimx64.efi "${TFTPD_DATA_DIR_}"/bootx64.efi
else
echo "WARN: No shimx64.efi for usage with PXE boot found. Using GRUB directly as bootx64.efi."
cp "${TFTPD_DATA_DIR_}"/grubx64.efi "${TFTPD_DATA_DIR_}"/bootx64.efi
fi
fi
if [ "$(uname -m)" = "aarch64" ]; then
if [ -r "${TFTPD_DATA_DIR_}"/grubaa64.efi ] ; then
echo "${TFTPD_DATA_DIR_}/grubaa64.efi exists already, nothing to do."
elif [ -r /usr/lib/grub/arm64-efi-signed/grubnetaa64.efi.signed ] ; then
echo "Installing /usr/lib/grub/arm64-efi-signed/grubnetaa64.efi.signed as grubaa64.efi for TFTP usage"
cp /usr/lib/grub/arm64-efi-signed/grubnetaa64.efi.signed "${TFTPD_DATA_DIR_}"/grubaa64.efi
elif [ -r /usr/lib/grub/arm64-efi/monolithic/grubnetaa64.efi ] ; then
echo "Installing /usr/lib/grub/arm64-efi/monolithic/grubnetaa64.efi as grubaa64.efi for TFTP usage"
cp /usr/lib/grub/arm64-efi/monolithic/grubnetaa64.efi "${TFTPD_DATA_DIR_}"/grubaa64.efi
else
echo "WARN: No grubnetaa64.efi for usage with PXE boot found, not setting up UEFI boot via GRUB."
(( ret_=ret_+ $? ))
return "$ret_"
fi

if [ -r "${TFTPD_DATA_DIR_}"/grubx64.efi ] ; then
echo "${TFTPD_DATA_DIR_}/grubx64.efi exists already, nothing to do."
elif [ -r /usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed ] ; then
echo "Installing /usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed as grubx64.efi for TFTP usage"
cp /usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed "${TFTPD_DATA_DIR_}"/grubx64.efi
elif [ -r /usr/lib/grub/x86_64-efi/monolithic/grubnetx64.efi ] ; then
echo "Installing /usr/lib/grub/x86_64-efi/monolithic/grubnetx64.efi as grubx64.efi for TFTP usage"
cp /usr/lib/grub/x86_64-efi/monolithic/grubnetx64.efi "${TFTPD_DATA_DIR_}"/grubx64.efi
else
echo "WARN: No grubnetx64.efi for usage with PXE boot found, not setting up UEFI boot via GRUB."
(( ret_=ret_+ $? ))
return "$ret_"
if [ -r "${TFTPD_DATA_DIR_}"/bootaa64.efi ] ; then
echo "${TFTPD_DATA_DIR_}/bootaa64.efi exists already, nothing to do."
elif [ -r /usr/lib/shim/shimaa64.efi.signed ] ; then
echo "Installing /usr/lib/shim/shimaa64.efi.signed as bootaa64.efi for TFTP usage"
cp /usr/lib/shim/shimaa64.efi.signed "${TFTPD_DATA_DIR_}"/bootaa64.efi
elif [ -r /usr/lib/shim/shimaa64.efi ] ; then
echo "Installing /usr/lib/shim/shimaa64.efi as bootaa64.efi for TFTP usage"
cp /usr/lib/shim/shimaa64.efi "${TFTPD_DATA_DIR_}"/bootaa64.efi
else
echo "WARN: No shimaa64.efi for usage with PXE boot found. Using GRUB directly as bootaa64.efi."
cp "${TFTPD_DATA_DIR_}"/grubaa64.efi "${TFTPD_DATA_DIR_}"/bootaa64.efi
fi
fi

if [ -r "${TFTPD_DATA_DIR_}"/grub/fonts/unicode.pf2 ] ; then
Expand Down