Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decrypt-root: Rework around a udev rule to fix slow PXE/ISO boots #98

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dracut/31decrypt-root/64-decrypt-root.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ACTION=="add", SUBSYSTEM=="block", ENV{ID_PART_ENTRY_NAME}=="ROOT", ENV{ID_FS_TYPE}=="crypto_LUKS", TAG+="systemd", ENV{SYSTEMD_WANTS}+="decrypt-root.service"
23 changes: 0 additions & 23 deletions dracut/31decrypt-root/decrypt-root

This file was deleted.

12 changes: 6 additions & 6 deletions dracut/31decrypt-root/decrypt-root.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Description=Generate and execute a systemd-cryptsetup service to decrypt the ROO
DefaultDependencies=no
# If systemd-networkd.service is used in the initramfs, then we should run after it, since the ROOT partition
# might use network-bound encryption.
After=systemd-networkd.service dev-disk-by\x2dpartlabel-ROOT.device
After=systemd-networkd.service dev-disk-by\x2dpartlabel-ROOT.device ignition-disks.service
Wants=dev-disk-by\x2dpartlabel-ROOT.device
Before=dracut-initqueue.service
chewi marked this conversation as resolved.
Show resolved Hide resolved

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/decrypt-root

[Install]
WantedBy=ignition-subsequent.target
Environment=SYSTEMD_CRYPTTAB=/dev/stdin
StandardInputText=rootencrypted /dev/disk/by-partlabel/ROOT none luks,tpm2-device=auto
ExecStart=/usr/lib/systemd/system-generators/systemd-cryptsetup-generator /etc/systemd/system
ExecStartPost=/bin/systemctl daemon-reload
ExecStartPost=/bin/systemctl start [email protected]
5 changes: 1 addition & 4 deletions dracut/31decrypt-root/module-setup.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
install() {
inst_script "$moddir/decrypt-root" \
"/usr/sbin/decrypt-root"
inst_rules "$moddir/64-decrypt-root.rules"

inst_simple "$moddir/decrypt-root.service" \
"$systemdsystemunitdir/decrypt-root.service"

inst_simple /usr/lib64/cryptsetup/libcryptsetup-token-systemd-tpm2.so

systemctl --root "$initdir" enable decrypt-root.service
}