diff --git a/pkgs/tools/misc/grub/default.nix b/pkgs/tools/misc/grub/default.nix index 8b56473f87ab..ab5a6a94964a 100644 --- a/pkgs/tools/misc/grub/default.nix +++ b/pkgs/tools/misc/grub/default.nix @@ -28,6 +28,7 @@ efiSupport ? false, zfsSupport ? false, xenSupport ? false, + xenPvhSupport ? false, kbdcompSupport ? false, ckbcomp, }: @@ -65,6 +66,11 @@ let x86_64-linux.target = "x86_64"; }; + xenPvhSystemsBuild = { + i686-linux.target = "i386"; + x86_64-linux.target = "i386"; # Xen PVH is only i386 on x86. + }; + inPCSystems = lib.any (system: stdenv.hostPlatform.system == system) (lib.attrNames pcSystems); gnulib = fetchFromSavannah { @@ -90,7 +96,8 @@ let in assert zfsSupport -> zfs != null; -assert !(efiSupport && xenSupport); +assert !(efiSupport && (xenSupport || xenPvhSupport)); +assert !(xenSupport && xenPvhSupport); stdenv.mkDerivation rec { pname = "grub"; @@ -610,6 +617,10 @@ stdenv.mkDerivation rec { ++ lib.optionals xenSupport [ "--with-platform=xen" "--target=${xenSystemsBuild.${stdenv.hostPlatform.system}.target}" + ] + ++ lib.optionals xenPvhSupport [ + "--with-platform=xen_pvh" + "--target=${xenPvhSystemsBuild.${stdenv.hostPlatform.system}.target}" ]; # save target that grub is compiled for @@ -661,6 +672,8 @@ stdenv.mkDerivation rec { lib.attrNames efiSystemsBuild else if xenSupport then lib.attrNames xenSystemsBuild + else if xenPvhSupport then + lib.attrNames xenPvhSystemsBuild else platforms.gnu ++ platforms.linux; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7841c216b74f..6c4728ed19a3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3138,6 +3138,10 @@ with pkgs; xenSupport = true; }; + grub2_xen_pvh = grub2.override { + xenPvhSupport = true; + }; + grub4dos = callPackage ../tools/misc/grub4dos { stdenv = stdenv_32bit; };