From c1027053d0df037e42b358605af1c7f940287c12 Mon Sep 17 00:00:00 2001 From: Timothy Middelkoop Date: Sun, 24 Aug 2025 21:43:14 +0000 Subject: [PATCH] Add support for EL10 * Upadate dev container to use EL10 * Update CI to use EL10 * Update spec file for EL10 * Add `make rpm` target for building RPMs * Use `mktemp` for `make dist` to use devcontainer filesystem * Set default dhcpd and tftpd to dnsmasq for EL10 * Fix dnsmasq template tftp paths to use basename Signed-off-by: Timothy Middelkoop --- .devcontainer/devcontainer.json | 2 +- .github/workflows/release.yml | 16 ++++++++--- CHANGELOG.md | 11 ++++++++ Makefile | 27 +++++++++++++------ overlays/host/internal/host_test.go | 2 +- .../rootfs/etc/dnsmasq.d/ww4-hosts.conf.ww | 2 +- warewulf.spec.in | 16 ++++++++++- 7 files changed, 61 insertions(+), 15 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ccf2c591..38127da2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ { "name": "Warewulf Development", - "image": "registry.docker.com/library/rockylinux:9", + "image": "registry.docker.com/rockylinux/rockylinux:10", "remoteUser": "vscode", "onCreateCommand": "sudo dnf install -y dnf-utils && sudo dnf config-manager --set-enabled crb && sudo dnf install -y unzip cpio gpgme-devel python3-sphinx python3-sphinx_rtd_theme", "features": { diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 539d734d..bd3c861c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,7 @@ jobs: outputs: has-recent-commits: ${{ steps.commits.outputs.has-recent-commits }} commits: ${{ steps.commits.outputs.commits }} + version: ${{ steps.version.outputs.version }} steps: - name: Checkout Code @@ -43,6 +44,13 @@ jobs: run: | make warewulf.spec dist + - name: Get build version + id: version + run: | + VERSION=$(make version) + echo "version=${VERSION}" >> $GITHUB_OUTPUT + echo "Version: ${VERSION}" + - name: Upload spec uses: actions/upload-artifact@v4 with: @@ -65,18 +73,20 @@ jobs: name: Build RPMs runs-on: ${{ matrix.runs-on }} container: - image: rockylinux/rockylinux:9 + image: rockylinux/rockylinux:10 options: --privileged strategy: fail-fast: false matrix: arch: [x86_64, aarch64] - dist: [el9, el8, suse.lp155] + dist: [el10, el9, el8, suse.lp155] include: - dist: el8 target: rocky+epel-8 - dist: el9 target: rocky+epel-9 + - dist: el10 + target: rocky+epel-10 - dist: suse.lp155 target: opensuse-leap-15.5 - arch: x86_64 @@ -110,7 +120,7 @@ jobs: root="${eol_root}" fi mock --root="${root}" --rebuild --spec=warewulf.spec --sources=. \ - && mock --root="${root}" --chroot -- bash -c "make -C /builddir/build/BUILD/warewulf-*/ test" + && mock --root="${root}" --chroot -- bash -c "make -C /builddir/build/BUILD/warewulf-${{ needs.dist.outputs.version }} test" - name: Upload RPMs uses: actions/upload-artifact@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index edc125cf..f3d5f126 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## Unreleased + +### Added +- Build support for EL10, EL10 depends on `dnsmasq` and no longer `dhcpd-server` (EOL). #1974 +- `make rpm` added for local development rpm builds. #1974 + +### Changed +- `make dist` now uses `mktemp` instead of `.dist`. #1974 +- Fixed dnsmasq template file to use basename for ipxe files. #1974 +- For EL10 default to dnsmasq for dhcpd and tftp. #1974 + ## v4.6.3, 2025-08-01 ### Added diff --git a/Makefile b/Makefile index 8837ffe4..7c763efc 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,10 @@ include Tools.mk ##@ Build +.PHONY: version +version: ## Build version + @echo $(VERSION) + .PHONY: build build: wwctl wwclient etc/bash_completion.d/wwctl ## Build the Warewulf binaries @@ -28,14 +32,21 @@ spec: warewulf.spec ## Create an RPM spec file .PHONY: dist dist: $(config) ## Create a distributable source tarball - rm -rf .dist/ - mkdir -p .dist/$(WAREWULF)-$(VERSION) - git ls-files >.dist/dist-files - tar -c --files-from .dist/dist-files | tar -C .dist/$(WAREWULF)-$(VERSION) -x - test -d vendor/ && cp -a vendor/ .dist/$(WAREWULF)-$(VERSION) || : - scripts/get-version.sh >.dist/$(WAREWULF)-$(VERSION)/VERSION - tar -C .dist -czf $(WAREWULF)-$(VERSION).tar.gz $(WAREWULF)-$(VERSION) - rm -rf .dist/ + $(eval TMPDIR := $(shell mktemp -d)) + mkdir -p $(TMPDIR)/$(WAREWULF)-$(VERSION) + git ls-files >$(TMPDIR)/dist-files + tar -c --files-from $(TMPDIR)/dist-files | tar -C $(TMPDIR)/$(WAREWULF)-$(VERSION) -x + test -d vendor/ && cp -a vendor/ $(TMPDIR)/$(WAREWULF)-$(VERSION) || : + scripts/get-version.sh >$(TMPDIR)/$(WAREWULF)-$(VERSION)/VERSION + tar -C $(TMPDIR) -czf $(WAREWULF)-$(VERSION).tar.gz $(WAREWULF)-$(VERSION) + rm -rf $(TMPDIR) + +RPMDIR = $(HOME)/rpmbuild +.PHONY: rpm +rpm: spec dist ## Create an RPM package + @mkdir -p $(RPMDIR)/{BUILD,RPMS,SOURCES,SPECS,SRPMS} + cp $(WAREWULF)-$(VERSION).tar.gz $(RPMDIR)/SOURCES/ + rpmbuild -bb warewulf.spec config = include/systemd/warewulfd.service \ internal/pkg/config/buildconfig.go \ diff --git a/overlays/host/internal/host_test.go b/overlays/host/internal/host_test.go index 6556a176..273fd5d4 100644 --- a/overlays/host/internal/host_test.go +++ b/overlays/host/internal/host_test.go @@ -260,7 +260,7 @@ dhcp-option-force=tag:efi-http,60,HTTPClient # for http boot always use shim/grub dhcp-boot=tag:efi-http,"http://192.168.0.1:9873/efiboot/shim.efi" dhcp-boot=tag:x86PC,"/warewulf/ipxe-snponly-x86_64.efi" -dhcp-boot=tag:aarch64,"/warewulf/arm64-efi/snponly.efi" +dhcp-boot=tag:aarch64,"/warewulf/snponly.efi" # iPXE binary will get the following configuration file dhcp-boot=tag:iPXE,"http://192.168.0.1:9873/ipxe/${mac:hexhyp}?assetkey=${asset}&uuid=${uuid}" dhcp-no-override diff --git a/overlays/host/rootfs/etc/dnsmasq.d/ww4-hosts.conf.ww b/overlays/host/rootfs/etc/dnsmasq.d/ww4-hosts.conf.ww index 93295daf..5b6715ae 100644 --- a/overlays/host/rootfs/etc/dnsmasq.d/ww4-hosts.conf.ww +++ b/overlays/host/rootfs/etc/dnsmasq.d/ww4-hosts.conf.ww @@ -19,7 +19,7 @@ dhcp-boot=tag:x86PC,"warewulf/shim.efi" dhcp-boot=tag:x86PC,"/warewulf/{{ index $.Tftp.IpxeBinaries "00:07" }}" {{- end }} {{- with (index $.Tftp.IpxeBinaries "00:0B" ) }} -dhcp-boot=tag:aarch64,"/warewulf/{{ index $.Tftp.IpxeBinaries "00:0B" }}" +dhcp-boot=tag:aarch64,"/warewulf/{{ index $.Tftp.IpxeBinaries "00:0B" | basename }}" {{- end }} {{- end }} # iPXE binary will get the following configuration file diff --git a/warewulf.spec.in b/warewulf.spec.in index f9c26fe4..7871ca8b 100644 --- a/warewulf.spec.in +++ b/warewulf.spec.in @@ -50,7 +50,9 @@ BuildRequires: system-release BuildRequires: systemd BuildRequires: golang >= 1.16 BuildRequires: firewalld-filesystem +%if ! (0%{?rhel} >= 10) Requires: tftp-server +%endif Requires: nfs-utils %if 0%{?rhel} < 8 Requires: ipxe-bootimgs @@ -60,12 +62,16 @@ Requires: ipxe-bootimgs-aarch64 %endif %endif +%if 0%{?rhel} >= 10 +Requires: dnsmasq +%else %if 0%{?rhel} >= 8 || 0%{?suse_version} || 0%{?fedora} Requires: dhcp-server %else -# rhel < 8 +# rhel < 8 and others Requires: dhcp %endif +%endif BuildRequires: git BuildRequires: make @@ -116,6 +122,14 @@ export NO_BRP_STALE_LINK_ERROR=yes make install \ DESTDIR=%{buildroot} +%if 0%{?rhel} >= 10 +sed -i ' + s/systemd name: dhcpd/systemd name: dnsmasq/ + s/systemd name: tftp/systemd name: dnsmasq/ + /- dsa/d' \ + -i %{buildroot}%{_sysconfdir}/warewulf/warewulf.conf +%endif + %if 0%{?suse_version} || 0%{?sle_version} yq e ' .tftp.ipxe."00:00" = "undionly.kpxe" |