diff options
author | Shea Levy <shea@shealevy.com> | 2011-10-25 08:59:39 +0000 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2011-10-25 08:59:39 +0000 |
commit | dd9e83b77faa321fe9cb8e11e79070c792d07d50 (patch) | |
tree | de003a27b817e28dab30940c58b155894f111052 /pkgs/os-specific/linux/klibc | |
parent | e0e4770ec96d35c1f8bab4bda4a629dd747c704a (diff) |
Enable building full klibc as a kernelPackage
svn path=/nixpkgs/trunk/; revision=30009
Diffstat (limited to 'pkgs/os-specific/linux/klibc')
-rw-r--r-- | pkgs/os-specific/linux/klibc/default.nix | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/pkgs/os-specific/linux/klibc/default.nix b/pkgs/os-specific/linux/klibc/default.nix index d71b97b9c7d3c..e1b8c0d283646 100644 --- a/pkgs/os-specific/linux/klibc/default.nix +++ b/pkgs/os-specific/linux/klibc/default.nix @@ -1,4 +1,13 @@ -{stdenv, fetchurl, perl, bison, mktemp, linuxHeaders, linuxHeadersCross}: +{ + stdenv, + fetchurl, + perl, + bison, + mktemp, + linuxHeaders, + linuxHeadersCross, + kernel ? null +}: assert stdenv.isLinux; @@ -20,7 +29,7 @@ stdenv.mkDerivation { # So it cannot run the 'make headers_install' it wants to run. # We don't install the headers, so klibc will not be useful as libc, but # usually in nixpkgs we only use the userspace tools comming with klibc. - prePatch = '' + prePatch = stdenv.lib.optionalString (kernel == null) '' sed -i -e /headers_install/d scripts/Kbuild.install ''; @@ -49,10 +58,18 @@ stdenv.mkDerivation { echo "CONFIG_AEABI=y" >> defconfig makeFlags=$(eval "echo $makeFlags") + '' + (if kernel == null then '' mkdir linux cp -prsd $linuxHeaders/include linux/ chmod -R u+w linux/include/ - ''; # */ + '' else '' + tar xvf ${kernel.src} + mv linux* linux + cd linux + ln -sv ${kernel}/config .config + make prepare + cd .. + ''); # Install static binaries as well. postInstall = '' |