mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 13:00:23 +00:00
grub2_ieee1275: init at 2.12
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -2894,6 +2894,10 @@ with pkgs;
|
||||
efiSupport = true;
|
||||
};
|
||||
|
||||
grub2_ieee1275 = grub2.override {
|
||||
ieee1275Support = true;
|
||||
};
|
||||
|
||||
grub2_light = grub2.override {
|
||||
zfsSupport = false;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user