Loading pkgs/tools/misc/grub/default.nix +24 −2 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ runtimeShell, zfs ? null, efiSupport ? false, ieee1275Support ? false, zfsSupport ? false, xenSupport ? false, xenPvhSupport ? false, Loading Loading @@ -61,6 +62,11 @@ let riscv64-linux.target = "riscv64"; }; ieee1275SystemsBuild = { x86_64-linux.target = "i386"; powerpc64-linux.target = "powerpc"; }; xenSystemsBuild = { i686-linux.target = "i386"; x86_64-linux.target = "x86_64"; Loading Loading @@ -90,8 +96,16 @@ let in assert zfsSupport -> zfs != null; assert !(efiSupport && (xenSupport || xenPvhSupport)); assert !(xenSupport && xenPvhSupport); assert lib.asserts.assertMsg ( lib.lists.length ( lib.lists.filter (x: x) [ efiSupport ieee1275Support xenSupport xenPvhSupport ] ) <= 1 # (0 == pc) ) "Only <= 1 of grub2's platform-related *Support options may be enabled at the same time"; stdenv.mkDerivation rec { pname = "grub"; Loading Loading @@ -677,6 +691,10 @@ stdenv.mkDerivation rec { "--target=${efiSystemsBuild.${stdenv.hostPlatform.system}.target}" "--program-prefix=" ] ++ lib.optionals ieee1275Support [ "--with-platform=ieee1275" "--target=${ieee1275SystemsBuild.${stdenv.hostPlatform.system}.target}" ] ++ lib.optionals xenSupport [ "--with-platform=xen" "--target=${xenSystemsBuild.${stdenv.hostPlatform.system}.target}" Loading @@ -690,6 +708,8 @@ stdenv.mkDerivation rec { grubTarget = if efiSupport then "${efiSystemsInstall.${stdenv.hostPlatform.system}.target}-efi" else if ieee1275Support then "${ieee1275SystemsBuild.${stdenv.hostPlatform.system}.target}-ieee1275" else lib.optionalString inPCSystems "${pcSystems.${stdenv.hostPlatform.system}.target}-pc"; Loading Loading @@ -733,6 +753,8 @@ stdenv.mkDerivation rec { platforms = if efiSupport then lib.attrNames efiSystemsBuild else if ieee1275Support then lib.attrNames ieee1275SystemsBuild else if xenSupport then lib.attrNames xenSystemsBuild else if xenPvhSupport then Loading pkgs/top-level/all-packages.nix +4 −0 Original line number Diff line number Diff line Loading @@ -2782,6 +2782,10 @@ with pkgs; efiSupport = true; }; grub2_ieee1275 = grub2.override { ieee1275Support = true; }; grub2_light = grub2.override { zfsSupport = false; }; Loading Loading
pkgs/tools/misc/grub/default.nix +24 −2 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ runtimeShell, zfs ? null, efiSupport ? false, ieee1275Support ? false, zfsSupport ? false, xenSupport ? false, xenPvhSupport ? false, Loading Loading @@ -61,6 +62,11 @@ let riscv64-linux.target = "riscv64"; }; ieee1275SystemsBuild = { x86_64-linux.target = "i386"; powerpc64-linux.target = "powerpc"; }; xenSystemsBuild = { i686-linux.target = "i386"; x86_64-linux.target = "x86_64"; Loading Loading @@ -90,8 +96,16 @@ let in assert zfsSupport -> zfs != null; assert !(efiSupport && (xenSupport || xenPvhSupport)); assert !(xenSupport && xenPvhSupport); assert lib.asserts.assertMsg ( lib.lists.length ( lib.lists.filter (x: x) [ efiSupport ieee1275Support xenSupport xenPvhSupport ] ) <= 1 # (0 == pc) ) "Only <= 1 of grub2's platform-related *Support options may be enabled at the same time"; stdenv.mkDerivation rec { pname = "grub"; Loading Loading @@ -677,6 +691,10 @@ stdenv.mkDerivation rec { "--target=${efiSystemsBuild.${stdenv.hostPlatform.system}.target}" "--program-prefix=" ] ++ lib.optionals ieee1275Support [ "--with-platform=ieee1275" "--target=${ieee1275SystemsBuild.${stdenv.hostPlatform.system}.target}" ] ++ lib.optionals xenSupport [ "--with-platform=xen" "--target=${xenSystemsBuild.${stdenv.hostPlatform.system}.target}" Loading @@ -690,6 +708,8 @@ stdenv.mkDerivation rec { grubTarget = if efiSupport then "${efiSystemsInstall.${stdenv.hostPlatform.system}.target}-efi" else if ieee1275Support then "${ieee1275SystemsBuild.${stdenv.hostPlatform.system}.target}-ieee1275" else lib.optionalString inPCSystems "${pcSystems.${stdenv.hostPlatform.system}.target}-pc"; Loading Loading @@ -733,6 +753,8 @@ stdenv.mkDerivation rec { platforms = if efiSupport then lib.attrNames efiSystemsBuild else if ieee1275Support then lib.attrNames ieee1275SystemsBuild else if xenSupport then lib.attrNames xenSystemsBuild else if xenPvhSupport then Loading
pkgs/top-level/all-packages.nix +4 −0 Original line number Diff line number Diff line Loading @@ -2782,6 +2782,10 @@ with pkgs; efiSupport = true; }; grub2_ieee1275 = grub2.override { ieee1275Support = true; }; grub2_light = grub2.override { zfsSupport = false; }; Loading