[Nix-dev] loopback.cfg grub ISO boot

Peter Jones mlists at pmade.com
Wed Dec 16 20:34:19 CET 2015


pille <pille+nixos+mailinglist at struction.de> writes:
> i recently configured my grub2 to boot some linux live-CD/DVD-ISOs via
> its loopback capability. while figuring out the parameters to get them
> booted is extremly painful and error-prone. but i found a nice
> "standard", which i'm asking you to implement.
>
> it's boils down to provide a loopback.cfg inside the ISO that can be
> sourced by grub's config and has access to some prepared variables.
> i guess it can be generated without much overhead, since you need to
> maintain your isolinux.cfg anyway.

Actually, this is really easy to do:

  1) Configure grub to load a NixOS ISO via loopback

  2) Make sure the ISO has a disk label, in my example it's ISOHOST

  3) Set up boot.initrd.postDeviceCommands so that NixOS boots off the ISO

I have an example nix file here:

  https://github.com/pjones/nixpkgs/blob/gpg-iso/nixos/modules/installer/cd-dvd/gpg-iso.nix

Some additional notes can be found here:

  https://github.com/pjones/encryption-utils/blob/master/doc/offline-usb-drive.md

-- 
Peter Jones, Founder, Devalot.com
Defending the honor of good code



More information about the nix-dev mailing list