!PSmBFWNKoXmlQBzUQf:helsinki-systems.de

Stage 1 systemd

83 Members
systemd in NixOs's stage 1, replacing the current bash tooling https://github.com/NixOS/nixpkgs/projects/5127 Servers

Load older messages


SenderMessageTime
19 Mar 2022
@bobvanderlinden_:matrix.orgbobvanderlinden make cfg part of the arguments of generateUnits' I'd say 11:19:01
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgThis thing is getting way too many positional arguments. I'm gonna make it an attrset argument11:20:46
@bobvanderlinden_:matrix.orgbobvanderlindenhaha, exactly what I was thinking 😄 it's a messy function atm11:21:17
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgHell yea, that worked11:26:56
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgSweet, the regular old systemd options are generating a proper unit directory. Awesom12:46:57
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgSweet. Looks like I just have to fix the slightly wrong file system code for the qemu-vm module and then I'll have a VM that boots.13:52:03
@elvishjerricco:matrix.org@elvishjerricco:matrix.org bobvanderlinden: Btw the reason you had to force it to load ext4 was because /proc/sys/kernel/modprobe wasn't set to a real modprobe program. I solved this by putting kernel.modprobe = /bin/modprobe in /etc/sysctl.d/nixos.conf 13:52:53
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgIt's honestly remarkable how much simpler this branch is than all my previous attempts, and it's easily the most useful version of it anyway13:53:39
@arianvp:matrix.orgArianThat's a good sign14:13:06
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgCurrently it's 26M, which is way too big.14:25:57
@elvishjerricco:matrix.org@elvishjerricco:matrix.org But, I'm forcing it to include all of ${glibc}/lib because there's some dynamically loaded library that is required to start the recovery shell (not to boot though), and I'm not using systemdMinimal because that wouldn't include cryptsetup. 14:25:59
@elvishjerricco:matrix.org@elvishjerricco:matrix.org If I don't do the glibc thing and I use systemdMinimal, then it's just 13M, which is actually really good 14:26:26
@elvishjerricco:matrix.org@elvishjerricco:matrix.org Using systemdMinimal.override { withCryptsetup = true; } brings it to 15M, which isn't so bad 14:26:51
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgOh, hah, nevermind. If you actually try to run the thing with systemdMinimal then it just doesn't work at all14:29:25
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgAh no I'm wrong, it boots just fine. I just screwed it up14:48:21
@bobvanderlinden_:matrix.orgbobvanderlindenThat sounds quite promising. I was wondering whether booting with minimal would work when the root runs on non-minimal. Probably fine, but hadn't tried that yet.15:15:15
@bobvanderlinden_:matrix.orgbobvanderlinden

bobvanderlinden: Btw the reason you had to force it to load ext4 was because /proc/sys/kernel/modprobe wasn't set to a real modprobe program. I solved this by putting kernel.modprobe = /bin/modprobe in /etc/sysctl.d/nixos.conf

Ah haha that makes sense. I didn't know about this option and what trying to figure out why udevd wasn't calling modprobe. Good to hear that workaround is ironed out 👍👍

17:04:15
@armeen:matrix.orgarmeen joined the room.17:59:47
@rhys:memes.nzRhys joined the room.21:41:44
@elvishjerricco:matrix.org@elvishjerricco:matrix.org Going to have to start caching systemdMinimal.override { withCryptsetup = true; } though. 23:21:36
@flokli:matrix.orgflokli bobvanderlinden: I'm curious about all the systemd cryptsetup stuff in initrd. Asking for passwords from multiple consoles, and reusing passwords for multiple to-be-unlocked volumes should be much much nicer 23:38:19
@flokli:matrix.orgflokliAs well as all the yubikey/u2f/tpm stuff, which should now just work out of the box if we provide it in crypttab23:38:57
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgflokli: systemd in initramfs will make the password part at least much nicer, since it uses systemd-ask-password23:57:34
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgNo idea about the myriad of other LUKS features NixOS currently implements in initramfs23:57:56
20 Mar 2022
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgAaand it boots. Finally. Awesome.01:28:31
@bobvanderlinden_:matrix.orgbobvanderlinden
In reply to @flokli:matrix.org
bobvanderlinden: I'm curious about all the systemd cryptsetup stuff in initrd. Asking for passwords from multiple consoles, and reusing passwords for multiple to-be-unlocked volumes should be much much nicer
NixOS's ask-password is the main gripe I have with stage-1. It doesn't allow Plymouth usage, so Plymouth on systems with an encrypted root is basically useless.
Adding Plymouth (and others) support is currently done by fiddling with a large bash script that is run during stage1 and fiddling with a bash script that adds specific files to initramfs. Absolutely hard to maintain and hard to modularize. All the while packages like Plymouth already have systemd configuration for systemd specifically for initrd 🤷
I'm also interested how clean we can make the configuration when systemd can be used.
02:13:19
@bobvanderlinden_:matrix.orgbobvanderlinden
In reply to @elvishjerricco:matrix.org
Aaand it boots. Finally. Awesome.
What has changed since it booted on your old branch?
02:14:08
@elvishjerricco:matrix.org@elvishjerricco:matrix.org bobvanderlinden: Now it uses the systemd options so the API is about 1000x nicer. It also has a more minimal set of default upstream units 02:17:04
@elvishjerricco:matrix.org@elvishjerricco:matrix.organd it's a separate opt-in initrd, instead of flat-out replacing the existing one02:17:25
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgThe last thing I think I need to do before the branch can be up for review/merge is the Exec* parsing stuff, though I may just cherry-pick your code instead since that would be easier.02:18:34

Show newer messages


Back to Room ListRoom Version: 6