Prevent ignition from running twice in a provision-to-disk configuration

Ignition runs during provision-to-disk, and then also tries to run again during
sytsemd. This commit adds a sentinel file during the initial provision-to-disk
that is detected by systemd to prevent re-running ignition partitioning /
formatting.

- Fixes: #1981

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2026-01-06 16:22:44 -07:00
parent 1a05ff406f
commit 2355fce629
4 changed files with 18 additions and 3 deletions

View File

@@ -46,3 +46,11 @@ info "warewulf: mounting ${wwinit_root_device} at ${NEWROOT}"
for stage in "image" "system" "runtime"; do
get_stage "${stage}"
done
# Copy /warewulf/run from initramfs to NEWROOT
# This preserves state files created by wwinit.d scripts (e.g., ignition marker)
if [ -d /tmp/wwinit/warewulf/run ]; then
info "warewulf: preserving /warewulf/run to mounted root"
mkdir -p "${NEWROOT}/warewulf"
cp -a /tmp/wwinit/warewulf/run "${NEWROOT}/warewulf/"
fi