testsAndMisc/linux_configuration/fixes
Krzysztof kuhy Rudnicki 782a6320af
Some checks are pending
Pre-commit checks / pre-commit (push) Waiting to run
Shell tests / shell-tests (push) Waiting to run
Shell tests / arch-tests (push) Waiting to run
Let --rollback work on a freshly installed machine
The previous commit made hosts-blocker's install.sh register the guard-lib
instances itself, which is what finally gives a fresh machine real hosts
enforcement. It also created a class of machine that --rollback refused to
touch: the state dir it demanded, /var/lib/guard-lib-migration, is written by
the one-shot migration, and a machine that never had a legacy layer has no
such state. So --rollback exited 1 while the instances it exists to remove
were live -- every freshly installed machine had no escape hatch at all.

Rollback now proceeds whenever a guard-lib instance is registered, says
plainly that there is no legacy layer to restore, and still refuses when
there is genuinely nothing to roll back.

The second half is worse and was only visible by running it. The existing
re-assertion of chattr +i works by starting hosts-guard.service and
hosts-bind-mount.service, neither of which exists on a fresh machine, so
every systemctl cat skipped and the rollback finished with /etc/hosts holding
no immutable flag and no bind mount -- less protected than before it ran.
It now re-asserts immutability directly when no legacy unit did it.

Verified in a pristine vmbox guest whose guards came from
install_core_system.sh --all: dry-run and real rollback both exit 0, the
three instances are uninstalled, shutdown-schedule (a different feature) is
untouched, and /etc/hosts keeps ----i----------------- and all 178410 lines.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJrqKERAo5QUeEHWS5Asgp
2026-08-24 12:57:24 +02:00
..
lib Let --rollback work on a freshly installed machine 2026-08-24 12:57:24 +02:00
diagnose_arch_performance.sh Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
diagnose_pacman_hook_stall.sh Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
fix_anki.sh Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
fix_arch_performance.sh Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
fix_bluetooth.sh Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
fix_controller.sh Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
fix_flutter_git_env.sh Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
fix_stepmania.sh Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
fix_systemctl.sh Flatten i3-configuration and misc/testsAndMisc-bash 2026-08-23 19:02:18 +02:00
fix_thorium.sh Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
fix_ubuntu_performance.sh Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
fix_virtualbox.sh Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
fix_waifu2x.sh Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
fix_yay_aur_database.sh Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
migrate_hosts_guard_to_guard_lib.sh Extract the hosts blocker into its own repo 2026-08-23 20:30:18 +02:00
nvidia_troubleshoot.sh Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
optimize_arch_desktop.sh Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00