Skip to content

Instantly share code, notes, and snippets.

@CoRfr
Last active April 4, 2023 15:12
Show Gist options
  • Save CoRfr/1548e3fc7b6688ebd39274dcb580fe95 to your computer and use it in GitHub Desktop.
Save CoRfr/1548e3fc7b6688ebd39274dcb580fe95 to your computer and use it in GitHub Desktop.
Build iPXE for Raspberry Pi (4)
#!/bin/bash -xe
# To build in 64bit mode
if ! command -v aarch64-linux-gnu-gcc; then
sudo apt-get install gcc-aarch64-linux-gnu
fi
if ! command -v mformat; then
sudo apt-get install mtools
fi
export CROSS_COMPILE=aarch64-linux-gnu-
if [ -z "$IPXE_DIR" ]; then
if [ -e "src" ]; then
export IPXE_DIR="$PWD/src"
elif [ -e "Makefile.efi" ]; then
export IPXE_DIR="$PWD"
else
IPXE_DIR="$HOME/ipxe"
if [ -e "$IPXE_DIR" ]; then
git clone git://git.ipxe.org/ipxe.git "$IPXE_DIR"
fi
fi
fi
if [ ! -e "$IPXE_DIR" ]; then
exit 1
fi
cd "$IPXE_DIR"
# Enable HTTPS
sed -i 's/\(#undef\)\(.*DOWNLOAD_PROTO_HTTPS\)/#define\2/' "config/general.h"
make -j bin-arm64-efi/ipxe.efi
make -j bin-arm64-efi/ipxe.usb
set +x
echo "Output:"
echo " $PWD/bin-arm64-efi/ipxe.efi"
echo " $PWD/bin-arm64-efi/ipxe.usb"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment