coreboot-utils: init at 4.10

Build various tools from the coreboot tree with a generic builder for better
maintainability and provide a buildEnv with all of them, similar to other
distributions' coreboot-utils package.
This commit is contained in:
Milan Pässler 2019-08-31 17:22:49 +02:00
parent ea3bae4f4d
commit d977d48baf
7 changed files with 118 additions and 167 deletions

View file

@ -1,35 +0,0 @@
{ stdenv, fetchurl, iasl, flex, bison }:
stdenv.mkDerivation rec {
pname = "cbfstool";
version = "4.9";
src = fetchurl {
url = "https://coreboot.org/releases/coreboot-${version}.tar.xz";
sha256 = "0xkai65d3z9fivwscbkm7ndcw2p9g794xz8fwdv979w77n5qsdij";
};
nativeBuildInputs = [ flex bison ];
buildInputs = [ iasl ];
buildPhase = ''
export LEX=${flex}/bin/flex
make -C util/cbfstool
'';
installPhase = ''
mkdir -p $out/bin
cp util/cbfstool/cbfstool $out/bin
cp util/cbfstool/fmaptool $out/bin
cp util/cbfstool/rmodtool $out/bin
'';
meta = with stdenv.lib; {
description = "Management utility for CBFS formatted ROM images";
homepage = https://www.coreboot.org;
license = licenses.gpl2;
maintainers = [ maintainers.tstrobel ];
platforms = platforms.linux;
};
}

View file

