From f02ba03c12599bdd61b5208c9a65f458ae05aa15 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 26 Apr 2026 18:31:35 -0500 Subject: refactor: unify partition_disks across ZFS and Btrfs install paths The monolith's partition_disks() at installer/archangel was ZFS-only and silently shadowed lib/disk.sh:partition_disks(), which had been dead code since the Btrfs install path was added. install_btrfs was assembling partitioning manually via partition_disk (singular) plus a separate format_efi_partitions call. Two parallel implementations meant fixes had to land in two places and the lib version drifted with no visible warning. The unified partition_disks now lives in lib/disk.sh. It reads SELECTED_DISKS, dispatches the per-disk layout on FILESYSTEM (BF00 for ZFS, 8300 for Btrfs), populates EFI_PARTS + ROOT_PARTS, and formats each EFI partition with EFI0, EFI1, ... labels. Folded in two pre-existing divergences while consolidating. wipefs -af now runs on every disk, not just the ZFS path. The Btrfs path was missing this defense against non-GPT signatures (LVM, mdadm, ext) that sgdisk --zap-all alone won't touch. EFI labels standardized on EFI0, EFI1, ... across both paths. The lib version was producing asymmetric EFI / EFI2 labels. No consumer in the repo references the labels after format, so that change is cosmetic. ZFS_PARTS renamed to ROOT_PARTS for symmetry with get_root_partition. Deleted four orphaned helpers: format_efi, format_efi_partitions (only caller was the collapsed install_btrfs section), get_efi_partitions, get_root_partitions (test-only callers after install_btrfs simplified). Verified end to end: bats 134/134, make test-install passing 12/12 configs across both install paths. --- testing-strategy.org | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'testing-strategy.org') diff --git a/testing-strategy.org b/testing-strategy.org index 0f81a3a..cfc3953 100644 --- a/testing-strategy.org +++ b/testing-strategy.org @@ -64,9 +64,9 @@ Current coverage lives in =tests/unit/=: | =test_common.bats= | =command_exists=, =require_command=, =info=/=warn=/=error=, =enable_color=, =log=, =prompt_password=, =pacstrap_packages=, =install_dropin= | | =test_config.bats= | =parse_args=, =load_config=, =validate_config=, =check_config= | | =test_raid.bats= | =raid_valid_levels_for_count=, =raid_is_valid=, =raid_usable_bytes=, =raid_fault_tolerance= | -| =test_disk.bats= | =get_efi_partition=, =get_root_partition=, =get_efi_partitions=, =get_root_partitions= | +| =test_disk.bats= | =get_efi_partition=, =get_root_partition=, =partition_disks= (orchestration shape) | | =test_btrfs.bats= | =get_luks_devices= | -| =test_archangel.bats= | =gather_input= (unattended branch only) | +| =test_archangel.bats= | =gather_input= (unattended branch only), =install_failure_cleanup= (dispatch shape) | ** What bats does NOT cover (deliberately) @@ -79,7 +79,7 @@ The full list of deliberately-skipped tools and conditions: - *Filesystem creation*: =mkfs.fat=, =mkfs.btrfs=, =mkfs.ext4=, generic =mkfs= - *Encryption*: =cryptsetup= (LUKS), ZFS native encryption via =zfs create -O encryption= - *ZFS pool / dataset operations*: =zpool create=, =zpool import=, =zfs create=, =zfs snapshot=, =zfs rollback= -- *Partitioning*: =sgdisk=, =partprobe=, =blkid= +- *Partitioning*: =sgdisk=, =partprobe=, =blkid=, =wipefs= - *Bootstrap and chroot*: =pacstrap=, =arch-chroot=, =genfstab= - *Bootloader*: =grub-install=, =grub-mkconfig=, =efibootmgr= - *Snapshot management*: =snapper=, =zfs-pre-snapshot= -- cgit v1.2.3