ungleich-tools/rebuild-ipxe.sh

48 lines
1 KiB
Bash
Raw Normal View History

2019-09-20 14:56:37 +00:00
#!/bin/sh
# Nico Schottelius, 2019-09-20, Seoul, Coffebean, 23:56
# Copying: GPLv3
2019-12-06 17:06:37 +00:00
echo "If you are running alpine, these packages are needed:"
echo "apk add alpine-sdk xz-dev"
2019-11-05 12:57:59 +00:00
set -x
set -e
2019-09-20 14:56:37 +00:00
if [ ! -e ipxe ]; then
git clone git://git.ipxe.org/ipxe.git
else
(cd ipxe; git pull)
fi
cd ipxe/src
sed -i \
-e 's/^#undef.*NET_PROTO_IPV6/#define NET_PROTO_IPV6/' \
2020-12-09 11:57:48 +00:00
-e 's,^//#define.*NET_PROTO_IPV6,#define NET_PROTO_IPV6,' \
2019-09-20 14:56:37 +00:00
-e 's/^#undef.*DOWNLOAD_PROTO_HTTPS/#define DOWNLOAD_PROTO_HTTPS/' \
-e 's,^//#define POWEROFF_CMD,#define POWEROFF_CMD,' \
-e 's,^//#define PING_CMD,#define PING_CMD,' \
-e 's,^//#define NTP_CMD,#define NTP_CMD,' config/general.h
2019-09-20 15:39:23 +00:00
mkdir -p output
2019-09-20 14:56:37 +00:00
2019-11-05 12:57:59 +00:00
make bin/ipxe.iso
cp bin/ipxe.iso output/
2019-09-20 14:58:47 +00:00
make bin/undionly.kpxe
2019-09-20 15:39:23 +00:00
cp bin/undionly.kpxe output/
2019-09-20 14:56:37 +00:00
make bin/ipxe.usb
2019-09-20 15:39:23 +00:00
cp bin/ipxe.usb output/
2019-09-20 14:56:37 +00:00
make bin-x86_64-efi/ipxe.efi
2019-09-20 15:39:23 +00:00
cp bin-x86_64-efi/ipxe.efi output/
2019-09-20 14:58:47 +00:00
cat <<EOF
2019-09-20 15:39:23 +00:00
Outputs in
2019-09-20 14:58:47 +00:00
- PXE chain-loadable: undionly.kpxe (put on tftp server)
- USB loadable ipxe.usb (dd to usb stick)
- EFI loadable: ipxe.efi (put on vfat partition)
EOF