Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions pkgs/tools/misc/ectool/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
pname = "ectool";
version = "4.10";

src = fetchurl {
url = "https://coreboot.org/releases/coreboot-${version}.tar.xz";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If in the future another package is added for coreboot utils, it would probably be best if there was a package that was just all of them.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very valid point, I will look into it in the future.

sha256 = "1jsiz17afi2lqg1jv6lsl8s05w7vr7iwgg86y2qp369hcz6kcwfa";
};

buildPhase = ''
make -C util/ectool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about?

makeFlags = [ 
  "PREFIX=${placeholder "out"}"
  "INSTALL=install"
];

preBuild = ''
  cd util/ectool
'';

Then I think you can drop the custom installPhase, though upstream should really be using DESTDIR too

https://github.com/coreboot/coreboot/blob/master/util/ectool/Makefile#L38

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to stick to the pattern used in all other coreboot util packages for now, and refactor or merge them later.

'';

installPhase = ''
install -Dm755 util/ectool/ectool $out/bin/ectool
'';

meta = with stdenv.lib; {
description = "Dump the RAM of a laptop's Embedded/Environmental Controller (EC)";
homepage = "https://www.coreboot.org";
license = licenses.gpl2;
maintainers = [ maintainers.petabyteboy ];
platforms = [ "i686-linux" "x86_64-linux" ];
};
}

2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14979,6 +14979,8 @@ in

ifdtool = callPackage ../tools/misc/ifdtool { };

ectool = callPackage ../tools/misc/ectool { };

cbmem = callPackage ../tools/misc/cbmem { };

nvramtool = callPackage ../tools/misc/nvramtool { };
Expand Down