From 9f62328988e83413eb819ac1ab2021a414188a67 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 26 Apr 2026 19:23:15 -0500 Subject: refactor: extract EFI_DIR constant for the install-time EFI mount point MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The literal /mnt/efi appeared at 17 sites across installer/archangel and installer/lib/btrfs.sh. Renaming it (or pointing tests at a different mount) meant touching every site and risking incomplete sweeps. One canonical name in installer/lib/common.sh now backs every reference. EFI_DIR has no trailing slash so the three expansion patterns in the codebase compose cleanly. Bare ($EFI_DIR), sub-path ($EFI_DIR/EFI/ZBM), and the index-suffix used by install_grub_all_efi for secondary EFI mounts (${EFI_DIR}${i}). The sync_efi_partitions staging path also moves from the literal /mnt/efi_sync to ${EFI_DIR}_sync, so it follows EFI_DIR if anyone ever changes the base. Two follow-ups filed as separate :techdebt: items. MNTPOINT=/mnt extraction across the 50+ /mnt/... sites (pacstrap, arch-chroot, fstab writes), and the related /mnt${chroot_efi_dir} composition pattern at btrfs.sh:681-682. Both ship together when MNTPOINT lands. Verified: bats 134 → 135 (+1 pinning EFI_DIR=/mnt/efi). Lint clean. All four expansion patterns smoke-tested at runtime and produce the original literal byte-for-byte. VM run skipped, pure constant substitution with zero behavior change. --- tests/unit/test_common.bats | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/unit/test_common.bats b/tests/unit/test_common.bats index 0bb76a1..4d58bd9 100644 --- a/tests/unit/test_common.bats +++ b/tests/unit/test_common.bats @@ -324,3 +324,11 @@ Boot0001* ZFSBootMenu" [ "$status" -eq 1 ] [ -z "$output" ] } + +############################# +# Path constants +############################# + +@test "EFI_DIR is defined and equals /mnt/efi" { + [ "$EFI_DIR" = "/mnt/efi" ] +} -- cgit v1.2.3