From e78aa71752dc25e213aea3da50da93d8530a28bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Tue, 22 Sep 2026 08:23:13 +0000 Subject: [PATCH] base: move /var disk partitioning from overlay.bu to local.bu The /dev/vdb -> /var partitioning in cookbooks/base/overlay.bu was merged into every project's main spec, so it ended up in the production/test ignition even though the second disk (var.qcow2) only exists in the libvirt dev/test VM. A real host should not have `base` blindly repartition /dev/vdb. Move it to local.bu / local.bu.template, which feeds local.ign and is merged into both fcos-dev.ign and fcos-test.ign but is never part of the shipped package. This restores partitioning for all VMs while keeping it out of production. Also add the overlay-examples.bu merge mechanism to scripts/common.mk (mirror of the existing overlay.bu merge) for future per-project example overlays, and whitelist overlay-examples.bu in .gitignore. Co-Authored-By: Claude Opus 4.8 --- .gitignore | 1 + cookbooks/base/overlay.bu | 15 --------------- local.bu.template | 16 ++++++++++++++++ scripts/common.mk | 3 ++- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index a107cdc..e185ed8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.ign !fcos.bu !overlay.bu +!overlay-examples.bu __pycache__/ .pytest_cache/ **/build/*.tar.gz diff --git a/cookbooks/base/overlay.bu b/cookbooks/base/overlay.bu index 80d42c1..2413f41 100644 --- a/cookbooks/base/overlay.bu +++ b/cookbooks/base/overlay.bu @@ -1,21 +1,6 @@ variant: fcos version: 1.4.0 storage: - disks: - - device: /dev/vdb - wipe_table: false - partitions: - # Specify the partition number so that FCOS do not try to create a new - # partition at each VM redeployment. - - number: 1 - size_mib: 0 - start_mib: 0 - label: var - filesystems: - - path: /var - device: /dev/disk/by-partlabel/var - format: xfs - with_mount_unit: true directories: - path: /var/lib/private/sshd mode: 0700 diff --git a/local.bu.template b/local.bu.template index a9cfa17..70da847 100644 --- a/local.bu.template +++ b/local.bu.template @@ -1,5 +1,21 @@ variant: fcos version: 1.4.0 +storage: + disks: + - device: /dev/vdb + wipe_table: false + partitions: + # Specify the partition number so that FCOS do not try to create a new + # partition at each VM redeployment. + - number: 1 + size_mib: 0 + start_mib: 0 + label: var + filesystems: + - path: /var + device: /dev/disk/by-partlabel/var + format: xfs + with_mount_unit: true passwd: users: - name: john diff --git a/scripts/common.mk b/scripts/common.mk index 89905fc..406b14a 100644 --- a/scripts/common.mk +++ b/scripts/common.mk @@ -451,8 +451,9 @@ build/$(PROJECT_NAME).tar.gz build/$(PROJECT_NAME).bu build/$(PROJECT_NAME)-exam $(SCRIPTS_DIR)/generate-tarball.sh build/$(PROJECT_NAME).tar.gz; \ (cat $(SCRIPTS_DIR)/butane.blocklist; echo; for file in $$(find "$$TARGET_CHROOT"); do echo "$${file#$$TARGET_CHROOT}"; done) | sort -u | grep -v -E '^$$' > "$(BUTANE_BLOCKLIST)"; \ run make install-examples; \ + EXAMPLES_YQ_FILES="$$(if [ -f "overlay-examples.bu" ]; then echo "- overlay-examples.bu"; else echo "-"; fi)"; \ echo "generate-butane-spec.sh build/$(PROJECT_NAME)-examples.bu"; \ - $(SCRIPTS_DIR)/generate-butane-spec.sh build/$(PROJECT_NAME)-examples.bu; \ + $(SCRIPTS_DIR)/generate-butane-spec.sh | yq eval-all '. as $$item ireduce ({}; . *+ $$item)' $$EXAMPLES_YQ_FILES > build/$(PROJECT_NAME)-examples.bu; \ (cat $(SCRIPTS_DIR)/butane.blocklist; echo; for file in $$(find "$$TARGET_CHROOT"); do echo "$${file#$$TARGET_CHROOT}"; done) | sort -u | grep -v -E '^$$' > "$(BUTANE_BLOCKLIST)"; \ fi .PHONY: build/$(PROJECT_NAME).bu build/$(PROJECT_NAME)-examples.bu