From e07efeee4ceb78ff21e2c6a08481b424faa3a324 Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Thu, 30 Oct 2025 11:13:19 -0600 Subject: [PATCH] New architecture-specific wwclient overlays Signed-off-by: Jonathon Anderson --- CHANGELOG.md | 5 +++++ Makefile | 31 +++++++++++++++++++++++-------- overlays/debian.interfaces | 1 - userdocs/images/images.rst | 16 ++++------------ userdocs/overlays/overlays.rst | 13 ++++++++++--- warewulf.spec.in | 2 ++ 6 files changed, 44 insertions(+), 24 deletions(-) delete mode 120000 overlays/debian.interfaces diff --git a/CHANGELOG.md b/CHANGELOG.md index af644df3..2377b60a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## v4.6.5, unreleased +### Added + +- `wwclient.aarch64` overlay always provides an aarch64 wwclient executable. +- `wwclient.x86_64` overlay always provides an x86_64 wwclient executable. + ### Changed - Renamed debian.interfaces overlay to ifupdown diff --git a/Makefile b/Makefile index 01193712..b7c54214 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,10 @@ include Tools.mk version: ## Build version @echo $(VERSION) +WWCLIENTS = wwclient wwclient.x86_64 wwclient.aarch64 + .PHONY: build -build: wwctl wwclient etc/bash_completion.d/wwctl ## Build the Warewulf binaries +build: wwctl $(WWCLIENTS) etc/bash_completion.d/wwctl ## Build the Warewulf binaries .PHONY: docs docs: man_pages reference ## Build the documentation @@ -63,7 +65,13 @@ wwctl: $(config) $(call godeps,cmd/wwctl/main.go) GOOS=linux go build -mod vendor -tags "$(WW_GO_BUILD_TAGS)" -o wwctl cmd/wwctl/main.go wwclient: $(config) $(call godeps,cmd/wwclient/main.go) - CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -ldflags "-extldflags -static" -o wwclient cmd/wwclient/main.go + CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -ldflags "-extldflags -static -s -w" -o wwclient cmd/wwclient/main.go + +wwclient.x86_64: $(config) $(call godeps,cmd/wwclient/main.go) + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod vendor -a -ldflags "-extldflags -static -s -w" -o wwclient.x86_64 cmd/wwclient/main.go + +wwclient.aarch64: $(config) $(call godeps,cmd/wwclient/main.go) + CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -mod vendor -a -ldflags "-extldflags -static -s -w" -o wwclient.aarch64 cmd/wwclient/main.go .PHONY: man_pages man_pages: wwctl $(wildcard docs/man/man5/*.5) @@ -155,7 +163,7 @@ cleanmake: .PHONY: cleanbin cleanbin: - rm -f wwclient + rm -f $(WWCLIENTS) rm -f wwctl rm -f update_configuration @@ -181,7 +189,6 @@ install: build docs ## Install Warewulf from source install -d -m 0755 $(DESTDIR)$(WWCHROOTDIR) install -d -m 0755 $(DESTDIR)$(WWOVERLAYDIR) install -d -m 0755 $(DESTDIR)$(WWPROVISIONDIR) - install -d -m 0755 $(DESTDIR)$(DATADIR)/warewulf/overlays/wwclient/rootfs/$(WWCLIENTDIR) install -d -m 0755 $(DESTDIR)$(DATADIR)/warewulf/overlays/host/rootfs/$(TFTPDIR)/warewulf/ install -d -m 0755 $(DESTDIR)$(WWCONFIGDIR)/examples install -d -m 0755 $(DESTDIR)$(WWCONFIGDIR)/ipxe @@ -216,11 +223,7 @@ install: build docs ## Install Warewulf from source chmod 0644 $(DESTDIR)$(DATADIR)/warewulf/overlays/ssh.host_keys/rootfs/etc/ssh/ssh*.pub.ww chmod 0600 $(DESTDIR)$(DATADIR)/warewulf/overlays/NetworkManager/rootfs/etc/NetworkManager/system-connections/ww4-managed.ww chmod 0750 $(DESTDIR)$(DATADIR)/warewulf/overlays/host/rootfs - rm -rf $(DESTDIR)$(DATADIR)/warewulf/overlays/debian.interfaces # replacing symlink with a copy - install -d -m 755 $(DESTDIR)$(DATADIR)/warewulf/overlays/debian.interfaces - cp -a $(DESTDIR)$(DATADIR)/warewulf/overlays/ifupdown/* $(DESTDIR)$(DATADIR)/warewulf/overlays/debian.interfaces/ install -m 0755 wwctl $(DESTDIR)$(BINDIR) - install -m 0755 wwclient $(DESTDIR)$(DATADIR)/warewulf/overlays/wwclient/rootfs/$(WWCLIENTDIR)/wwclient install -m 0644 include/firewalld/warewulf.xml $(DESTDIR)$(FIREWALLDDIR) install -m 0644 include/systemd/warewulfd.service $(DESTDIR)$(SYSTEMDDIR) install -m 0644 LICENSE.md $(DESTDIR)$(WWDOCDIR) @@ -230,6 +233,16 @@ install: build docs ## Install Warewulf from source install -pd -m 0755 $(DESTDIR)$(DRACUTMODDIR)/90wwinit install -m 0644 dracut/modules.d/90wwinit/*.sh dracut/modules.d/90wwinit/*.override $(DESTDIR)$(DRACUTMODDIR)/90wwinit + # copy ifupdown to debian.interfaces for backwards compatibility with previous name + cp -a $(DESTDIR)$(DATADIR)/warewulf/overlays/ifupdown $(DESTDIR)$(DATADIR)/warewulf/overlays/debian.interfaces + + install -d -m 0755 $(DESTDIR)$(DATADIR)/warewulf/overlays/wwclient/rootfs/$(WWCLIENTDIR) + cp -a $(DESTDIR)$(DATADIR)/warewulf/overlays/wwclient $(DESTDIR)$(DATADIR)/warewulf/overlays/wwclient.aarch64 + cp -a $(DESTDIR)$(DATADIR)/warewulf/overlays/wwclient $(DESTDIR)$(DATADIR)/warewulf/overlays/wwclient.x86_64 + install -m 0755 wwclient $(DESTDIR)$(DATADIR)/warewulf/overlays/wwclient/rootfs/$(WWCLIENTDIR)/wwclient + install -m 0755 wwclient.x86_64 $(DESTDIR)$(DATADIR)/warewulf/overlays/wwclient.x86_64/rootfs/$(WWCLIENTDIR)/wwclient + install -m 0755 wwclient.aarch64 $(DESTDIR)$(DATADIR)/warewulf/overlays/wwclient.aarch64/rootfs/$(WWCLIENTDIR)/wwclient + .PHONY: install-sos install-sos: install -D -m 0644 include/sos/warewulf.py $(DESTDIR)$(SOSPLUGINS)/warewulf.py @@ -243,6 +256,8 @@ init: ifndef OFFLINE_BUILD wwctl: vendor wwclient: vendor +wwclient.x86_64: vendor +wwclient.aarch64: vendor update_configuration: vendor dist: vendor diff --git a/overlays/debian.interfaces b/overlays/debian.interfaces deleted file mode 120000 index f7d5e9f4..00000000 --- a/overlays/debian.interfaces +++ /dev/null @@ -1 +0,0 @@ -ifupdown \ No newline at end of file diff --git a/userdocs/images/images.rst b/userdocs/images/images.rst index 3cdab56d..7476b831 100644 --- a/userdocs/images/images.rst +++ b/userdocs/images/images.rst @@ -443,19 +443,11 @@ Then, ``wwctl image exec`` will work regardless of the architecture of the image. For more information about QEMU, see their `GitHub `_ -To use wwclient on a booted image using a different architecture, wwclient must -be compiled for the specific architecture. This requires GOLang build tools 1.21 -or newer. Below is an example for building wwclient for arm64: +.. note:: -.. code-block:: console - - # git clone https://github.com/warewulf/warewulf - # cd warewulf - # GOARCH=arm64 PREFIX=/ make wwclient - # mkdir -p /var/lib/warewulf/overlays/wwclient_arm64/rootfs/warewulf - # cp wwclient /var/lib/warewulf/overlays/wwclient_arm64/rootfs/warewulf - -Then, apply the new "wwclient_arm64" system overlay to your arm64 node/profile + When provisioning cluster nodes with a different architecture than the + Warewulf server, also use the matching architecture-specific :ref:`wwclient` + overlay: e.g., wwclient.x86_64 or wwclient.aarch64. Read-only images ================ diff --git a/userdocs/overlays/overlays.rst b/userdocs/overlays/overlays.rst index 00ea62ef..a12c48e0 100644 --- a/userdocs/overlays/overlays.rst +++ b/userdocs/overlays/overlays.rst @@ -202,6 +202,8 @@ provisioning actions: - **/warewulf/init.d/:** executed in the final root file system but before calling ``init``. +.. _wwclient: + wwclient -------- @@ -209,9 +211,14 @@ All configured overlays are provisioned initially along with the node image itself; but **wwclient** periodically fetches and applies the runtime overlay to allow configuration of some settings without a reboot. -wwclient will contat the ``ipaddr`` value from ``warewulf.conf`` by default. -This can be overridden by specifying a ``WW_IPADDR`` environment variable, which -can be set via an overlay in ``/etc/default/wwclient``. +wwclient contacts the ``ipaddr`` value from ``warewulf.conf`` by default. This +can be overridden by specifying a ``WW_IPADDR`` environment variable, which can +be set via an overlay in ``/etc/default/wwclient``. + +The default wwclient overlay contains a ``wwclient`` executable compiled for the +same architecture as the Warewulf server. Architecture-specific wwclient.aarch64 +and wwclient.x86_64 overlays are available as well. This supports using wwclient +on cluster nodes with a different architecture than the Warewulf server. Network interfaces ------------------ diff --git a/warewulf.spec.in b/warewulf.spec.in index 415b1044..fa17c36f 100644 --- a/warewulf.spec.in +++ b/warewulf.spec.in @@ -210,6 +210,8 @@ getent group %{wwgroup} >/dev/null || groupadd -r %{wwgroup} %{_overlaydir}/udev.netname/rootfs/* %{_overlaydir}/wicked/rootfs/* %{_overlaydir}/wwclient/rootfs/* +%{_overlaydir}/wwclient.x86_64/rootfs/* +%{_overlaydir}/wwclient.aarch64/rootfs/* %{_overlaydir}/wwinit/rootfs/* %{_overlaydir}/localtime/rootfs/* %{_overlaydir}/sfdisk/rootfs/*