Browse Source

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 <noreply@anthropic.com>
feat/base-partitioning-to-local
Nicolas Massé 1 month ago
parent
commit
e78aa71752
  1. 1
      .gitignore
  2. 15
      cookbooks/base/overlay.bu
  3. 16
      local.bu.template
  4. 3
      scripts/common.mk

1
.gitignore

@ -2,6 +2,7 @@
*.ign *.ign
!fcos.bu !fcos.bu
!overlay.bu !overlay.bu
!overlay-examples.bu
__pycache__/ __pycache__/
.pytest_cache/ .pytest_cache/
**/build/*.tar.gz **/build/*.tar.gz

15
cookbooks/base/overlay.bu

@ -1,21 +1,6 @@
variant: fcos variant: fcos
version: 1.4.0 version: 1.4.0
storage: 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: directories:
- path: /var/lib/private/sshd - path: /var/lib/private/sshd
mode: 0700 mode: 0700

16
local.bu.template

@ -1,5 +1,21 @@
variant: fcos variant: fcos
version: 1.4.0 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: passwd:
users: users:
- name: john - name: john

3
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; \ $(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)"; \ (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; \ 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"; \ 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)"; \ (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 fi
.PHONY: build/$(PROJECT_NAME).bu build/$(PROJECT_NAME)-examples.bu .PHONY: build/$(PROJECT_NAME).bu build/$(PROJECT_NAME)-examples.bu

Loading…
Cancel
Save