grub2_ieee1275: init at 2.12

This commit is contained in:
OPNA2608
2025-11-23 04:25:43 +01:00
parent ed66604a11
commit 44030658f2
2 changed files with 28 additions and 2 deletions

View File

@@ -26,6 +26,7 @@
runtimeShell,
zfs ? null,
efiSupport ? false,
ieee1275Support ? false,
zfsSupport ? false,
xenSupport ? false,
xenPvhSupport ? false,
@@ -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";
@@ -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";
@@ -618,6 +632,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}"
@@ -631,6 +649,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";
@@ -674,6 +694,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

View File

@@ -2894,6 +2894,10 @@ with pkgs;
efiSupport = true;
};
grub2_ieee1275 = grub2.override {
ieee1275Support = true;
};
grub2_light = grub2.override {
zfsSupport = false;
};