grub: build grub2_xen_pvh
This enables the GRUB package to be built for the `xen_pvh` platform, which is needed to generate a corresponding GRUB image and boot PVH DomUs. Signed-off-by: Hongbo <hehongbo@mail.com> Co-authored-by: William Johansson <radar@radhuset.org>
This commit is contained in:
co-authored by
William Johansson
parent
f7212540bd
commit
2c3ce3eb31
@@ -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;
|
||||
|
||||
|
||||
@@ -3138,6 +3138,10 @@ with pkgs;
|
||||
xenSupport = true;
|
||||
};
|
||||
|
||||
grub2_xen_pvh = grub2.override {
|
||||
xenPvhSupport = true;
|
||||
};
|
||||
|
||||
grub4dos = callPackage ../tools/misc/grub4dos {
|
||||
stdenv = stdenv_32bit;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user