From 601e9dfd947e7f1cdb4989c60d3749ea968277d9 Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Mon, 27 May 2013 12:10:19 +0200 Subject: [PATCH] Add vboot_reference: tools needed for installing custom OS on Chromebooks --- pkgs/tools/system/vboot_reference/default.nix | 39 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 41 insertions(+) create mode 100644 pkgs/tools/system/vboot_reference/default.nix diff --git a/pkgs/tools/system/vboot_reference/default.nix b/pkgs/tools/system/vboot_reference/default.nix new file mode 100644 index 000000000000..257a4ec4fd0b --- /dev/null +++ b/pkgs/tools/system/vboot_reference/default.nix @@ -0,0 +1,39 @@ +{ stdenv, fetchgit, pkgconfig, libuuid, openssl }: + +let + 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!"; + + version = "20130507"; + checkout = "25/50225/2"; +in stdenv.mkDerivation { + name = "vboot_reference-${version}"; + + src = fetchgit { + url = "http://git.chromium.org/git/chromiumos/platform/vboot_reference.git"; + rev = "refs/changes/${checkout}"; + sha256 = "00qhwhh5ygrcfm9is8hrk1spqdvfs6aa744h10jbr03zics5bvac"; + }; + + buildInputs = [ pkgconfig openssl + (stdenv.lib.overrideDerivation libuuid + (args: { configureFlags = args.configureFlags + " --enable-static"; })) ]; + + 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 = '' + ensureDir $out/bin + 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 + ''; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2e6e5aafce91..57dbbb0ec3c0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1748,6 +1748,8 @@ let vde2 = callPackage ../tools/networking/vde2 { }; + vboot_reference = callPackage ../tools/system/vboot_reference { }; + verilog = callPackage ../applications/science/electronics/verilog {}; vfdecrypt = callPackage ../tools/misc/vfdecrypt { };