[Nix-dev] Grub2 For EFI-based Systems

Shea Levy shea at shealevy.com
Tue Mar 8 22:05:59 CET 2011


Hi all,

This patch provides a nixpkg called grub2efi that results in a grub2 
targeted at systems that use a UEFI for booting. Additionally, fetchbzr 
is updated with a leaveDotBzr parameter, which is set to false by 
default for compatibility with nix-prefetch-bzr (without this patch, the 
checksum generated by nix-prefetch-bzr only works with fetchbzr if 
nix-prefetch-bzr was run with $NIX_PREFETCH_BZR_LEAVE_DOT_BZR set to 1). 
This changes the behaviour of fetchbzr for any packages which currently 
use it (if any), but I think leaving out the .bzr directories is a saner 
default. I'll run a check on nixpkgs this evening to see if any packages 
use it and update all of them to set leaveDotBzr to true.

Work left to do on this:

    * Support targeting 64-bit UEFI architectures booting a 32-bit
      kernel, and vice-versa. Any resources on any cross-compilation
      tools in nixpkgs would be greatly appreciated.
    * Provide a clean, clear error message for those trying to target
      UEFIs with architectures other than i386 and x86_64, which are the
      only architectures that grub2 currently supports. I know elilo
      supports ia64, and I don't know of any UEFI systems for any other
      architectures.
    * Make sure all the scripts installed have any nix-specific
      modifications made beyond just patching shebangs. In particular, I
      know for sure that grub-install is interpreted by #!${bash}/bin/sh
      and runs `which efibootmgr`, which results in a warning that there
      is no which command.
    * Write (or update existing) NixOS modules to allow for as much
      automation of using grub2 for UEFI booting as possible for NixOS
      systems. Ideally this would include a UEFI-bootable livecd so that
      the UEFI boot manager can be informed of the bootloader location
      during initial installation.
    * Find a way to get the 1.99~rc1 release without requiring bazaar,
      autogen, autoconf, and automake. There is a tarball on
      ftp://alpha.gnu.org/gnu/grub/, but it has a ~ in the name, which
      makes fetchurl choke. Storing the tarball with a changed name in
      the nixpkgs repo seems overkill considering how few people will
      use this package, but storing it elsewhere on an official nix ftp
      server might make sense.
    * Get rid of a noisy error message in the output from fetchbzr. By
      default, bzr tries to keep a log in $HOME/.bzr.log, so fetchbzr
      complains about a missing /homeless-shelter/.bzr.log. We could
      just send stderr to /dev/null for the bzr checkout, but I'll look
      to see if there's a way to run bazaar without a log, or if there's
      a better place to keep the log.

Cheers,
Shea Levy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20110308/5a74c85b/attachment.html 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: grub2efi.patch
Url: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20110308/5a74c85b/attachment.pl 


More information about the nix-dev mailing list