SteamOS: keep the rollback's udev rule across OS updates (ext4 plan S1) #45

Manually merged
SkyfaR merged 3 commits from ext4-s1 into main 2026-10-07 07:31:33 +02:00
Owner

Since SteamOS 3.6 an OS update keeps only the /etc changes on Valve's keep list. The rollback's rule /etc/udev/rules.d/61-ogc-rollback-<uuid>.rules, which hides a half-converted drive from udisks and SteamOS's automounter while going back is unfinished, was not on it. An update during an unfinished rollback dropped it, and the automounter could mount the half-converted drive read-write.

  • The helper writes /etc/atomic-update.conf.d/opengamecompressor.conf (atomically, 0644) before the first rule, naming 61-ogc-rollback-*.rules and the older 99-ogc-rollback-*.rules; only on SteamOS (keep list present or ID/ID_LIKE steamos).
  • The drop-in stays while the helper is installed: Valve syncs /etc twice (at install and a catch-up at shutdown, rsync --delete without --delete-excluded); removing the drop-in with the last rule would leave a stale rule in the new slot (found in review, reproduced with Valve's rsync options). install-helper.sh --uninstall removes it only when no rule is left and no update waits for the restart.
  • If the drop-in cannot be written, no rule is written and the rollback stops before btrfs-convert -r.
  • VM test: the rollback scenario emulates both of Valve's sync passes on a SteamOS-like guest, with a control copy without the drop-in.

Checked against evlaV/steamos-customizations (keep list at 48ff4f26). Not yet tested on real SteamOS hardware.

Since SteamOS 3.6 an OS update keeps only the `/etc` changes on Valve's keep list. The rollback's rule `/etc/udev/rules.d/61-ogc-rollback-<uuid>.rules`, which hides a half-converted drive from udisks and SteamOS's automounter while going back is unfinished, was not on it. An update during an unfinished rollback dropped it, and the automounter could mount the half-converted drive read-write. - The helper writes `/etc/atomic-update.conf.d/opengamecompressor.conf` (atomically, 0644) before the first rule, naming `61-ogc-rollback-*.rules` and the older `99-ogc-rollback-*.rules`; only on SteamOS (keep list present or `ID`/`ID_LIKE` steamos). - The drop-in stays while the helper is installed: Valve syncs `/etc` twice (at install and a catch-up at shutdown, rsync `--delete` without `--delete-excluded`); removing the drop-in with the last rule would leave a stale rule in the new slot (found in review, reproduced with Valve's rsync options). `install-helper.sh --uninstall` removes it only when no rule is left and no update waits for the restart. - If the drop-in cannot be written, no rule is written and the rollback stops before `btrfs-convert -r`. - VM test: the `rollback` scenario emulates both of Valve's sync passes on a SteamOS-like guest, with a control copy without the drop-in. Checked against evlaV/steamos-customizations (keep list at 48ff4f26). Not yet tested on real SteamOS hardware.
Since SteamOS 3.6 an OS update keeps only those changes to /etc that
Valve's keep list or a drop-in in /etc/atomic-update.conf.d names. The
rule in /etc/udev/rules.d that keeps a drive hidden while it goes back
to its old filesystem was not on it, so an update while going back was
unfinished took the rule, and SteamOS's automounter could then mount the
half-finished drive read-write.

Where the system is SteamOS (Valve's keep list, or steamos as ID or in
ID_LIKE of os-release), the helper now writes the drop-in
opengamecompressor.conf naming the rollback rules before it writes the
first one, and removes it with the last. A rule that cannot be written
leaves no drop-in, and no rule is written where the drop-in cannot be.
The commands printed for a drive formatted meanwhile name the drop-in
when only that rule needs it, and install-helper.sh --uninstall removes
it unless a rule is still there.

/etc/fstab stays off the list: keeping it would hide Valve's later
changes to it.

Tests: unit tests on a made-up root (detection, the drop-in's patterns
matched as rsync does against Valve's list, writing, removal), the bundle
check of the uninstall, and the VM rollback scenario, whose guest looks
like SteamOS from the second cut-short run on and checks with an
emulation of holo-sync-var's /etc copy that an update keeps the rule,
and only because of the drop-in.
A SteamOS update copies /etc twice: when it is installed (holo-sync-var
all, into an empty folder) and again at shutdown (catchup, over that
copy). rsync deletes there only what the list includes. The drop-in went
with the last rule, so a rollback that finished or was given up between
the two copies left its rule in the /etc booted next, now protected by
the catch-all exclude: the drive, back on its old filesystem, stayed
hidden from udisks and SteamOS's automounter until the next update, with
no record left to clear it.

The drop-in now stays while the helper is installed; it names only the
helper's own rules and does nothing without them, and with it the
shutdown copy removes a rule gone from /etc. install-helper.sh
--uninstall still removes it once no rule is left. The commands printed
for a drive formatted meanwhile name only the rule again.

Tests: the helper's unit test expects the drop-in to stay after the last
rule; the VM rollback scenario emulates the shutdown copy over what the
first left, once the rule is gone, and expects the rule removed there,
and kept by a copy without the drop-in.
Keep the keep-list drop-in on uninstall while an OS update waits for the restart
All checks were successful
CI / Windows, GTK with AccessKit (pull_request) Successful in 35s
CI / Windows, desktop app (clippy, script tests) (pull_request) Successful in 1m43s
CI / Bundle for any distribution (pull_request) Successful in 40s
CI / Bundle programs, command line and helper (pull_request) Successful in 2m23s
CI / Arch package (pull_request) Successful in 3m7s
CI / Bundle programs, desktop app (pull_request) Successful in 3m2s
CI / Windows, installer and portable zip (pull_request) Successful in 6m17s
CI / Windows, MSYS2 sysroot (pull_request) Successful in 21s
VM test / Migrations in a VM (pull_request) Successful in 18m18s
CI / Release (pull_request) Has been skipped
CI / Windows, desktop app (tests under Wine) (pull_request) Successful in 2m10s
CI / Windows, command line (clippy with tests) (pull_request) Successful in 52s
CI / Windows, command line (tests under Wine) (pull_request) Successful in 1m50s
CI / Windows, installer (tests under Wine) (pull_request) Successful in 2m23s
CI / Format, lint and test (pull_request) Successful in 6m0s
1fa663fec3
An update installed before the reboot may already hold a copy of a rollback
rule removed since. With the drop-in gone, the copy of /etc at shutdown
(holo-sync-var catchup) would leave that rule in the updated slot and hide
the drive, back on its old filesystem, until the next update. Valve's
post-install writes /run/steamos-atomupd/holo-booted-slot-sync-trigger,
which starts that copy; while it is there, --uninstall keeps the drop-in
and says to run it again after the restart.
SkyfaR manually merged commit 26434ddf19 into main 2026-10-07 07:31:33 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
LevelXStudios/OpenGameCompressor!45
No description provided.