diff options
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/coreboot-payload-coreinfo/default.nix | 15 | ||||
-rw-r--r-- | pkgs/coreboot-payload-nvramcui/default.nix | 4 | ||||
-rw-r--r-- | pkgs/coreboot-payload-seabios/default.nix | 27 | ||||
-rw-r--r-- | pkgs/coreboot-payload-tianocore/default.nix | 11 | ||||
-rw-r--r-- | pkgs/coreboot-payload-tint/default.nix | 5 | ||||
-rw-r--r-- | pkgs/coreboot/default.nix | 13 | ||||
-rw-r--r-- | pkgs/overlay.nix | 5 |
7 files changed, 65 insertions, 15 deletions
diff --git a/pkgs/coreboot-payload-coreinfo/default.nix b/pkgs/coreboot-payload-coreinfo/default.nix index 6513031330c5..21e00031166e 100644 --- a/pkgs/coreboot-payload-coreinfo/default.nix +++ b/pkgs/coreboot-payload-coreinfo/default.nix @@ -1,17 +1,18 @@ -{ coreboot, lib, stdenv, writeText, coreinfoConfig ? {}, ... }: +{ coreboot +, lib +, stdenv +, writeText +, coreinfoConfig ? {} +}: -let - filteredConfig = lib.filterAttrs (n: v: v != null) coreinfoConfig; - lines = lib.mapAttrsToList (name: value: "${name}=${value}") filteredConfig; - configFile = writeText "config" (lib.concatStringsSep "\n" lines); -in stdenv.mkDerivation rec { +stdenv.mkDerivation rec { pname = "coreboot-payload-coreinfo"; inherit (coreboot.drvAttrs) version src postPatch; preConfigure = "cd payloads/coreinfo"; configurePhase = '' runHook preConfigure - cp ${configFile} .config + cp ${coreboot.writeConfig coreinfoConfig} .config make olddefconfig runHook postConfigure ''; diff --git a/pkgs/coreboot-payload-nvramcui/default.nix b/pkgs/coreboot-payload-nvramcui/default.nix index 0c0eddfd5513..418f809960d7 100644 --- a/pkgs/coreboot-payload-nvramcui/default.nix +++ b/pkgs/coreboot-payload-nvramcui/default.nix @@ -1,4 +1,6 @@ -{ coreboot, stdenv, ... }: +{ coreboot +, stdenv +}: stdenv.mkDerivation rec { pname = "coreboot-payload-nvramcui"; diff --git a/pkgs/coreboot-payload-seabios/default.nix b/pkgs/coreboot-payload-seabios/default.nix new file mode 100644 index 000000000000..cd8b21559e7a --- /dev/null +++ b/pkgs/coreboot-payload-seabios/default.nix @@ -0,0 +1,27 @@ +{ seabios +, coreboot +, stdenv +, fetchurl +, seabiosConfig ? { CONFIG_COREBOOT = "y"; CONFIG_VGA_COREBOOT = "y"; CONFIG_BUILD_VGABIOS = "y"; } +}: + +seabios.overrideAttrs (oA: rec { + pname = "coreboot-payload-seabios"; + + version = "1.14.0"; + src = fetchurl { + url = "https://www.seabios.org/downloads/seabios-${version}.tar.gz"; + sha256 = "1zc1brgafbbf5hmdr1qc1p859cabpz73l8sklq83xa4sn9icqw7b"; + }; + + configurePhase = '' + runHook preConfigure + cp ${coreboot.writeConfig seabiosConfig} .config + make olddefconfig + runHook postConfigure + ''; + installPhase = '' + install -D out/bios.bin.elf -t $out + [ -f out/vgabios.bin ] && install -D out/vgabios.bin -t $out + ''; +}) diff --git a/pkgs/coreboot-payload-tianocore/default.nix b/pkgs/coreboot-payload-tianocore/default.nix index 8d9c29dc5329..07e90a97d984 100644 --- a/pkgs/coreboot-payload-tianocore/default.nix +++ b/pkgs/coreboot-payload-tianocore/default.nix @@ -1,4 +1,13 @@ -{ fetchFromGitHub, python2, stdenv, libuuid, bc, utillinux, nasm, iasl, seabios }: +{ fetchFromGitHub +, python2 +, stdenv +, libuuid +, bc +, utillinux +, nasm +, iasl +, seabios +}: # we can not override the source in edk2, so we had to copy the entire thing diff --git a/pkgs/coreboot-payload-tint/default.nix b/pkgs/coreboot-payload-tint/default.nix index 4714f701cc30..a410a46a254d 100644 --- a/pkgs/coreboot-payload-tint/default.nix +++ b/pkgs/coreboot-payload-tint/default.nix @@ -1,4 +1,7 @@ -{ coreboot, stdenv, fetchurl, ... }: +{ coreboot +, stdenv +, fetchurl +}: # the original tint does not support building as a coreboot payload # the patches from the coreboot repo require building tint in-tree diff --git a/pkgs/coreboot/default.nix b/pkgs/coreboot/default.nix index 044e3667d650..3a24dd92fb54 100644 --- a/pkgs/coreboot/default.nix +++ b/pkgs/coreboot/default.nix @@ -44,9 +44,12 @@ let ''; }; - filteredConfig = lib.filterAttrs (n: v: v != null) corebootConfig; - lines = lib.mapAttrsToList (name: value: "${name}=${value}") filteredConfig; - configFile = writeText "config" (lib.concatStringsSep "\n" lines); + writeConfig = config: let + filteredConfig = lib.filterAttrs (n: v: v != null) config; + lines = lib.mapAttrsToList (name: value: "${name}=${value}") filteredConfig; + configFile = writeText "config" (lib.concatStringsSep "\n" lines); + in configFile; + in stdenv.mkDerivation rec { pname = "coreboot"; @@ -61,7 +64,7 @@ in stdenv.mkDerivation rec { configurePhase = '' runHook preConfigure - cp ${configFile} .config + cp ${writeConfig corebootConfig} .config make olddefconfig runHook postConfigure ''; @@ -72,6 +75,6 @@ in stdenv.mkDerivation rec { ''; passthru = { - inherit toolchain configFile; + inherit toolchain writeConfig corebootConfig; }; } diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix index 780032ae1b6c..37af2f9e81ce 100644 --- a/pkgs/overlay.nix +++ b/pkgs/overlay.nix @@ -2,8 +2,13 @@ final: prev: let inherit (final) callPackage; in { coreboot = callPackage ./coreboot {}; + + # primary payloads coreboot-payload-grub2 = callPackage ./coreboot-payload-grub2 {}; coreboot-payload-tianocore = callPackage ./coreboot-payload-tianocore {}; + coreboot-payload-seabios = callPackage ./coreboot-payload-seabios {}; + + # secondary payloads coreboot-payload-nvramcui = callPackage ./coreboot-payload-nvramcui {}; coreboot-payload-tint = callPackage ./coreboot-payload-tint {}; coreboot-payload-coreinfo = callPackage ./coreboot-payload-coreinfo {}; |