2013-05-27 11:10:19 +01:00
|
|
|
{ stdenv, fetchgit, pkgconfig, libuuid, openssl }:
|
|
|
|
|
2013-08-28 20:52:07 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2013-05-27 11:10:19 +01:00
|
|
|
version = "20130507";
|
|
|
|
checkout = "25/50225/2";
|
2013-08-28 20:52:07 +01:00
|
|
|
|
2013-05-27 11:10:19 +01:00
|
|
|
name = "vboot_reference-${version}";
|
|
|
|
|
|
|
|
src = fetchgit {
|
2015-09-01 10:09:18 +01:00
|
|
|
url = https://chromium.googlesource.com/chromiumos/platform/vboot_reference;
|
2013-05-27 11:10:19 +01:00
|
|
|
rev = "refs/changes/${checkout}";
|
2016-06-02 12:26:44 +01:00
|
|
|
sha256 = "14d3a93ha5k4al4ib43nyn1ppx7kgb12xw6mkflhx8nxmx8827nc";
|
2013-05-27 11:10:19 +01:00
|
|
|
};
|
|
|
|
|
2016-09-02 11:13:00 +01:00
|
|
|
buildInputs = [ pkgconfig openssl stdenv.cc.libc.static ] ++
|
2013-05-27 22:36:43 +01:00
|
|
|
(if libuuid == null
|
|
|
|
then []
|
|
|
|
else [ (stdenv.lib.overrideDerivation libuuid
|
|
|
|
(args: { configureFlags = args.configureFlags + " --enable-static"; })) ]);
|
2013-05-27 11:10:19 +01:00
|
|
|
|
2013-08-28 20:52:07 +01:00
|
|
|
arch = if stdenv.system == "x86_64-linux" then "x86_64"
|
|
|
|
else if stdenv.system == "i686-linux" then "x86"
|
|
|
|
else throw "vboot_reference for: ${stdenv.system} not supported!";
|
|
|
|
|
2013-05-27 11:10:19 +01:00
|
|
|
buildPhase = ''
|
|
|
|
make ARCH=${arch} `pwd`/build/cgpt/cgpt
|
|
|
|
make ARCH=${arch} `pwd`/build/utility/vbutil_kernel
|
|
|
|
make ARCH=${arch} `pwd`/build/utility/vbutil_key
|
|
|
|
make ARCH=${arch} `pwd`/build/utility/vbutil_keyblock
|
|
|
|
make ARCH=${arch} `pwd`/build/utility/vbutil_firmware
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2014-06-30 13:56:10 +01:00
|
|
|
mkdir -p $out/bin
|
2013-05-27 11:10:19 +01:00
|
|
|
cp build/cgpt/cgpt $out/bin
|
|
|
|
cp build/utility/vbutil_kernel $out/bin
|
|
|
|
cp build/utility/vbutil_key $out/bin
|
|
|
|
cp build/utility/vbutil_keyblock $out/bin
|
|
|
|
cp build/utility/vbutil_firmware $out/bin
|
|
|
|
'';
|
2013-08-28 20:52:07 +01:00
|
|
|
|
|
|
|
meta = {
|
2013-10-06 10:49:53 +01:00
|
|
|
description = "Chrome OS partitioning and kernel signing tools";
|
2013-08-28 20:52:07 +01:00
|
|
|
license = stdenv.lib.licenses.bsd3;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
2013-05-27 11:10:19 +01:00
|
|
|
}
|