[build] Create util/gensrvimg for building network boot server images

In the spirit of util/genfsimg, create a script util/gensrvimg that
can be used to install compiled iPXE binaries to a directory tree
suitable for copying to a TFTP or HTTP server.

The script detects the CPU architecture for each input file and
installs it into the appropriate subdirectory.  Top-level symlinks are
created for each filename, with earlier files taking precedence.

Signed binaries are detected and automatically placed into a Secure
Boot specific subdirectory, thereby allowing the reduced-feature
Secure Boot binaries to coexist with full-feature binaries in a single
installation directory tree.  An iPXE shim may be specified and will
be automatically installed alongside the signed binaries, with the
relevant symlink created for each signed binary.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2026-02-23 16:00:02 +00:00
parent f0ceb70cb9
commit 9250a9091b
3 changed files with 374 additions and 6 deletions
+47 -6
View File
@@ -360,7 +360,7 @@ jobs:
shimx64.efi
combine:
name: BIOS + UEFI
name: Combine
runs-on: ubuntu-latest
needs:
- bios
@@ -370,7 +370,10 @@ jobs:
container:
image: ghcr.io/ipxe/ipxe-builder-utils
env:
binaries: >-
efishims: >-
-e shim/shimaa64.efi
-e shim/shimx64.efi
fsbinaries: >-
bin-x86_64-pcbios/${DRIVERS}.lkrn
bin-arm32-efi/${DRIVERS}.efi
bin-arm64-efi/${DRIVERS}.efi
@@ -379,6 +382,38 @@ jobs:
bin-riscv32-efi/${DRIVERS}.efi
bin-riscv64-efi/${DRIVERS}.efi
bin-x86_64-efi/${DRIVERS}.efi
srvbinaries: >-
bin/ipxe.pxe
bin/ipxe-legacy.pxe
bin/undionly.kpxe
bin-arm32-efi/ipxe.efi
bin-arm32-efi/ipxe-legacy.efi
bin-arm32-efi/snponly.efi
bin-arm64-efi/ipxe.efi
bin-arm64-efi/ipxe-legacy.efi
bin-arm64-efi/snponly.efi
bin-arm64-efi-sb/ipxe.efi
bin-arm64-efi-sb/snponly.efi
bin-i386-efi/ipxe.efi
bin-i386-efi/ipxe-legacy.efi
bin-i386-efi/snponly.efi
bin-loong64-efi/ipxe.efi
bin-loong64-efi/ipxe-legacy.efi
bin-loong64-efi/snponly.efi
bin-riscv32-efi/ipxe.efi
bin-riscv32-efi/ipxe-legacy.efi
bin-riscv32-efi/snponly.efi
bin-riscv64-efi/ipxe.efi
bin-riscv64-efi/ipxe-legacy.efi
bin-riscv64-efi/snponly.efi
bin-x86_64-efi/ipxe.efi
bin-x86_64-efi/ipxe-legacy.efi
bin-x86_64-efi/snponly.efi
bin-x86_64-efi-sb/ipxe.efi
bin-x86_64-efi-sb/snponly.efi
bin-x86_64-pcbios/ipxe.pxe
bin-x86_64-pcbios/ipxe-legacy.pxe
bin-x86_64-pcbios/undionly.kpxe
steps:
- name: Check out code
@@ -387,9 +422,9 @@ jobs:
- name: Download
uses: actions/download-artifact@v7
with:
pattern: "{bin-x86_64-pcbios,bin-*-efi,bin-*-efi-sb,shim}"
pattern: "{bin,bin-x86_64-pcbios,bin-*-efi,bin-*-efi-sb,shim}"
- name: Combine
- name: ISO + USB
run: |
# Provide an editable placeholder autoexec.ipxe for the USB image
cat > autoexec.ipxe <<'EOF'
@@ -400,11 +435,16 @@ jobs:
&& shell || autoboot
EOF
for DRIVERS in ipxe ipxe-legacy ; do
./src/util/genfsimg -o ${DRIVERS}.iso ${{ env.binaries }}
./src/util/genfsimg -o ${DRIVERS}.iso ${{ env.fsbinaries }}
./src/util/genfsimg -o ${DRIVERS}.usb -s autoexec.ipxe \
${{ env.binaries }}
${{ env.fsbinaries }}
done
- name: Server
run: |
./src/util/gensrvimg -o ipxeboot.tar.gz ${{ env.efishims }} \
${{ env.srvbinaries }}
- name: Upload
uses: actions/upload-artifact@v6
with:
@@ -415,6 +455,7 @@ jobs:
ipxe.usb
ipxe-legacy.iso
ipxe-legacy.usb
ipxeboot.tar.gz
netboot:
name: Netboot