nixos-generators icon indicating copy to clipboard operation
nixos-generators copied to clipboard

formats: repair kexec

Open Lassulus opened this issue 1 year ago • 3 comments

no hardware to test right now. so if someone wants to test it, that would be helpful :)

Lassulus avatar Jul 16 '23 19:07 Lassulus

After double checking that I didn't overlook anything, the error is indeed because the code introduced in this pull request does not in fact pull in a new initrd image rather than reuse the default initrd used for booting NixOS systems. That default image has no reference to the system that it's supposed to boot however. The previous code achieved this by using the upstream netboot initrd which does contain a full NixOS system generated from the corresponding configuration.

Since upstream does support building the kexec tree already using config.system.build.kexecTree my suggestion would be to include the functionality that was already present before, such as the autoreboot or justdoit modules, while replacing the kexec_tarball (referencing <nixpkgs>, the reason for it being broken in the first place) with the upstream version and some glue code that builds a tarball from the upstream version. Note that this would either require an upstream contribution for the clever-tests to be usable as a flake directly, or the flake for nixos-generators to include the repository as a non-flake flake input which would allow referencing the specific files in there without having to copy or reimplement them (read: an additional dependency in the flake of this repository).

Alternatively said functionality could be dropped, which would slim down nixos-generators' job in the kexec matter a mere command line interface to the upstream kexecTree with a little bit of glue code to generate the tar from it. Personally I think that while that would be a lot less maintenance overhead, it'd also remove functionality that adds value, at least for those who are using the justdoit components, plus it'd be a breaking change as configurations using said values won't evaluate any more.

benaryorg avatar Jul 24 '23 23:07 benaryorg

It appears this pr is stale, I would like to fix this (I am going to buy a raspberry pi and would like to use nixos anywhere with it). Any idea how I could begin?

IogaMaster avatar Nov 28 '23 18:11 IogaMaster

probably taking the relevant bits from here: https://github.com/nix-community/nixos-images/blob/main/nix/kexec-installer/module.nix

Lassulus avatar Nov 28 '23 18:11 Lassulus