@ -1,28 +0,0 @@
{ stdenv, fetchurl }:
stdenv.mkDerivation rec {
pname = "cbmem";
version = "4.9";
src = fetchurl {
url = "https://coreboot.org/releases/coreboot-${version}.tar.xz";
sha256 = "0xkai65d3z9fivwscbkm7ndcw2p9g794xz8fwdv979w77n5qsdij";
};
buildPhase = ''
make -C util/cbmem
'';
installPhase = ''
install -Dm755 util/cbmem/cbmem $out/bin/cbmem
'';
meta = with stdenv.lib; {
description = "Read coreboot timestamps and console logs";
homepage = "https://www.coreboot.org";
license = licenses.gpl2;
maintainers = [ maintainers.petabyteboy ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,104 @@
{ stdenv, fetchurl, zlib, pciutils, coreutils, acpica-tools, iasl, makeWrapper, gnugrep, gnused, file, buildEnv }:
let
version = "4.10";
meta = with stdenv.lib; {
description = "Various coreboot-related tools";
homepage = "https://www.coreboot.org";
license = licenses.gpl2;
maintainers = [ maintainers.petabyteboy ];
platforms = platforms.linux;
};
generic = { pname, path ? "util/${pname}", ... }@args: stdenv.mkDerivation (rec {
inherit pname version meta;
src = fetchurl {
url = "https://coreboot.org/releases/coreboot-${version}.tar.xz";
sha256 = "1jsiz17afi2lqg1jv6lsl8s05w7vr7iwgg86y2qp369hcz6kcwfa";
};
enableParallelBuilding = true;
postPatch = ''
cd ${path}
'';
makeFlags = [
"INSTALL=install"
"PREFIX=${placeholder "out"}"
];
} // args);
utils = {
msrtool = generic {
pname = "msrtool";
meta.description = "Dump chipset-specific MSR registers";
buildInputs = [ pciutils zlib ];
preConfigure = "export INSTALL=install";
};
cbmem = generic {
pname = "cbmem";
meta.description = "Coreboot console log reader";
};
ifdtool = generic {
pname = "ifdtool";
meta.description = "Extract and dump Intel Firmware Descriptor information";
};
intelmetool = generic {
pname = "intelmetool";
meta.description = "Dump interesting things about Management Engine";
buildInputs = [ pciutils zlib ];
};
cbfstool = generic {
pname = "cbfstool";
meta.description = "Management utility for CBFS formatted ROM images";
};
nvramtool = generic {
pname = "nvramtool";
meta.description = "Read and write coreboot parameters and display information from the coreboot table in CMOS/NVRAM";
};
superiotool = generic {
pname = "superiotool";
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";
buildInputs = [ pciutils zlib ];
};
ectool = generic {
pname = "ectool";
meta.description = "Dump the RAM of a laptop's Embedded/Environmental Controller (EC)";
meta.platforms = [ "x86_64-linux" "i686-linux" ];
preInstall = "mkdir -p $out/sbin";
};
inteltool = generic {
pname = "inteltool";
meta.description = "Provides information about Intel CPU/chipset hardware configuration (register contents, MSRs, etc)";
buildInputs = [ pciutils zlib ];
};
amdfwtool = generic {
pname = "amdfwtool";
meta.description = "Create AMD firmware combination";
installPhase = "install -Dm755 amdfwtool $out/bin/amdfwtool";
};
acpidump-all = generic {
pname = "acpidump-all";
path = "util/acpi";
meta.description = "Walk through all ACPI tables with their addresses";
nativeBuildInputs = [ makeWrapper ];
dontBuild = true;
installPhase = "install -Dm755 acpidump-all $out/bin/acpidump-all";
postFixup = let
binPath = [ coreutils acpica-tools iasl gnugrep gnused file ];
in "wrapProgram $out/bin/acpidump-all --set PATH ${stdenv.lib.makeBinPath binPath}";
};
};
in utils // {
coreboot-utils = (buildEnv {
name = "coreboot-utils-${version}";
paths = stdenv.lib.attrValues utils;
postBuild = "rm -rf $out/sbin";
}) // {
inherit meta version;
};
}

View file

@ -1,28 +0,0 @@
{ stdenv, fetchurl }:
stdenv.mkDerivation rec {
pname = "ifdtool";
version = "4.9";
src = fetchurl {
url = "https://coreboot.org/releases/coreboot-${version}.tar.xz";
sha256 = "0xkai65d3z9fivwscbkm7ndcw2p9g794xz8fwdv979w77n5qsdij";
};
buildPhase = ''
make -C util/ifdtool
'';
installPhase = ''
install -Dm755 util/ifdtool/ifdtool $out/bin/ifdtool
'';
meta = with stdenv.lib; {
description = "Extract and dump Intel Firmware Descriptor information";
homepage = https://www.coreboot.org;
license = licenses.gpl2;
maintainers = [ maintainers.petabyteboy ];
platforms = platforms.linux;
};
}

View file

@ -1,32 +0,0 @@
{ stdenv, fetchgit, zlib, pciutils }:
stdenv.mkDerivation rec {
pname = "intelmetool";
version = "4.8.1";
src = fetchgit {
url = "https://review.coreboot.org/coreboot.git";
rev = version;
sha256 = "1gjisy9b7vgzjvy1fwaqhq3589yd59kkylv7apjmg5r2b3dv4zvr";
fetchSubmodules = false;
};
buildInputs = [ zlib pciutils ];
buildPhase = ''
make -C util/intelmetool
'';
installPhase = ''
mkdir -p $out/bin
cp util/intelmetool/intelmetool $out/bin
'';
meta = with stdenv.lib; {
description = "Dump interesting things about Management Engine";
homepage = https://www.coreboot.org/Nvramtool;
license = licenses.gpl2;
maintainers = [ maintainers.gnidorah ];
platforms = platforms.linux;
};
}

View file

@ -1,34 +0,0 @@
{ stdenv, fetchgit, iasl, flex, bison }:
stdenv.mkDerivation rec {
pname = "nvramtool";
version = "4.8.1";
src = fetchgit {
url = "http://review.coreboot.org/p/coreboot";
rev = "refs/tags/${version}";
sha256 = "0nrf840jg4fn38zcnz1r10w2yfpvrk1nvsrnbbgdbgkmpjxz0zw9";
};
nativeBuildInputs = [ flex bison ];
buildInputs = [ iasl ];
buildPhase = ''
export LEX=${flex}/bin/flex
make -C util/nvramtool
'';
installPhase = ''
mkdir -p $out/bin
cp util/nvramtool/nvramtool $out/bin
'';
meta = with stdenv.lib; {
description = "utility for reading/writing coreboot parameters and displaying information from the coreboot table in CMOS/NVRAM";
homepage = https://www.coreboot.org/Nvramtool;
license = licenses.gpl2;
maintainers = [ maintainers.cryptix ];
platforms = platforms.linux;
};
}

View file

@ -1382,6 +1382,20 @@ in
corebird = callPackage ../applications/networking/corebird { };
inherit (callPackage ../tools/misc/coreboot-utils { })
msrtool
cbmem
ifdtool
intelmetool
cbfstool
nvramtool
superiotool
ectool
inteltool
amdfwtool
acpidump-all
coreboot-utils;
corosync = callPackage ../servers/corosync { };
cowsay = callPackage ../tools/misc/cowsay { };
@ -11353,8 +11367,6 @@ in
ilmbase = callPackage ../development/libraries/ilmbase { };
intelmetool = callPackage ../tools/misc/intelmetool { };
imlib = callPackage ../development/libraries/imlib {
libpng = libpng12;
};
@ -14978,14 +14990,6 @@ in
seabios = callPackage ../applications/virtualization/seabios { };
cbfstool = callPackage ../applications/virtualization/cbfstool { };
ifdtool = callPackage ../tools/misc/ifdtool { };
cbmem = callPackage ../tools/misc/cbmem { };
nvramtool = callPackage ../tools/misc/nvramtool { };
vmfs-tools = callPackage ../tools/filesystems/vmfs-tools { };
pgbouncer = callPackage ../servers/sql/pgbouncer { };