testsAndMisc/linux_configuration
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
..
.githooks Extract digital-wellbeing; the directory-depth cap now enforces 2026-08-23 20:57:51 +02:00
.github Prettier-normalize two docs the pre-push hook was already failing on 2026-08-23 19:42:18 +02:00
boot_recovery Cap extensionless scripts, and split the one that was hiding 2026-08-23 19:13:40 +02:00
C/atop_agg atop_agg: split atop_agg.c 478 -> 204 + state + emit 2026-08-17 10:49:46 +02:00
diagnostics Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
docs Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
dwm Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
features Extract the hosts blocker into its own repo 2026-08-23 20:30:18 +02:00
feedback-appimage Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
fixes Let --rollback work on a freshly installed machine 2026-08-24 12:57:24 +02:00
fresh-install Extract digital-wellbeing; the directory-depth cap now enforces 2026-08-23 20:57:51 +02:00
gaming Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
i3 Flatten i3-configuration and misc/testsAndMisc-bash 2026-08-23 19:02:18 +02:00
i3blocks Flatten i3-configuration and misc/testsAndMisc-bash 2026-08-23 19:02:18 +02:00
installers Extract digital-wellbeing; the directory-depth cap now enforces 2026-08-23 20:57:51 +02:00
lib Make install_core_system.sh work on a fresh machine 2026-08-24 12:45:21 +02:00
meta Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
misc Flatten i3-configuration and misc/testsAndMisc-bash 2026-08-23 19:02:18 +02:00
periodic_background Extract digital-wellbeing; the directory-depth cap now enforces 2026-08-23 20:57:51 +02:00
tests Make install_core_system.sh work on a fresh machine 2026-08-24 12:45:21 +02:00
utils Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
zsh Split calc-live.zsh: extract the qalc coprocess 2026-08-16 22:12:32 +02:00
.gitignore Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
install_core_system.sh Make install_core_system.sh work on a fresh machine 2026-08-24 12:45:21 +02:00
test_results.log Add 'linux_configuration/' from commit '0762e3d07b90bac9256eb272de10bf9f42878094' 2026-02-06 21:43:26 +01:00