New architecture-specific wwclient overlays

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2025-10-30 11:13:19 -06:00
parent 80f6f15a13
commit e07efeee4c
6 changed files with 44 additions and 24 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -1 +0,0 @@
ifupdown

View File

@@ -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
<https://github.com/multiarch/qemu-user-static>`_
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
================

View File

@@ -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
------------------

View File

@@ -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/*