flashrom: add option for google chromebook fork

master
Adam Joseph 2 years ago
parent 6243fa9245
commit 576e50fc85

@ -1,34 +1,53 @@
{ stdenv
, lib
, fetchgit
, fetchFromGitHub
, installShellFiles
, libftdi1
, libusb1
, pciutils
, pkg-config
# use google's out-of-tree flashrom which can manipulate the
# write-protection registers of the chromebooks' on-board flash
# chips
, forChromebook ? false
}:
stdenv.mkDerivation {
pname = "flashrom";
version = "1.2+wp";
version = if !forChromebook then "1.2+wp" else "0.9.9+d2da98-google";
src = fetchFromGitHub {
owner = "flashrom";
repo = "flashrom";
rev = "cd9b7b427d19e591c1091cb783a51951ef3aeffc";
sha256 = "sha256-gK/z+WkEHFmT/dYnNLMn4Cb2ESBfqipc19ZVxmaZabQ=";
};
src =
if !forChromebook
then fetchFromGitHub {
owner = "flashrom";
repo = "flashrom";
rev = "cd9b7b427d19e591c1091cb783a51951ef3aeffc";
sha256 = "sha256-gK/z+WkEHFmT/dYnNLMn4Cb2ESBfqipc19ZVxmaZabQ=";
} else fetchgit {
url = "https://chromium.googlesource.com/chromiumos/third_party/flashrom";
rev = "d2da987986cf2b7f048174ba339907cc760b1c3d";
hash = "sha256-nB8B0MXjVpAsg4+0VvO5jqRBsmEHdllgIMkTmaBJ6gE=";
};
nativeBuildInputs = [ pkg-config installShellFiles ];
buildInputs = lib.optional (!stdenv.hostPlatform.isStatic) libftdi1
++ [ libusb1 pciutils ];
patches = [
./0001-implement-wp-enable-disable-for-gigadevice-flash-chi.patch
./0002-layout.c-allow-nested-regions.patch
];
patches =
if !forChromebook then [
./0001-implement-wp-enable-disable-for-gigadevice-flash-chi.patch
./0002-layout.c-allow-nested-regions.patch
] else [
../platform/kevin/chromebook-flashrom-kludges.patch
];
makeFlags = [ "PREFIX=$(out)" "libinstall" ];
makeFlags = if !forChromebook then [
"PREFIX=$(out)" "libinstall"
] else [
"PREFIX=$(out)" "install"
];
meta = with lib; {
homepage = "https://www.flashrom.org";

Loading…
Cancel
Save