| 1 Apr 2022 |
@elvishjerricco:matrix.org | It's very easy to detect unnecessary things by accident | 17:34:41 |
@elvishjerricco:matrix.org | but I think that it's good enough. Initrd is a niche thing anyway, and people should probably expect to have to put a bit more care into things like that | 17:35:23 |
@janne.hess:helsinki-systems.de | I said I should take a look at dockerTools, they seem to do it very well. But yeah, that's something we can do later | 17:35:39 |
@elvishjerricco:matrix.org | Oh I had figured dockerTools just used regular closures, but that was just an assumption on my part | 17:36:03 |
@janne.hess:helsinki-systems.de | yeah so did I :D | 17:36:19 |
@elvishjerricco:matrix.org | Quick question, when a disk is partitioned, do devices like /dev/sdb1 show up magically, or do we need udev for that? That might be the only thing left I can think of to block this PR; if it doesn't work for systems installed on basic partition tables. | 17:37:48 |
@janne.hess:helsinki-systems.de | I don't actually know. I wanted to work on low-level stuff (like hibernation and handover) during the oceansprint but also on raid, integrity, crypto, …. I guess I'll notice it :D | 17:38:46 |
@janne.hess:helsinki-systems.de | but I think udev should just do that | 17:38:56 |
@elvishjerricco:matrix.org | well we currently don't have any udev rules. Udev does run, but there are no installed rules (I dunno if it has default rules or something) | 17:39:24 |
@janne.hess:helsinki-systems.de | oof, that might be an issue in the future. But I'm not sure | 17:39:44 |
| * @elvishjerricco:matrix.org shrugs | 17:40:21 |
@elvishjerricco:matrix.org | as long as we don't go around telling everyone they can replace their initrd right now, I guess we can fix it later :P | 17:40:37 |
@janne.hess:helsinki-systems.de | I guess we shouldn't do that yet | 17:40:53 |
bobvanderlinden | Udevd is needed. Running a VM with rd.emergency in kernel cmdline will give you a shell that does not have /dev/vda. That only pops up after starting systemd-udevd. | 21:03:34 |
bobvanderlinden | For luks+lvm I did need additional udev rules | 21:03:54 |
bobvanderlinden | For udev: https://github.com/bobvanderlinden/nixpkgs/blob/pr-systemd-initrd-luks-lvm/nixos/modules/system/boot/initrd-systemd-udev.nix | 21:25:18 |
bobvanderlinden | What is a bit painful are the commands that udev rules can potentially call and the packages/files/binaries that are needed. | 21:25:57 |
bobvanderlinden | for instance the udev rules for luks refers to /run/current-system/systemd/bin/systemd-run. There might be more services that do this. Workaround for that is here: https://github.com/bobvanderlinden/nixpkgs/blob/a1efa03c1d18465da62ec396e47b7826fcad695d/nixos/modules/system/boot/systemd/initrd.nix#L474 | 21:29:46 |
bobvanderlinden | * for instance the udev rules for lvm refers to /run/current-system/systemd/bin/systemd-run. There might be more services that do this. Workaround for that is here: https://github.com/bobvanderlinden/nixpkgs/blob/a1efa03c1d18465da62ec396e47b7826fcad695d/nixos/modules/system/boot/systemd/initrd.nix#L474 | 21:30:17 |
bobvanderlinden | Udev, lvm and LUKS modules can be found here: https://github.com/bobvanderlinden/nixpkgs/tree/pr-systemd-initrd-luks-lvm/nixos/modules/system/boot (initrd-systemd-*)
LUKS works nicely. Lvm doesn't yet work correctly, haven't found why not. I think it's close, but this is the thing that is still preventing me to boot my laptop configuration. | 21:32:52 |
@elvishjerricco:matrix.org | Hm there's also the issue that if you don't have emergencyAccess enabled, then it just says the root account is locked, press enter to continue, which brings you back to the root account is locked message. I wonder if there's a decent way to have an option to reboot from there. | 23:05:52 |
@elvishjerricco:matrix.org | That's not a blocker at all; just something I thought about | 23:06:20 |
| 2 Apr 2022 |
@janne.hess:helsinki-systems.de | I think its something the upstream systemd devs will have to fix | 01:58:16 |
@andreas.schraegle:helsinki-systems.de | In reply to @elvishjerricco:matrix.org Hm there's also the issue that if you don't have emergencyAccess enabled, then it just says the root account is locked, press enter to continue, which brings you back to the root account is locked message. I wonder if there's a decent way to have an option to reboot from there. ctrl+alt+del? | 02:33:29 |
@janne.hess:helsinki-systems.de | More than 8 times in 5 seconds | 02:33:56 |
@elvishjerricco:matrix.org | In reply to @bobvanderlinden_:matrix.org What is a bit painful are the commands that udev rules can potentially call and the packages/files/binaries that are needed. I know a lot of the udev rules refer to some commands by name without an absolute path. Hopefully we can just add those to the /bin env thing, then they'll be on PATH and we need any patching. | 03:58:22 |
@elvishjerricco:matrix.org | In reply to @bobvanderlinden_:matrix.org for instance the udev rules for lvm refers to /run/current-system/systemd/bin/systemd-run. There might be more services that do this. Workaround for that is here: https://github.com/bobvanderlinden/nixpkgs/blob/a1efa03c1d18465da62ec396e47b7826fcad695d/nixos/modules/system/boot/systemd/initrd.nix#L474 And no need for a whole service to make that symlink. You can just do something like contents."/run/current-system/sw/bin".source = cfg.contents."/bin".source; (with the new contents API that replaced the objects one) | 03:59:57 |
@elvishjerricco:matrix.org | We probably want a way to add a specific program to /bin without adding the whole package's $out/bin. Then we wouldn't need the special case stuff for mount and umount. Dunno what we'd call that. initrdBinExtras? | 04:01:10 |
@janne.hess:helsinki-systems.de | In reply to @elvishjerricco:matrix.org We probably want a way to add a specific program to /bin without adding the whole package's $out/bin. Then we wouldn't need the special case stuff for mount and umount. Dunno what we'd call that. initrdBinExtras? extraBins? | 04:02:10 |
@elvishjerricco:matrix.org | I like initrdBinExtras better than that since it conveys its part of the same thing | 04:03:06 |