mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
grub2: Make EFI grub work on aarch64
This commit is contained in:
parent
d7674dabba
commit
a9a706770a
1 changed files with 13 additions and 4 deletions
|
@ -12,12 +12,21 @@ let
|
|||
"x86_64-linux".target = "i386";
|
||||
};
|
||||
|
||||
efiSystems = {
|
||||
efiSystemsBuild = {
|
||||
"i686-linux".target = "i386";
|
||||
"x86_64-linux".target = "x86_64";
|
||||
"aarch64-linux".target = "aarch64";
|
||||
};
|
||||
|
||||
canEfi = any (system: stdenv.system == system) (mapAttrsToList (name: _: name) efiSystems);
|
||||
# For aarch64, we need to use '--target=aarch64-efi' when building,
|
||||
# but '--target=arm64-efi' when installing. Insanity!
|
||||
efiSystemsInstall = {
|
||||
"i686-linux".target = "i386";
|
||||
"x86_64-linux".target = "x86_64";
|
||||
"aarch64-linux".target = "arm64";
|
||||
};
|
||||
|
||||
canEfi = any (system: stdenv.system == system) (mapAttrsToList (name: _: name) efiSystemsBuild);
|
||||
inPCSystems = any (system: stdenv.system == system) (mapAttrsToList (name: _: name) pcSystems);
|
||||
|
||||
version = "2.x-2015-11-16";
|
||||
|
@ -89,11 +98,11 @@ stdenv.mkDerivation rec {
|
|||
patches = [ ./fix-bash-completion.patch ];
|
||||
|
||||
configureFlags = optional zfsSupport "--enable-libzfs"
|
||||
++ optionals efiSupport [ "--with-platform=efi" "--target=${efiSystems.${stdenv.system}.target}" "--program-prefix=" ];
|
||||
++ optionals efiSupport [ "--with-platform=efi" "--target=${efiSystemsBuild.${stdenv.system}.target}" "--program-prefix=" ];
|
||||
|
||||
# save target that grub is compiled for
|
||||
grubTarget = if efiSupport
|
||||
then "${efiSystems.${stdenv.system}.target}-efi"
|
||||
then "${efiSystemsInstall.${stdenv.system}.target}-efi"
|
||||
else if inPCSystems
|
||||
then "${pcSystems.${stdenv.system}.target}-pc"
|
||||
else "";
|
||||
|
|
Loading…
Reference in a new issue