testsAndMisc/docs/superpowers/contracts/swap-switch-stale-grub-cfg-2026-11-27.json
Krzysztof kuhy Rudnicki 652638e920
Some checks are pending
md-naming / markdown naming convention (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (mypy, mypy) (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (pylint, pylint) (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (rest, ) (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (shellcheck, shellcheck) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Shell tests / shell-tests (push) Waiting to run
Shell tests / lib-tests (push) Waiting to run
Shell tests / arch-tests (push) Waiting to run
Rebuild stale grub.cfg in swap setup scripts
setup_zram.sh/setup_zswap.sh ran grub-mkconfig only when /etc/default/grub
changed, so a run cut off between the two writes left grub.cfg booting the
old setup and every rerun exited 0 (zswap Y plus zram0 after a reboot).
Now grub.cfg is rebuilt whenever a linux line lacks the exact target zswap
words, and the scripts exit 1 before any live change when grub.cfg is still
wrong after the rebuild or a loader entry has no options line carrying them.
vmbox guest zc3: stale-zram, stale-zswap, again and noopts phases all OK.
Prunes the oldest contract (g29, 2026-09-14) to stay at the 60-file cap.

Bug-class-check: fixes/lib/tests/test_swap_switch.sh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 14:10:34 +01:00

15 lines
1.2 KiB
JSON

{
"title": "setup_zram/setup_zswap repair a stale grub.cfg and fail loudly when the next boot cannot match",
"objective": "A rerun of either swap setup script heals a run cut off between the /etc/default/grub write and grub-mkconfig, stays byte-identical when everything already matches, and exits 1 before touching live swap when grub.cfg or a systemd-boot entry still would not boot the target zswap words.",
"acceptance_criteria": [
"GRUB defaults on the target, grub.cfg on the old setup: the target's script exits 0 and every grub.cfg linux line carries exactly the target zswap words; the next boot runs the target only",
"grub.cfg already matching: no grub-mkconfig run, boot files and grub.cfg mtime unchanged, nothing reported as changed",
"grub.cfg still wrong after the rebuild, or a loader entry with no options line carrying the words: exit 1 naming the line or entry, no swapoff, zswap enabled unchanged"
],
"out_of_scope": [
"The host (systemd-boot, no derived file): no host runs or reboots",
"Rewriting the host's sysctl comment"
],
"verifier": "bash linux_configuration/fixes/lib/tests/test_swap_switch.sh; vmbox_swap.sh stale-zram|stale-zswap|again|noopts in a fresh BIOS/GRUB guest; pre-commit run --files <changed-files>"
}