mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 07:00:43 +00:00
Enable building full klibc as a kernelPackage
svn path=/nixpkgs/trunk/; revision=30009
This commit is contained in:
parent
e0e4770ec9
commit
dd9e83b77f
|
@ -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 = ''
|
||||
|
|
|
@ -5737,6 +5737,10 @@ let
|
|||
inherit kernel perl;
|
||||
};
|
||||
|
||||
klibc = callPackage ../os-specific/linux/klibc {
|
||||
linuxHeaders = glibc.kernelHeaders;
|
||||
};
|
||||
|
||||
splashutils =
|
||||
if kernel.features ? fbConDecor then pkgs.splashutils else null;
|
||||
|
||||
|
|
Loading…
Reference in a new issue