| 20 Mar 2022 |
@elvishjerricco:matrix.org | The size is even reasonable at 15M | 02:19:01 |
@elvishjerricco:matrix.org | 13 if you don't include cryptsetup libs | 02:19:11 |
@elvishjerricco:matrix.org | probably smaller when I stop adding unnecessary systemd libs with the proper Exec* parsing | 02:19:25 |
bobvanderlinden | Cool! I can work on it a bit tomorrow, so if you have something where work can continue on, let me know the branch 👍 | 02:41:30 |
@elvishjerricco:matrix.org | bobvanderlinden: I'll push my branch here in a minute, and I'll open a PR probably tonight after I do the Exec*/cherry-pick thing | 02:42:10 |
bobvanderlinden | In reply to @elvishjerricco:matrix.org The 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. I have been thinking of find-dependencies. It might also be of use for packing docker images and the like. Maybe we can make it a separate tool with some options to indicate the different strategies it should use. | 02:43:30 |
@elvishjerricco:matrix.org | That... can be saved for a later date :P | 02:44:04 |
@elvishjerricco:matrix.org | Gotta get this merged first | 02:44:11 |
@elvishjerricco:matrix.org | Oh crap I forgot about udev rules | 02:49:04 |
@elvishjerricco:matrix.org | bobvanderlinden: https://github.com/bobvanderlinden/nixpkgs/compare/pr-refactor-systemd-module...ElvishJerricco:systemd-initrd-reuse-systemd-module | 03:10:41 |
@elvishjerricco:matrix.org | This is on top of your refactor branch | 03:10:47 |
@elvishjerricco:matrix.org | This is what I use to test it:
import ./nixos { configuration = { lib, config, pkgs, ... }: {
imports = [./nixos/modules/virtualisation/qemu-vm.nix];
boot.initrd.systemd = {
enable = true;
emergencyHashedPassword = "";
};
virtualisation = {
graphics = false;
memorySize = ;
cores = 4;
};
documentation.enable = false;
services.getty.autologinUser = "root";
}; }
Note that you currently have to format the nixos.qcow2 file manually for the qemu-vm
| 03:13:56 |
@elvishjerricco:matrix.org | * This is what I use to test it:
import ./nixos { configuration = { lib, config, pkgs, ... }: {
imports = [./nixos/modules/virtualisation/qemu-vm.nix];
boot.initrd.systemd = {
enable = true;
emergencyHashedPassword = "";
};
virtualisation = {
graphics = false;
memorySize = 4096;
cores = 4;
};
documentation.enable = false;
services.getty.autologinUser = "root";
}; }
Note that you currently have to format the nixos.qcow2 file manually for the qemu-vm
| 03:14:14 |
@elvishjerricco:matrix.org | Once I have the exec detection and udev stuff I want in there, I'll open a PR that I expect to be merge-worthy | 03:15:23 |
@elvishjerricco:matrix.org | (graphics = false isn't necessary, I just prefer it) | 03:47:49 |
@elvishjerricco:matrix.org | bobvanderlinden: I switched to your version of the dependencies program and managed to get initrd down to 9.1M, which is crazy! It does boot, but now the rescue mode doesn't work for some reason. | 06:02:24 |
@elvishjerricco:matrix.org | Aw, that decreased size was entirely because I switched to only including the necessities from util-linux instead of all of it, not because of the automatic dependency finder. And the finder didn't work well enough to actually function without significant help from manual inclusions :/
After staring at it and thinking for a while, I'm starting to think automatically finding Exec* stuff just isn't a problem worth solving. I imagine if a fresh set of eyes came to this project after this problem had been solved, they'd say any solution is way too jank to be worth it. If your unit file points to a program, then just include that program in objects... Adding services to initrd should be a fairly rare thing anyway.
| 06:56:48 |
@elvishjerricco:matrix.org | Sooo... I'm going to do another little review an then open a PR! | 06:57:07 |
@elvishjerricco:matrix.org | https://github.com/NixOS/nixpkgs/pull/164943 woot | 08:06:10 |
Arian | Will try it out right away! | 08:08:58 |
Arian | I wanted to say we probably need https://github.com/NixOS/nixpkgs/pull/121371 for the correct ordering of kmod-static-nodes and systemd-tmpfiles-setup-dev but it seems flokli merged it already! :D | 08:12:08 |
Arian | so you probably have those fixed already :P | 08:12:14 |
Arian | yay about forgetting about PRs and other people picking them up | 08:13:31 |
@elvishjerricco:matrix.org | Arian: Beware it's extremely minimal (on purpose), so it's only going to boot extremely simple things | 08:14:20 |
@elvishjerricco:matrix.org | But at least it has a good rescue shell when it fails :P | 08:14:34 |
Arian | that's fine. I have a "play with initrd" machine :P | 08:14:47 |
Arian | Another future work could be: Unified kernel images for the SecureBoot integration | 08:15:52 |
Arian | Adds to my own list | 08:15:56 |
@elvishjerricco:matrix.org | Bit out of scope I think :P | 08:17:00 |
Arian | yes =) | 08:17:04 |