aboutsummaryrefslogtreecommitdiff
path: root/pkgs
diff options
context:
space:
mode:
authorMilan Pässler <milan@petabyte.dev>2020-10-11 16:11:57 +0200
committerMilan Pässler <milan@petabyte.dev>2020-10-11 20:05:25 +0200
commit8c5f8519ba80ed7295ee4fe5c8e5a446b54da6a3 (patch)
tree844a55d3743869a5af7f9ab654d4c755c89e9bf8 /pkgs
parentcff03704dd7fe2f09b17e56598cf2452077f711a (diff)
add tint, nvramcui, coreinfo
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/coreboot-payload-coreinfo/default.nix19
-rw-r--r--pkgs/coreboot-payload-nvramcui/default.nix9
-rw-r--r--pkgs/coreboot-payload-tint/default.nix21
-rw-r--r--pkgs/coreboot/default.nix15
-rw-r--r--pkgs/overlay.nix3
5 files changed, 60 insertions, 7 deletions
diff --git a/pkgs/coreboot-payload-coreinfo/default.nix b/pkgs/coreboot-payload-coreinfo/default.nix
new file mode 100644
index 000000000000..6513031330c5
--- /dev/null
+++ b/pkgs/coreboot-payload-coreinfo/default.nix
@@ -0,0 +1,19 @@
+{ 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 {
+ pname = "coreboot-payload-coreinfo";
+ inherit (coreboot.drvAttrs) version src postPatch;
+
+ preConfigure = "cd payloads/coreinfo";
+ configurePhase = ''
+ runHook preConfigure
+ cp ${configFile} .config
+ make olddefconfig
+ runHook postConfigure
+ '';
+ installPhase = "install -D build/coreinfo.elf -t $out";
+}
diff --git a/pkgs/coreboot-payload-nvramcui/default.nix b/pkgs/coreboot-payload-nvramcui/default.nix
new file mode 100644
index 000000000000..0c0eddfd5513
--- /dev/null
+++ b/pkgs/coreboot-payload-nvramcui/default.nix
@@ -0,0 +1,9 @@
+{ coreboot, stdenv, ... }:
+
+stdenv.mkDerivation rec {
+ pname = "coreboot-payload-nvramcui";
+ inherit (coreboot.drvAttrs) version src postPatch;
+
+ preConfigure = "cd payloads/nvramcui";
+ installPhase = "install -D nvramcui.elf -t $out";
+}
diff --git a/pkgs/coreboot-payload-tint/default.nix b/pkgs/coreboot-payload-tint/default.nix
new file mode 100644
index 000000000000..4714f701cc30
--- /dev/null
+++ b/pkgs/coreboot-payload-tint/default.nix
@@ -0,0 +1,21 @@
+{ 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
+# this makes everything a bit more complicated here
+
+stdenv.mkDerivation rec {
+ pname = "coreboot-payload-tint";
+ version = "0.04+nmu1";
+ inherit (coreboot.drvAttrs) src postPatch;
+
+ preConfigure = "cd payloads/external/tint";
+ preBuild = ''
+ tar -xf ${fetchurl {
+ url = "https://mirror.fsf.org/trisquel/pool/main/t/tint/tint_${version}.tar.gz";
+ sha256 = "17gbga1lha9yp5hpyr5vn1sc93fx413cksxmpyl8zv3b5rjvzsy1";
+ }}
+ mv tint{-${version},}
+ '';
+ installPhase = "install -D tint/tint.elf -t $out";
+}
diff --git a/pkgs/coreboot/default.nix b/pkgs/coreboot/default.nix
index 9e224c71a727..044e3667d650 100644
--- a/pkgs/coreboot/default.nix
+++ b/pkgs/coreboot/default.nix
@@ -52,17 +52,18 @@ in stdenv.mkDerivation rec {
pname = "coreboot";
inherit version src;
- configurePhase = ''
- cp ${configFile} .config
- make olddefconfig
- '';
-
- buildPhase = ''
+ postPatch = ''
rm -rf util/crossgcc
cp -r ${toolchain} util/crossgcc
chmod u+rwX -R util/crossgcc
patchShebangs util/xcompile/xcompile
- make
+ '';
+
+ configurePhase = ''
+ runHook preConfigure
+ cp ${configFile} .config
+ make olddefconfig
+ runHook postConfigure
'';
installPhase = ''
diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix
index b600349970bc..780032ae1b6c 100644
--- a/pkgs/overlay.nix
+++ b/pkgs/overlay.nix
@@ -4,4 +4,7 @@ in {
coreboot = callPackage ./coreboot {};
coreboot-payload-grub2 = callPackage ./coreboot-payload-grub2 {};
coreboot-payload-tianocore = callPackage ./coreboot-payload-tianocore {};
+ coreboot-payload-nvramcui = callPackage ./coreboot-payload-nvramcui {};
+ coreboot-payload-tint = callPackage ./coreboot-payload-tint {};
+ coreboot-payload-coreinfo = callPackage ./coreboot-payload-coreinfo {};
}