commit 28b16899873c68ab03170418f707670b4547c23b Author: Timo Makinen Date: Sat Jun 15 19:34:59 2024 +0000 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..44fd143 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +bin +bin-x86_64-efi diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..02235a7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +FROM rockylinux:9 + +RUN set -eux ; \ + dnf upgrade -y ; \ + dnf -y install --nodocs --setopt=install_weak_deps=False \ + gcc \ + genisoimage \ + git \ + make \ + patch \ + syslinux \ + xz-devel \ + ; \ + dnf -y clean all ; \ + rm -rf /var/cache/dnf + +RUN set -eux ; \ + useradd -c "iPXE Builder" -d /build -m build + +WORKDIR /build +USER build + +COPY --chmod=0644 config.patch embed.ipxe . + +CMD set -eux ; \ + { \ + git clone https://github.com/ipxe/ipxe.git ; \ + cd ipxe/src ; \ + patch -p0 < /build/config.patch ; \ + make \ + bin/ipxe.iso bin/ipxe.usb bin/undionly.kpxe \ + bin-x86_64-efi/ipxe.iso bin-x86_64-efi/ipxe.usb \ + EMBEDDED_IMAGE=/build/embed.ipxe ; \ + } 1>&2 ; \ + tar cf - bin/ipxe.iso bin/ipxe.usb bin/undionly.kpxe \ + bin-x86_64-efi/ipxe.iso bin-x86_64-efi/ipxe.usb diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..c9ead85 --- /dev/null +++ b/build.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -eu + +cd "$(dirname "$0")" +docker build -t ipxe . + +docker run --log-driver none --rm -i ipxe | tar xvf - diff --git a/config.patch b/config.patch new file mode 100644 index 0000000..8ecb07a --- /dev/null +++ b/config.patch @@ -0,0 +1,42 @@ +--- config/general.h.orig 2024-06-15 18:56:04.002548342 +0000 ++++ config/general.h 2024-06-15 19:23:07.500619158 +0000 +@@ -36,10 +36,10 @@ + + #define NET_PROTO_IPV4 /* IPv4 protocol */ + //#define NET_PROTO_IPV6 /* IPv6 protocol */ +-#undef NET_PROTO_FCOE /* Fibre Channel over Ethernet protocol */ +-#define NET_PROTO_STP /* Spanning Tree protocol */ +-#define NET_PROTO_LACP /* Link Aggregation control protocol */ +-#define NET_PROTO_EAPOL /* EAP over LAN protocol */ ++//#undef NET_PROTO_FCOE /* Fibre Channel over Ethernet protocol */ ++//#define NET_PROTO_STP /* Spanning Tree protocol */ ++//#define NET_PROTO_LACP /* Link Aggregation control protocol */ ++//#define NET_PROTO_EAPOL /* EAP over LAN protocol */ + //#define NET_PROTO_LLDP /* Link Layer Discovery protocol */ + + /* +@@ -54,9 +54,9 @@ + * + */ + +-#define DOWNLOAD_PROTO_TFTP /* Trivial File Transfer Protocol */ ++#undef DOWNLOAD_PROTO_TFTP /* Trivial File Transfer Protocol */ + #define DOWNLOAD_PROTO_HTTP /* Hypertext Transfer Protocol */ +-#undef DOWNLOAD_PROTO_HTTPS /* Secure Hypertext Transfer Protocol */ ++#define DOWNLOAD_PROTO_HTTPS /* Secure Hypertext Transfer Protocol */ + #undef DOWNLOAD_PROTO_FTP /* File Transfer Protocol */ + #undef DOWNLOAD_PROTO_SLAM /* Scalable Local Area Multicast */ + #undef DOWNLOAD_PROTO_NFS /* Network File System Protocol */ +@@ -67,9 +67,9 @@ + * + */ + +-//#undef SANBOOT_PROTO_ISCSI /* iSCSI protocol */ +-//#undef SANBOOT_PROTO_AOE /* AoE protocol */ +-//#undef SANBOOT_PROTO_IB_SRP /* Infiniband SCSI RDMA protocol */ ++#undef SANBOOT_PROTO_ISCSI /* iSCSI protocol */ ++#undef SANBOOT_PROTO_AOE /* AoE protocol */ ++#undef SANBOOT_PROTO_IB_SRP /* Infiniband SCSI RDMA protocol */ + //#undef SANBOOT_PROTO_FCP /* Fibre Channel protocol */ + //#undef SANBOOT_PROTO_HTTP /* HTTP SAN protocol */ + diff --git a/embed.ipxe b/embed.ipxe new file mode 100644 index 0000000..2f78fb8 --- /dev/null +++ b/embed.ipxe @@ -0,0 +1,6 @@ +#!ipxe + +:retry +dhcp || goto retry + +chain https://boot.foo.sh/boot.ipxe