Re:Better-initramfs: initramfs supporting SSH, lvm, luks, ra...
by rdslw on Tuesday January 28, 2020 @03:24PM
(#22173678)
Can you share (blog? github?) more details (ideally whole dracut module :) about your implementation?
[ Parent
| on HN ]
Re:Better-initramfs: initramfs supporting SSH, lvm, luks, ra...
by anon9001 on Tuesday January 28, 2020 @04:57PM
(#22174518)
I haven't posted it anywhere because it's a bit of a mess, but here you go: https://pastebin.com/ZfkM2zkU
I'm not proud, or smart, but it works. Systemd is used for networking to make it simpler.
I based it on this: https://github.com/gsauthof/dracut-sshd
I should probably package it up with all the config options you'd need to specify drive and keyfile location and all that, but I'm a terrible member of the community and haven't actually done it yet.
The real trick that took me a long time to figure out was invoking "cryptsetup luksOpen" with my mount.sh script and then using "systemctl stop systemd-cryptsetup@nvme0n1p3_crypt.service" to get the thing to keep booting. I still don't really understand the tty ask password stuff in systemd, but this seems to work fine.
You just ssh in and run ./mount.sh and it decrypts/mounts/boots.