2013-05-27 12:10:19 +02:00
|
|
|
{ stdenv, fetchgit, pkgconfig, libuuid, openssl }:
|
|
|
|
|
2013-08-28 21:52:07 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2013-05-27 12:10:19 +02:00
|
|
|
version = "20130507";
|
|
|
|
checkout = "25/50225/2";
|
2013-08-28 21:52:07 +02:00
|
|
|
|
2013-05-27 12:10:19 +02:00
|
|
|
name = "vboot_reference-${version}";
|
|
|
|
|
|
|
|
src = fetchgit {
|
2015-09-01 11:09:18 +02:00
|
|
|
url = https://chromium.googlesource.com/chromiumos/platform/vboot_reference;
|
2013-05-27 12:10:19 +02:00
|
|
|
rev = "refs/changes/${checkout}";
|
2016-06-02 13:26:44 +02:00
|
|
|
sha256 = "14d3a93ha5k4al4ib43nyn1ppx7kgb12xw6mkflhx8nxmx8827nc";
|
2013-05-27 12:10:19 +02:00
|
|
|
};
|
|
|
|
|
2016-09-02 12:13:00 +02:00
|
|
|
buildInputs = [ pkgconfig openssl stdenv.cc.libc.static ] ++
|
2013-05-27 23:36:43 +02:00
|
|
|
(if libuuid == null
|
|
|
|
then []
|
|
|
|
else [ (stdenv.lib.overrideDerivation libuuid
|
|
|
|
(args: { configureFlags = args.configureFlags + " --enable-static"; })) ]);
|
2013-05-27 12:10:19 +02:00
|
|
|
|
2013-08-28 21:52:07 +02: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 12:10:19 +02: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 14:56:10 +02:00
|
|
|
mkdir -p $out/bin
|
2013-05-27 12:10:19 +02: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 21:52:07 +02:00
|
|
|
|
|
|
|
meta = {
|
2013-10-06 11:49:53 +02:00
|
|
|
description = "Chrome OS partitioning and kernel signing tools";
|
2013-08-28 21:52:07 +02:00
|
|
|
license = stdenv.lib.licenses.bsd3;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
2013-05-27 12:10:19 +02:00
|
|
|
}
|