diff options
| author | Craig Jennings <c@cjennings.net> | 2026-04-27 13:00:26 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-04-27 13:00:26 -0500 |
| commit | 26f3f823ac17940a1b0153619f6140f45d856e33 (patch) | |
| tree | bdb02b6fc0c110ce6e59ffd379521068a446c45a /testing-strategy.org | |
| parent | 8c69aaaff13da3b7d1d24ed34975e8c5b30409e6 (diff) | |
| download | archangel-26f3f823ac17940a1b0153619f6140f45d856e33.tar.gz archangel-26f3f823ac17940a1b0153619f6140f45d856e33.zip | |
refactor: verify GRUB_CMDLINE_LINUX seds via prepend_grub_cmdline_linux helper
Audited the ~10 silent sed -i sites in the installer against the verification-after pattern that landed for sshd_config last session. Triaged each by failure mode.
The two GRUB_CMDLINE_LINUX seds in lib/btrfs.sh have a real silent-failure risk. If /etc/default/grub is missing or malformed and the sed pattern doesn't match, nothing happens. The kernel boots without cryptdevice=. The system can't unlock LUKS at boot. Added prepend_grub_cmdline_linux to lib/common.sh. Same shape as enable_sshd_root_login (sed, then grep, then error if the line wasn't modified). Replaced the two inline seds with helper calls.
The HOOKS= seds in installer/archangel and lib/btrfs.sh (six total) don't need verification. A missing HOOKS= line makes mkinitcpio -P fail loudly downstream, so silent-replace failure can't reach a booted system. Added a one-line audit-rationale comment at each of the three locations so the next reader doesn't re-litigate the decision.
The FILES= sed at lib/btrfs.sh:213 already self-heals via a sed-then-grep-then-append pattern, so no behavior change there. Filed a separate follow-up to lift that pattern into a named helper for clarity.
Bats: 142 → 146. Four new tests in test_common.bats cover normal (empty cmdline, existing cmdline preserved, other lines preserved) and error (missing GRUB_CMDLINE_LINUX line). Lint clean.
Diffstat (limited to 'testing-strategy.org')
| -rw-r--r-- | testing-strategy.org | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/testing-strategy.org b/testing-strategy.org index b008cc1..6078631 100644 --- a/testing-strategy.org +++ b/testing-strategy.org @@ -61,7 +61,7 @@ Current coverage lives in =tests/unit/=: | File | What it covers | |------+----------------| -| =test_common.bats= | =command_exists=, =require_command=, =info=/=warn=/=error=, =enable_color=, =log=, =prompt_password=, =pacstrap_packages=, =install_dropin= | +| =test_common.bats= | =command_exists=, =require_command=, =info=/=warn=/=error=, =enable_color=, =log=, =prompt_password=, =pacstrap_packages=, =install_dropin=, =parse_efibootmgr_*=, =EFI_DIR=, =enable_sshd_root_login=, =prepend_grub_cmdline_linux= | | =test_config.bats= | =parse_args=, =load_config=, =validate_config=, =validate_filesystem=, =check_config=, default values pinned in config.sh | | =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=, =partition_disks= (orchestration shape) | |
