Skip to content

Stop broken TPM PCR units from forcibly rebooting - #12106

Open
chessing234 wants to merge 4 commits into
omacom:quattrofrom
chessing234:fix/8190-pcrphase-no-force-reboot
Open

chessing234 wants to merge 4 commits into
omacom:quattrofrom
chessing234:fix/8190-pcrphase-no-force-reboot

Conversation

@chessing234

@chessing234 chessing234 commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Upstream systemd-pcrphase.service, systemd-pcrphase-sysinit.service, systemd-pcrmachine.service, systemd-pcrfs-root.service, and systemd-pcrfs@.service set FailureAction=reboot-force. On ThinkPads and similar hardware where the TPM is present but unresponsive, a failed PCR extend becomes a login → reboot loop (ThinkPad T470 boot loop when TPM is visible but unresponsive #8190).
  • Ship FailureAction=none drop-ins for those five units. They apply on every machine, not only one with a broken TPM. Nothing in the diff reloads systemd.

Fixes #8190

Test plan

  • On affected hardware (or with a forced pcrphase failure), confirm login no longer triggers a reboot

Upstream systemd-pcrphase and systemd-pcrfs units use FailureAction=reboot-force.
On machines where the TPM is present but unresponsive, that turns a failed
measurement into a login reboot loop. Ship FailureAction=none drop-ins and
reload systemd on update.

Fixes omacom#8190
@omarchybot omarchybot added bug Something isn't working compatibility Make Omarchy work better on everything! labels Sep 27, 2026
omarchybot and others added 2 commits October 1, 2026 06:46
etc/** ships in omarchy-settings straight to /etc, so the drop-ins are already in place when migrations run and $OMARCHY_PATH/etc never exists: the copy loop could not fire, and if it had it would have left unowned files at paths the package owns. What the package cannot do is reload the manager, since pacman's daemon-reload hook watches only usr/lib/systemd/system. The test now exercises that reload and its reboot-required fallback instead of the dead branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omarchy-settings, which ships these drop-ins, also ships /usr/lib/systemd/system/plocate-updatedb.service.d/10-omarchy.conf, so every upgrade of it fires pacman's daemon-reload hook in the same transaction. The migration only added a sudo prompt for every user. The test now requires FailureAction=none to sit under [Unit], since systemd ignores it in any other section and the old greps passed that case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and run on an Omarchy worker VM, with a second opinion from Codex Medium. The fix is right and I pushed two commits to tighten it. It now waits on a test from someone with the affected hardware.

What was checked

  • The five drop-ins are the right set. systemd 262 puts FailureAction=reboot-force on ten PCR units. Four of the ones left out only run inside a systemd initrd (ConditionPathExists=/etc/initrd-release), and Omarchy's initrd is busybox (base udev … encrypt), so they never start. The fifth, systemd-pcrphase-factory-reset, is only pulled in by factory-reset.target, which Omarchy's own reset command does not use.
  • Dropping reboot-force costs nothing here. Upstream reboots so a machine never carries on with its PCRs in the wrong phase, which only matters when secrets are sealed to them, and nothing in Omarchy seals anything to the TPM.
  • I reproduced the mechanism on the worker (no TPM needed). I overrode systemd-pcrmachine.service to fail. With upstream's setting, systemd logged Forcibly rebooting: unit systemd-pcrmachine.service failed, the same line as in ThinkPad T470 boot loop when TPM is visible but unresponsive #8190, and the VM rebooted. With this branch's drop-ins installed, all five units report FailureAction=none, the unit failed and the machine stayed up on the same boot. With the drop-in removed again, it went back to reboot-force and rebooted.
  • ./test/cli and test/shell.d/pcrphase-no-force-reboot-test.sh pass on the worker at d4f0f26.

Pushed to this branch

  • 5a63c23 and d4f0f26 remove migrations/1789561000.sh. etc/** ships in omarchy-settings straight to /etc, so $OMARCHY_PATH/etc does not exist and the copy loop could never run. If it had, it would have left files pacman doesn't own at paths the package does. The daemon-reload isn't needed either: omarchy-settings also ships /usr/lib/systemd/system/plocate-updatedb.service.d/10-omarchy.conf, so every upgrade of it already fires pacman's daemon-reload hook in the same transaction that delivers these drop-ins. Without the migration, nobody gets a sudo prompt for a reload that already happened.
  • The test now requires each drop-in to set FailureAction=none under [Unit]. systemd ignores it in any other section, and the old greps passed that case. I checked that moving it under [Service] makes the test fail.

Codex Medium found the redundant reload and the test gap. Its second round on the final head found nothing open. It can read this session's working notes, so its agreement is not guaranteed to be independent.

What it waits on

A worker has no broken TPM, so this proves the mechanism, not the fix on a T470. @KalenJosifovski, could you test it on the machine from #8190? With the Security Chip still disabled:

git clone https://github.com/Chessing234/omarchy.git && cd omarchy
git checkout d4f0f26ab408242cc3ef8f3abd2e77045efa913c
for d in etc/systemd/system/systemd-pcr*.service.d; do sudo install -Dm644 "$d/10-omarchy-no-force-reboot.conf" "/$d/10-omarchy-no-force-reboot.conf"; done
sudo systemctl daemon-reload

Then turn the Security Chip back on in the BIOS, boot and log in. If it stays up, please post the output of journalctl -b -u 'systemd-pcr*' --no-pager. The units may still log failures, but the machine should no longer reboot. If it still loops, journalctl -b -1 --no-pager | grep -i -B5 forcibly from the next boot (with the chip off again) will show which unit did it.

This would not fix everything in #5087. Those reports also include a TPM that hangs on NvPCR operations instead of failing, which a FailureAction change does not reach.

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; removing the test does not break the shell test runner.

Summary

Adds five systemd drop-ins that set FailureAction=none so failed PCR measurements do not force a reboot.

  • Covered PCR service failures no longer force the machine to reboot.

Reviews (2) · Last reviewed commit: "Drop the PCR drop-in readback test" · Reviewed by Greptile

@emirb

emirb commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Hi @chessing234 thanks for this!

I reproduced on the 4.5.0rc1 install (systemd 262) in QEMU with a swtpm TPM on tpm-tis, before and after this head (d4f0f26):

  • TPM fails, then power off: without the drop-ins, Forcibly rebooting: unit systemd-pcrphase.service failed → reboot: Restarting system. With them, reboot: Power down, and systemd-pcrphase still logs its failure (State not recoverable).
  • TPM fails during boot (ThinkPad T470 boot loop when TPM is visible but unresponsive #8190): without them, Forcibly rebooting: unit systemd-pcrmachine.service failed, every boot. With them, it boots to SDDM in 5.6 s with the PCR units marked failed.

Of the units that carry FailureAction=reboot-force on 262, the ones that run on our busybox initramfs are pcrphase-sysinit, pcrphase and pcrmachine, and this covers all three. The rest are initrd-only or tied to factory-reset.target.

Not covered by this: a TPM that hangs rather than fails, as on the ST33 ThinkPads in #5087. A vTPM can’t model that, so it still needs a test on that hardware.

Two small things:

FYI - the description still says systemd is reloaded on update; d4f0f26 dropped that. pacman’s daemon-reload hook only watches usr/lib/systemd/system/*, so these /etc drop-ins take effect from the next boot. That’s fine for the boot loop, but the first power-off after updating can still reboot once.
pcrphase-no-force-reboot-test.sh only reads back the files this PR adds. I’d drop it; the runs above are the check.

It only reads back the five files this change adds, which the base branch's AGENTS.md rules out for a small declarative change: the only breakage it catches is someone editing those lines. Booting with a failing PCR unit is the check that matters, and it was run on a VM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Nov 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-checked after @emirb's notes, on an Omarchy worker VM running systemd 262.1, with a second opinion from Codex Medium and muse-wonder (pi, thinking high). The fix holds on 262.1. I pushed one commit that drops the test, as suggested. One thing is left for the author: the description.

What was checked

  • systemd 262.1 still sets FailureAction=reboot-force on all five units. I made systemd-pcrmachine.service fail on the worker. On the stock install, systemd logged Forcibly rebooting: unit systemd-pcrmachine.service failed, the same sequence as the journal in ThinkPad T470 boot loop when TPM is visible but unresponsive #8190, and the VM rebooted. With this branch's drop-ins, all five units show FailureAction=none, and the unit failed on the same boot without a reboot. With the drop-ins removed again, it rebooted.
  • ./test/cli passes on the worker at 368829a.
  • On the reload after an update: emirb is right that the /etc drop-ins don't trigger pacman's hook on their own, but the update still reloads. I installed the drop-ins on the worker as a pacman package without running daemon-reload. With only the /etc files, nothing reloaded and the units stayed at reboot-force. Adding one file under usr/lib/systemd/system/*.service.d/ to the same package made the upgrade print Reloading system manager configuration..., and all five switched to none. libalpm matches hook targets with plain fnmatch, so * crosses /. omarchy-settings already ships such a file (default/systemd/system/plocate-updatedb.service.d/10-omarchy.conf), so the upgrade that delivers these drop-ins reloads systemd in the same transaction, and the first power-off after updating uses the new setting. That works only because an unrelated file sits in the same package. Shipping the five from default/systemd/system/ to /usr/lib/systemd/system/, as the NvPCR drop-ins do, would trigger the hook directly. Whether that is worth the move is a judgement call, so I haven't pushed it.
  • No other open pull request touches these units. Remove the NvPCR drop-ins now that systemd 262.1 is everywhere #16274 removes the NvPCR drop-ins, which are separate, and nothing on quattro seals secrets to PCR 11 or 15. Skipping a failed measurement therefore leaves the unit failed in systemctl --failed and costs nothing else.

Pushed to this branch

  • 368829a removes test/shell.d/pcrphase-no-force-reboot-test.sh. It only read back the five files this change adds. quattro's AGENTS.md rules that out for a small declarative change ("re-reading the file you edited to confirm the edit is there"). The boot runs above are the real check.

Second opinion

Codex Medium found nothing open and agreed the test should go. muse-wonder asked to restore the test, citing docs/testing.md's mention of config invariants. I didn't, because AGENTS.md names this exact kind of test as one not to write. Both noted that systemd-pcrphase-factory-reset.service also has reboot-force. Only factory-reset.target pulls it in, and Omarchy's reset doesn't use that target, so it is outside this bug. Both models can read this session's notes, so their agreement is not guaranteed to be independent.

As emirb said, this does not reach a TPM that hangs instead of failing, as in some of the #5087 reports.

What it waits on

@chessing234, the description is out of date. It says systemd is reloaded on update and points to the test, and neither is in the diff now. Please update it to describe the five drop-ins as they stand. After that the maintainer decides. The drop-ins drop the forced reboot on every machine, not only those with a broken TPM. That changes nothing today because nothing seals to these PCRs, but it is a measured-boot setting.

@chessing234

Copy link
Copy Markdown
Contributor Author

updated the description. it's the five failureaction=none drop-ins. no reload step and no test file.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks @chessing234. The description now matches the diff: five FailureAction=none drop-ins, no reload step, no test file. Nothing is left for you to do.

What was checked this time

  • The code hasn't changed since the worker run on 368829a described above. That run used systemd 262.1: a forced systemd-pcrmachine failure rebooted the stock install, didn't reboot with these drop-ins, and rebooted again once they were removed. ./test/cli passed. CI is green on the same head.
  • Since then quattro has moved from 5df8f9e to 3b36b9e. Nothing in that range adds another drop-in for these five units, seals anything to PCR 11 or 15, changes the busybox initramfs these units run under on x86, or changes how etc/** ships to /etc through omarchy-settings. The branch still merges cleanly.
  • Codex Medium and muse-wonder (pi, thinking high) checked the rewritten description against the diff and found the claims accurate. They also reviewed the quattro range and found nothing that affects this fix. Both models can read this session's notes, so their agreement is not guaranteed to be independent.

One note on issues

#8190 was closed as a duplicate of #5087, so Fixes #8190 won't close anything when this merges. That is correct: #5087 also covers TPMs that hang instead of failing. A hung measurement never fails the unit, so FailureAction doesn't apply and this change doesn't help there. #5087 should stay open for that case.

What it waits on

The maintainer. The change is verified. What remains is whether to drop the forced reboot on every machine, not just ones with a broken TPM. Nothing in Omarchy seals to these PCRs today, but it is a measured-boot setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working compatibility Make Omarchy work better on everything! verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ThinkPad T470 boot loop when TPM is visible but unresponsive

3 participants