| 7 Apr 2022 |
@janne.hess:helsinki-systems.de | but yeah - it doesn‘t unmount /nix anymore | 15:49:05 |
@elvishjerricco:matrix.org | we could do activation in a systemd-generator, or we could set default.target for stage 2 to an activation script that does a daemon-reload and starts the real default.target | 15:49:12 |
@elvishjerricco:matrix.org | I actually like those more than doing activation in stage 1 now that I think about it | 15:49:21 |
@elvishjerricco:matrix.org | particularly the latter idea | 15:49:27 |
@janne.hess:helsinki-systems.de | feel free to implement this :D 2 systemds are already painful enough for me | 15:49:45 |
@janne.hess:helsinki-systems.de | Arian: that also removes the ugly cmdline hack and gives us a proper init= | 15:52:13 |
Arian | Woha there is a mechanism for this | 15:52:26 |
@elvishjerricco:matrix.org | ? | 15:52:30 |
Arian | Activation script could be an https://www.freedesktop.org/software/systemd/man/systemd.environment-generator.html | 15:52:53 |
Arian | Oh wait misreading I think | 15:53:27 |
@elvishjerricco:matrix.org | First I've heard of "environment generators", but yea I think that's just for setting environment variables | 15:55:22 |
@elvishjerricco:matrix.org | As an aside, it seems like a poor design decision for there to be stuff in activation scripts that cares about special mount points existing. Seems like those should be systemd units that have appropriate RequiresMountsFor=, and then we could have the special mounts just in fstab | 15:57:13 |
@elvishjerricco:matrix.org | If I had my way, I think activation would pretty much only be used for setting up /etc and refreshing systemd :P | 15:58:02 |
@janne.hess:helsinki-systems.de | if stage-2-init.sh was just calling the activation script and systemd, I‘d be a lot happier as well | 16:00:02 |
@elvishjerricco:matrix.org | I wonder if it might be better to hold off on handover until we have a cleaner story for this. Like maybe systemd-initrd can come with a deprecation of activation scripts... | 16:03:13 |
@janne.hess:helsinki-systems.de | I‘ve said this before and I will keep saying this: There is no way we will get rid of all activation scripts | 16:04:32 |
@elvishjerricco:matrix.org | why is that? | 16:05:06 |
@janne.hess:helsinki-systems.de | things I issume systemd wants: users/groups, /etc, /bin/sh, /usr/bin/env, all wrappers, /run/booted-system | 16:06:50 |
@elvishjerricco:matrix.org | Sure, but I think we can cover the basics in an internal way, rather than providing an externally available API that's virtually always a bad idea | 16:07:31 |
@janne.hess:helsinki-systems.de | I agree with that but I'm already so close to success that I don't want to stop right now | 16:15:15 |
@janne.hess:helsinki-systems.de | It may be a good idea in general, not just for stage 1, yeah | 16:15:29 |
@elvishjerricco:matrix.org | fair enough | 16:15:42 |
@janne.hess:helsinki-systems.de | that's probably why I don't have no udev database: https://github.com/systemd/systemd/blob/main/units/initrd-udevadm-cleanup-db.service | 16:33:53 |
@janne.hess:helsinki-systems.de | * that's probably why I have no udev database: https://github.com/systemd/systemd/blob/main/units/initrd-udevadm-cleanup-db.service | 16:33:59 |
@janne.hess:helsinki-systems.de | I found it \o/: https://github.com/systemd/systemd/issues/12953 | 16:37:47 |
@elvishjerricco:matrix.org |
the data passed from initrd to host should be very very carefully picked, minimal and stable. Blanket passing the whole udev database over is the wrong approach.
Hmm... That sounds problematic considering that issue is still open
| 17:05:01 |
@elvishjerricco:matrix.org | I wonder if we need something like this from the old initrd https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/system/boot/stage-1-init.sh#L588 | 17:09:17 |
@janne.hess:helsinki-systems.de | we will probably need that for iso booting, yes | 17:37:51 |
@janne.hess:helsinki-systems.de | hmm do we maybe need to trigger&&settle udev agian in stage 2?
| 17:40:50 |
@elvishjerricco:matrix.org | Well I noticed we don't do --cleanup-db in the old initrd I don't think | 17:48:02 |