exploring systemd hooks to enable pam_luks keyring integration#3014
exploring systemd hooks to enable pam_luks keyring integration#3014d-cas wants to merge 3 commits intobasecamp:devfrom
Conversation
699312c to
2d625fc
Compare
- Replace udev → systemd for proper systemd-in-initramfs support - Replace keymap/consolefont → sd-vconsole for console setup - Replace encrypt → sd-encrypt for better LUKS2/FIDO2 support - Completes the modernization started with UKI adoption in PR basecamp#2242 Enables multi-device decryption, TPM2/FIDO2 hardware authentication, and provides superior diagnostics through journald integration. Includes migration script for existing installations that automatically updates hooks configuration and regenerates initramfs on upgrade. Inspired by @kappafon's investigation in basecamp#2326.
2d625fc to
964d02c
Compare
install/login/limine-snapper.sh
Outdated
|
|
||
| sudo tee /etc/mkinitcpio.conf.d/omarchy_hooks.conf <<EOF >/dev/null | ||
| HOOKS=(base udev plymouth keyboard autodetect microcode modconf kms keymap consolefont block encrypt filesystems fsck btrfs-overlayfs) | ||
| HOOKS=(base systemd plymouth keyboard autodetect microcode modconf kms sd-vconsole block sd-encrypt filesystems fsck btrfs-overlayfs) |
There was a problem hiding this comment.
FYI, from limine-snapper-sync docs:
Note: For systemd hooks, use sd-btrfs-overlayfs, since btrfs-overlayfs is incompatible.
There was a problem hiding this comment.
Good catch on the btrfs-overlayfs hook! Will update to use sd-btrfs-overlayfs for systemd compatibility.
Update: Reframing as ExplorationAfter Ryan's feedback and more testing, I've reframed this PR as an exploration rather than a recommendation. What we're testing:
Status so far:
Next steps:
The goal: Empirically determine if systemd hooks provide enough benefit over the current udev approach to justify the change. Fresh installs only (per Ryan's Limine precedent) if we proceed. Will post testing results in this thread as they come in. |
|
Converting to draft while I determine the best path forward based on maintainer feedback. The migration complexity and testing gaps need to be addressed before this is merge-ready. |
|
@d-cas did you find any issue with this from a new install state? If this was something that was a better long-term fit (still subject to some testing / review), it could also be something that doesn't have a migration path. There's no inherent harm in remaining on the legacy architecture and the risks of change may not be worth the rewards. We had to do a similar thing when we made the decision to use Limine as the boot loader of choice. The risks involved in trying to automatically migrate everyone were just too high. |
|
No issues on fresh installs so far. VM tested and my daily driver is running the systemd config clean. Migration is theoretically doable. It's just converting UUID syntax from busybox to systemd format in That said, fresh installs only makes way more sense. The big wins are boot speed (noticeably faster, haven't timed it yet) and opening the door to I'll focus on fresh install testing: different hardware configs, edge cases, installer validation. |
- Install: Fix sd-btrfs-overlayfs hook (was using legacy btrfs-overlayfs)
- Migration: Rewrite with safety fixes
- Idempotency check (skip if already migrated)
- Targeted hook replacements (preserves custom modules)
- Surgical kernel cmdline conversion (preserves all params)
- Tested cmdline sed with multi-line format
Note: Migration script is second draft, needs careful review.
Install script tested and verified.
Fresh Install Testing ResultsBuilt and tested with companion ISO PR omarchy-iso#60. System booted successfully with systemd hooks:
Config:
Testing continues on bare metal daily driver. Boot speed measurements coming next. |
|
I also took a stab at this a couple of week ago, but I made it a switchable setting instead of the new default. You can check out the code here: master...mlombardi96:omarchy:switchable-initramfs One thing to note is that I ran into issues running out of password attempts on the Plymouth screen and the entire boot failing. To fix this, I also had to add |
Killer work @mlombardi96 ! Thanks for the note on password attempts. Really helpful data point at this stage. I updated the code right after you brought it to my attention. Are you still running the systemd config? Any other gotchas you've run into? I'm trying to evaluate closely the pros, cons, and risks of systemd vs busybox. Would love to hear what you've learned from running it. |
|
@d-cas I recently did a fresh install so I'm not currently running it. But I never ran into any issues other than the password retry issue. I didn't notice any meaningful increase or decrease in boot times with the systemd-based config, but it might cause slightly increased boot times for older machines, so that's probably worth testing. |

Companion PR
A companion PR for the Omarchy ISO enables testing with systemd hooks:
omacom-io/omarchy-iso#60
Both PRs are exploratory, designed to gather data on whether systemd hooks provide enough benefit over the current udev approach to justify the change.
What This PR Explores
The current initramfs uses
udev-based hooks, which work well. This PR explores whether systemd hooks offer enough additional value to warrant switching.Not claiming systemd is "better", just different, with different capabilities. This PR exists to empirically determine if those differences matter for Omarchy users.
Inspired by: @kappafon's investigation in #2326 showing
encrypthook limitations with FIDO2 multi-token, and @ryanrhughes's work in #2242 on keyring unlock challenges.What Both Approaches Share
What We're Testing
Already Confirmed ✅
Needs Data 🧪
Known Trade-offs⚠️
The Hypothesis
If systemd hooks enable:
Then the trade-offs might be worth it.
If not, we document why and move on.
This PR exists to test that hypothesis.
Changes
Modified
install/login/limine-snapper.shto generate systemd hooks in/etc/mkinitcpio.conf.d/omarchy_hooks.conf:Includes optional migration script at
migrations/[timestamp].shfor existing installations (not recommended until thoroughly tested).Testing Status & Results
Fresh Installs (Working) ✅
Still Gathering Data 🧪
Migration (Available, Not Recommended Yet)⚠️
How to Test
Fresh Install:
Existing System (Advanced Users Only):
What Happens Next
Data gathering is in progress. Based on results:
If benefits outweigh trade-offs: Fresh installs only (following Limine precedent)
If trade-offs too high: Close PR, document findings for community knowledge
If unclear: Opt-in approach or extended testing period
Results will be posted as comments as testing progresses.
Potential synergy with #2242
If this proves beneficial, it opens architectural options:
Option A (current + pam_luks.so):
Option B (requires TPM2, alternative model):
systemd hooks enable both approaches. udev hooks only support Option A (and pam_luks.so hasn't been tested with udev hooks yet).
But we need data to know if it's worth it.
Credits
Thanks to @kappafon for the research in #2326 and @ryanrhughes for the context in #2242 that informed this exploration.
Testing Progress
This section will be updated as data comes in.
Boot Speed
TPM2
FIDO2
Hardware Compatibility
This PR remains in draft while we gather data.