diff --git a/pkgs/applications/virtualization/cbfstool/default.nix b/pkgs/applications/virtualization/cbfstool/default.nix deleted file mode 100644 index 9cdaec1c698a..000000000000 --- a/pkgs/applications/virtualization/cbfstool/default.nix +++ /dev/null @@ -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; - }; -} - diff --git a/pkgs/tools/misc/cbmem/default.nix b/pkgs/tools/misc/cbmem/default.nix deleted file mode 100644 index d2efea1c03a6..000000000000 --- a/pkgs/tools/misc/cbmem/default.nix +++ /dev/null @@ -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; - }; -} - diff --git a/pkgs/tools/misc/coreboot-utils/default.nix b/pkgs/tools/misc/coreboot-utils/default.nix new file mode 100644 index 000000000000..3f6988f1f657 --- /dev/null +++ b/pkgs/tools/misc/coreboot-utils/default.nix @@ -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; + }; +} diff --git a/pkgs/tools/misc/ifdtool/default.nix b/pkgs/tools/misc/ifdtool/default.nix deleted file mode 100644 index 7fe4ad86b8eb..000000000000 --- a/pkgs/tools/misc/ifdtool/default.nix +++ /dev/null @@ -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; - }; -} - diff --git a/pkgs/tools/misc/intelmetool/default.nix b/pkgs/tools/misc/intelmetool/default.nix deleted file mode 100644 index 87aa7df8d6d7..000000000000 --- a/pkgs/tools/misc/intelmetool/default.nix +++ /dev/null @@ -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; - }; -} diff --git a/pkgs/tools/misc/nvramtool/default.nix b/pkgs/tools/misc/nvramtool/default.nix deleted file mode 100644 index ecff547e9513..000000000000 --- a/pkgs/tools/misc/nvramtool/default.nix +++ /dev/null @@ -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; - }; -} - diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 52d50be25d8c..26a322c72d35 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1394,6 +1394,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 { }; @@ -11375,8 +11389,6 @@ in ilmbase = callPackage ../development/libraries/ilmbase { }; - intelmetool = callPackage ../tools/misc/intelmetool { }; - imlib = callPackage ../development/libraries/imlib { libpng = libpng12; }; @@ -15000,14 +15012,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 { };