1 { lib, stdenv, fetchurl, zlib, pciutils, coreutils, acpica-tools, iasl, makeWrapper, gnugrep, gnused, file, buildEnv }:
6 commonMeta = with lib; {
7 description = "Various coreboot-related tools";
8 homepage = "https://www.coreboot.org";
9 license = licenses.gpl2;
10 maintainers = with maintainers; [ petabyteboy felixsinger ];
11 platforms = platforms.linux;
14 generic = { pname, path ? "util/${pname}", ... }@args: stdenv.mkDerivation (rec {
15 inherit pname version;
18 url = "https://coreboot.org/releases/coreboot-${version}.tar.xz";
19 sha256 = "0sl50aajnah4a138sr3jjm3ydc8gfh5vvlhviz3ypp95b9jdlya7";
22 enableParallelBuilding = true;
30 "PREFIX=${placeholder "out"}"
33 meta = commonMeta // args.meta;
34 } // (removeAttrs args ["meta"]));
39 meta.description = "Dump chipset-specific MSR registers";
40 buildInputs = [ pciutils zlib ];
41 preConfigure = "export INSTALL=install";
45 meta.description = "Coreboot console log reader";
49 meta.description = "Extract and dump Intel Firmware Descriptor information";
51 intelmetool = generic {
52 pname = "intelmetool";
53 meta.description = "Dump interesting things about Management Engine";
54 buildInputs = [ pciutils zlib ];
58 meta.description = "Management utility for CBFS formatted ROM images";
62 meta.description = "Read and write coreboot parameters and display information from the coreboot table in CMOS/NVRAM";
64 superiotool = generic {
65 pname = "superiotool";
66 meta.description = "User-space utility to detect Super I/O of a mainboard and provide detailed information about the register contents of the Super I/O";
67 buildInputs = [ pciutils zlib ];
71 meta.description = "Dump the RAM of a laptop's Embedded/Environmental Controller (EC)";
72 meta.platforms = [ "x86_64-linux" "i686-linux" ];
73 preInstall = "mkdir -p $out/sbin";
77 meta.description = "Provides information about Intel CPU/chipset hardware configuration (register contents, MSRs, etc)";
78 buildInputs = [ pciutils zlib ];
82 meta.description = "Create AMD firmware combination";
83 installPhase = "install -Dm755 amdfwtool $out/bin/amdfwtool";
85 acpidump-all = generic {
86 pname = "acpidump-all";
88 meta.description = "Walk through all ACPI tables with their addresses";
89 nativeBuildInputs = [ makeWrapper ];
91 installPhase = "install -Dm755 acpidump-all $out/bin/acpidump-all";
93 binPath = [ coreutils acpica-tools iasl gnugrep gnused file ];
94 in "wrapProgram $out/bin/acpidump-all --set PATH ${lib.makeBinPath binPath}";
99 coreboot-utils = (buildEnv {
100 name = "coreboot-utils-${version}";
101 paths = lib.attrValues utils;
102 postBuild = "rm -rf $out/sbin";