feat: add custom ipxe bootloader
Some checks failed
Build / build-9 (pull_request) Failing after 3m11s
Build / build-8 (pull_request) Failing after 4m16s

- add rpm to manage tftpboot ipxe images for cobbler
This commit is contained in:
Ben Vincent 2025-07-12 18:14:48 +10:00
parent a14388a6e9
commit 8f3d7c38da
6 changed files with 87 additions and 0 deletions

View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1,18 @@
FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest
# Create output directory for RPMs
RUN mkdir -p /app/dist
# Set working directory
WORKDIR /app
ARG PACKAGE_RELEASE
ENV PACKAGE_RELEASE=${PACKAGE_RELEASE}
ARG PACKAGE_VERSION
ENV PACKAGE_VERSION=${PACKAGE_VERSION}
# Copy nfpm.yaml from the context into the container
COPY resources /app/resources
# Default command to build RPMs
CMD /app/resources/build.sh

View File

@ -0,0 +1,20 @@
#!/usr/bin/bash
# clone the repo
git clone https://github.com/ipxe/ipxe.git
# change into it
cd ipxe/src
# copy the main.pxi to embed
cp /app/resources/main.ipxe ./
# build images
make bin/undionly.kpxe EMBED=main.ipxe
make bin-x86_64-efi/ipxe.efi EMBED=main.ipxe
# copy to /app
cp bin/undionly.kpxe /app/
cp bin-x86_64-efi/ipxe.efi /app/
# build rpm
nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm

View File

@ -0,0 +1,2 @@
#!ipxe
chain tftp://198.18.19.19/main.ipxe

View File

@ -0,0 +1,44 @@
# nfpm.yaml
name: unkin-undionly-kpxe
version: ${PACKAGE_VERSION}
release: ${PACKAGE_RELEASE}
arch: amd64
platform: linux
section: default
priority: extra
description: "iPXE network bootloader"
maintainer: iPXE
homepage: https://github.com/ipxe/ipxe
license: GPL-2.0 license
disable_globbing: false
replaces:
- unkin-undionly-kpxe
provides:
- undionly.kpxe
- ipxe.efi
# Files to include in the package
contents:
- src: /app/ipxe.efi
dst: /var/lib/tftpboot/ipxe.efi
file_info:
mode: 0644
owner: root
group: root
- src: /app/undionly.kpxe
dst: /var/lib/tftpboot/undionly.kpxe
file_info:
mode: 0644
owner: root
group: root
# Scripts to run during installation/removal (optional)
scripts:
preinstall: ./resources/preinstall.sh
# postinstall: ./scripts/postinstall.sh
# preremove: ./scripts/preremove.sh
# postremove: ./scripts/postremove.sh

View File

@ -0,0 +1,2 @@
#!/usr/bin/bash
mkdir -p /var/lib/tftpboot