29 Jul 2025 |
emily | well, that's why I was asking if you have any examples in mind of things that would make it hard :) | 17:47:42 |
ElvishJerricco | if someone wants to proof-of-concept it, that would be cool | 17:47:43 |
emily | I'd be open to poking at it, but it'd of course be nice to start with the hardest thing first to not waste effort on easier stuff | 17:48:09 |
ElvishJerricco | I don't think any specific things are difficult. It's just a lot of things and its a burden that remains forever | 17:48:15 |
emily | I think that probably putting a program in a separate output doesn't incur repeated ongoing maintenance costs in most cases | 17:48:46 |
emily | same way that make-initrd-ng itself doesn't much | 17:48:53 |
emily | people do closure size minimization work for other reasons, so it's not like it would be burden solely for initrd | 17:49:18 |
ElvishJerricco | Well if you want to give it a try, it shouldn't be too hard to swap makeInitrdNG for makeInitrd and start slashing away | 17:50:32 |
ElvishJerricco | (oof, a stock systemd initrd is 21M. not great, but acceptable) | 17:52:20 |
emily | yeah I might | 18:04:03 |
emily | even just looking at the diff of the closure would probably make it obvious where to start | 18:04:16 |
emily | (I thought makeInitrd screws up the store paths or something though) | 18:05:04 |
ElvishJerricco | no, makeInitrd just does plain ole closures | 18:05:41 |
ElvishJerricco | it's the extraUtils derivation that does the screwing with binaries so the closure is small | 18:05:58 |
emily | ah | 18:07:49 |
Marcel | Is this a crime?
storePaths =
let
closure = pkgs.closureInfo { rootPaths = [ initrdCfg.package ]; };
closurePaths = lib.filter (path: path != "") (lib.splitString "\n" (builtins.readFile "${closure}/store-paths")) ;
in
closurePaths ++
[
config.environment.etc."ifstate/config.initrd.yml".source
];
now i only have to work on reducing the closure size.
| 19:57:37 |
Marcel | * Is this a crime?
storePaths =
let
closure = pkgs.closureInfo { rootPaths = [ initrdCfg.package ]; };
closurePaths = lib.filter (path: path != "") (lib.splitString "\n" (builtins.readFile "${closure}/store-paths")) ;
in
closurePaths ++
[
config.environment.etc."ifstate/config.initrd.yml".source
];
now i only have to work on reducing the closure size.
| 19:58:08 |
emily | IFD | 19:58:51 |
emily | so criminal we have a name and a flag for the specific type of crime :) | 19:59:17 |
emily | it would break on Hydra | 19:59:19 |
Marcel | ahh ok | 19:59:56 |
Marcel | at least my vm test works now ;D | 20:00:47 |
ElvishJerricco | Marcel: yea if you want to do closureinfo stuff to get full closures into systemd initrd I was thinking of something like this:
{
boot.initrd.systemd.storePaths = [
(runCommand "x"
{
info = closureInfo { rootPaths = [ hello ]; };
}
''
mkdir $out
cat "$info"/store-paths | while read path; do
ln -s "$path" "$out/$(basename "$path")"
done
''
)
];
}
| 20:03:53 |
ElvishJerricco | * Marcel: yea if you want to do closureinfo stuff to get full closures into systemd initrd I was thinking of something like this:
{
boot.initrd.systemd.storePaths = [
(runCommand "x"
{
info = closureInfo { rootPaths = [ hello ]; };
}
''
mkdir $out
cat "$info"/store-paths | while read path; do
ln -s "$path" "$out/$(basename "$path")"
done
''
)
];
}
| 20:03:57 |
ElvishJerricco | but it'd probably be better to just have a make-initrd-ng feature for this | 20:04:21 |
ElvishJerricco | something like storePaths = [ { source = hello; closure = true; } ]; | 20:04:47 |
emily | if I clear my backlog for today I'm going to diff the closure of make-initrd{,-ng} | 20:04:56 |
emily | and my rampage will begin :P | 20:05:02 |
Marcel | no pressure - when ifstate releases i will just create an PR without initrd support and keep that initrd stuff localy untill we've figured something out | 20:08:17 |
Marcel | In reply to @elvishjerricco:matrix.org
Marcel: yea if you want to do closureinfo stuff to get full closures into systemd initrd I was thinking of something like this:
{
boot.initrd.systemd.storePaths = [
(runCommand "x"
{
info = closureInfo { rootPaths = [ hello ]; };
}
''
mkdir $out
cat "$info"/store-paths | while read path; do
ln -s "$path" "$out/$(basename "$path")"
done
''
)
];
}
thx | 20:16:15 |