| 6 Dec 2022 |
@elvishjerricco:matrix.org | mlyx: You would make a new initrd systemd service that has wantedBy = ["initrd.target"];. You also want the service to be ordered after file systems are mounted, but if you don't have DefaultDependencies=no, then it'll have After=local-fs.target by default anyway. But eventually we're going to change it so systemd-initrd uses initrd-fs.target like we're supposed to, which services don't get ordered after by default | 02:23:40 |
@elvishjerricco:matrix.org | The boot.initrd.systemd.services options are nearly identical to the systemd.services options | 02:24:22 |
@elvishjerricco:matrix.org | Aw man. Decided to try out the networking PR on my desktop, but it doesn't work | 05:54:17 |
@elvishjerricco:matrix.org | Looks like interfaces aren't being renamed to the "predictable" names. | 05:54:28 |
@elvishjerricco:matrix.org | * Looks like interfaces aren't being renamed to the "predictable" names until stage 2 | 05:54:34 |
@elvishjerricco:matrix.org | What causes that in stage 2? | 05:54:39 |
@elvishjerricco:matrix.org | Ok, the mere presence of ${systemd}/lib/systemd/network/99-default.link, regardless of whether it's linked anywhere in /etc, makes predictable names work | 06:40:42 |
@elvishjerricco:matrix.org | Now I have two other problems.
-
For some reason the DHCP server built into networkd that I use on my pi router requires my networkd clients to have dhcpV4Config.ClientIdentifier = "mac"; if I want static IPs to work. So now I have to configure that in initrd.
-
For some reason systemd-timesync.service is failing in stage 2 now with Failed to allocate manager: Permission denied
| 06:44:28 |
@elvishjerricco:matrix.org | * Now I have two other problems.
- For some reason the DHCP server built into networkd that I use on my pi router requires my networkd clients to have
dhcpV4Config.ClientIdentifier = "mac"; if I want static IPs to work. So now I have to configure that in initrd.
- For some reason
systemd-timesyncd.service is failing in stage 2 now with Failed to allocate manager: Permission denied
| 06:45:29 |
@mlyx:matrix.org | Has anyone tested boot.initrd.systemd.enable = true in kexec initrd? Seems that it doesn't work. I don't know how to debug initrd. What's the reason? https://github.com/nix-community/nixos-images | 10:15:21 |
flokli | mlyx: it's still marked as experimental. You might want to open a specific issue with what's exactly broken for you. | 12:29:58 |
@phaer:matrix.org | In reply to @mlyx:matrix.org Has anyone tested boot.initrd.systemd.enable = true in kexec initrd? Seems that it doesn't work. I don't know how to debug initrd. What's the reason? https://github.com/nix-community/nixos-images Not exactly what you are asking for but https://github.com/dep-sys/nix-dabei uses boot.initrd.systemd.enable (and the networkd PR) and kexecs into an initrd (without stage-2) with enough tools, you might at least find some inspiration there? W.r.t. debugging: one could increase log verbosity (see kernelParams in the repo), run a shell on console (e.g. https://github.com/dep-sys/nix-dabei/blob/main/modules/auto-installer.nix#L61) or just start sshd if networkd is included in your initrd :) | 13:55:12 |
@me:linj.tech | In reply to @phaer:matrix.org Not exactly what you are asking for but https://github.com/dep-sys/nix-dabei uses boot.initrd.systemd.enable (and the networkd PR) and kexecs into an initrd (without stage-2) with enough tools, you might at least find some inspiration there? W.r.t. debugging: one could increase log verbosity (see kernelParams in the repo), run a shell on console (e.g. https://github.com/dep-sys/nix-dabei/blob/main/modules/auto-installer.nix#L61) or just start sshd if networkd is included in your initrd :) great project! May I ask what is the trick to reduce the size of initrd compared to netboot? | 14:14:26 |
@phaer:matrix.org | In reply to @me:linj.tech great project! May I ask what is the trick to reduce the size of initrd compared to netboot? Thanks! Sure: There's no stage-2, so it's not a "real" nixos which gets booted but just an initrd where needed binaries and so on are added manually. Happy to go into details, but maybe switch to DMs for that so that we don't spam this channel to much with OT messages? :) | 14:16:22 |
@me:linj.tech | thanks. will take a closer look at the code | 14:20:00 |
| @s9616726:tu-dresden.de joined the room. | 15:25:30 |
| 7 Dec 2022 |
@hexa:lossy.network | In reply to @elvishjerricco:matrix.org mlyx: You would make a new initrd systemd service that has wantedBy = ["initrd.target"];. You also want the service to be ordered after file systems are mounted, but if you don't have DefaultDependencies=no, then it'll have After=local-fs.target by default anyway. But eventually we're going to change it so systemd-initrd uses initrd-fs.target like we're supposed to, which services don't get ordered after by default so I tried building a unit like tihs | 18:41:50 |
@hexa:lossy.network | and now the units failed and I wonder how to view the logs | 18:42:25 |
@hexa:lossy.network | boot.initrd.systemd.services = {
impermanence-root = {
wantedBy = [ "initrd.target" ];
after = [ "local-fs.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.zfs}/bin/zfs rollback -r zroot/local/root@blank";
};
};
};
| 18:49:44 |
@elvishjerricco:matrix.org | hexa: If you set boot.initrd.systemd.emergencyAccess, you can get a login shell. You can either set it to the hashed password or true for no password | 19:08:24 |
@elvishjerricco:matrix.org | From there you can use systemctl and journalctl | 19:08:39 |
@hexa:lossy.network | ok, cool | 19:11:07 |
@elvishjerricco:matrix.org | Not sure what's going wrong with that though. First guess is that it needs before = ["initrd-nixos-activation.service"];? I imagine rolling back while activation is running would be a no-no | 19:11:28 |
@hexa:lossy.network | added that before configuration | 20:12:05 |
@hexa:lossy.network | now it fails during switching | 20:12:11 |
@hexa:lossy.network | * now it fails during switching ("Switch Root") | 20:12:21 |
@hexa:lossy.network | the /sysroot directory is empty | 20:13:15 |
@hexa:lossy.network | and mount claims things are mounted to /sysroot, /sysroot/state, /sysroot/home | 20:13:42 |
@hexa:lossy.network | so I wonder whether the mounting order is off 😕 | 20:13:51 |
@elvishjerricco:matrix.org | hexa: sometimes I've had trouble with file systems being unmounted before hitting switch-root for a variety of reasons. That's one of the reasons we need to switch to initrd-fs.target instead of local-fs.target | 20:57:24 |