[Nix-dev] Please explain grub installer

Marc Weber marco-oweber at gmx.de
Tue Feb 4 12:58:35 CET 2014


Excerpts from Sergey Mironov's message of Tue Feb 04 12:04:45 +0100 2014:
 
> >From the perl side, ./install-grub.pl reads ARGV[0] and ARGV[1].
> ARGV[0] turns out to contain the path to XML. OK. And ARVG[1] contains
> a mysterious config. AFAIK it should point to the folder with kernel,
> initrd and others. But where does it come from?

Nix has "state", too. That state is history of previous nixos-rebuild
boot/switch runs. That state is recorded in /nix/var/nix/gcroots/profiles/system* or such
Those previous installations get passed or are read by the perl script.

They get turned into the grub menu. The older bash script also has had
"sub configurations" which broke when the script was rewritten in perl.

Now those system links contain everything which is needed to make up the
system:
  - the kernel
  - the system environemnt
  - the configuration name
  - ..

It should be trivial to follow nixpkgs/nixos/* and grep for the perl
script usage.

Marc Weber


More information about the nix-dev mailing list