Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'merge-kernel-builds' into upstream-master

This is a second attempt at unifying the generic and manual-config
kernel builds (see #412 for the last time).

The set of working kernel packages is a superset of those that work on
master, and as the only objection last time was the size of the $dev
closure and now both $out and $dev combined are 20M smaller than $out on
master (see message for ac20352), this
should be unobjectionable.

Signed-off-by: Shea Levy <shea@shealevy.com>
  • Loading branch information...
commit 139f8949e6a5898aa8f245b49c18a6c523dce24e 2 parents 010e63c + ac20352
@shlevy shlevy authored
Showing with 541 additions and 1,257 deletions.
  1. +0 −7 nixos/modules/services/x11/xserver.nix
  2. +4 −4 pkgs/applications/virtualization/virtualbox/default.nix
  3. +4 −4 pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
  4. +2 −2 pkgs/development/tools/profiling/systemtap/default.nix
  5. +5 −5 pkgs/os-specific/linux/acpi-call/default.nix
  6. +0 −28 pkgs/os-specific/linux/atheros/0.9.4.nix
  7. +6 −5 pkgs/os-specific/linux/ati-drivers/default.nix
  8. +0 −41 pkgs/os-specific/linux/aufs-util/2.nix
  9. +0 −40 pkgs/os-specific/linux/aufs-util/3.nix
  10. +0 −43 pkgs/os-specific/linux/aufs/2.nix
  11. +0 −44 pkgs/os-specific/linux/aufs/3.nix
  12. +5 −5 pkgs/os-specific/linux/batman-adv/default.nix
  13. +6 −6 pkgs/os-specific/linux/bbswitch/default.nix
  14. +6 −6 pkgs/os-specific/linux/blcr/default.nix
  15. +0 −49 pkgs/os-specific/linux/broadcom-sta-v6/default.nix
  16. +0 −13 pkgs/os-specific/linux/broadcom-sta-v6/license.patch
  17. +27 −28 pkgs/os-specific/linux/broadcom-sta/default.nix
  18. +5 −4 pkgs/os-specific/linux/broadcom-sta/license.patch
  19. +0 −11 pkgs/os-specific/linux/broadcom-sta/linux-2.6.39.patch
  20. +0 −13 pkgs/os-specific/linux/broadcom-sta/linux-3.2.patch
  21. +0 −12 pkgs/os-specific/linux/broadcom-sta/linux-3.4.patch
  22. 0  pkgs/os-specific/linux/{broadcom-sta-v6 → broadcom-sta}/linux-recent.patch
  23. +0 −16 pkgs/os-specific/linux/broadcom-sta/makefile.patch
  24. +4 −4 pkgs/os-specific/linux/cryptodev/default.nix
  25. +6 −8 pkgs/os-specific/linux/e1000e/default.nix
  26. +0 −56 pkgs/os-specific/linux/exmap/default.nix
  27. +5 −5 pkgs/os-specific/linux/frandom/default.nix
  28. +0 −27 pkgs/os-specific/linux/iscsitarget/default.nix
  29. +0 −40 pkgs/os-specific/linux/iwlwifi/default.nix
  30. +25 −0 pkgs/os-specific/linux/kernel-headers/default.nix
  31. +0 −149 pkgs/os-specific/linux/kernel/builder.sh
  32. +4 −1 pkgs/os-specific/linux/kernel/generate-config.pl
  33. +76 −92 pkgs/os-specific/linux/kernel/generic.nix
  34. +189 −133 pkgs/os-specific/linux/kernel/manual-config.nix
  35. +0 −46 pkgs/os-specific/linux/kernel/patches.nix
  36. +4 −3 pkgs/os-specific/linux/kernel/perf.nix
  37. +26 −52 pkgs/os-specific/linux/klibc/default.nix
  38. +11 −0 pkgs/os-specific/linux/klibc/no-reinstall-kernel-headers.patch
  39. +3 −3 pkgs/os-specific/linux/lttng-modules/default.nix
  40. +9 −9 pkgs/os-specific/linux/ndiswrapper/default.nix
  41. +12 −0 pkgs/os-specific/linux/ndiswrapper/no-sbin.patch
  42. +0 −66 pkgs/os-specific/linux/ndiswrapper/prefix.patch
  43. +5 −5 pkgs/os-specific/linux/netatop/default.nix
  44. +3 −4 pkgs/os-specific/linux/nvidia-x11/builder-legacy.sh
  45. +3 −4 pkgs/os-specific/linux/nvidia-x11/builder-legacy304.sh
  46. +3 −4 pkgs/os-specific/linux/nvidia-x11/builder.sh
  47. +3 −3 pkgs/os-specific/linux/nvidia-x11/default.nix
  48. +6 −6 pkgs/os-specific/linux/nvidia-x11/legacy173.nix
  49. +3 −3 pkgs/os-specific/linux/nvidia-x11/legacy304.nix
  50. +0 −44 pkgs/os-specific/linux/nvidia-x11/legacy96.nix
  51. +8 −6 pkgs/os-specific/linux/open-iscsi/default.nix
  52. +6 −4 pkgs/os-specific/linux/psmouse-alps/default.nix
  53. +5 −5 pkgs/os-specific/linux/spl/default.nix
  54. +5 −7 pkgs/os-specific/linux/tp_smapi/default.nix
  55. +3 −4 pkgs/os-specific/linux/v86d/default.nix
  56. +4 −13 pkgs/os-specific/linux/wis-go7007/default.nix
  57. +5 −5 pkgs/os-specific/linux/zfs/default.nix
  58. +3 −3 pkgs/servers/openafs-client/default.nix
  59. +21 −49 pkgs/top-level/all-packages.nix
  60. +10 −5 pkgs/top-level/platforms.nix
  61. +1 −1  pkgs/top-level/release-cross.nix
  62. +0 −2  pkgs/top-level/release-python.nix
View
7 nixos/modules/services/x11/xserver.nix
@@ -16,7 +16,6 @@ let
ati_unfree = { modules = [ kernelPackages.ati_drivers_x11 ]; driverName = "fglrx"; };
nouveau = { modules = [ pkgs.xf86_video_nouveau ]; };
nvidia = { modules = [ kernelPackages.nvidia_x11 ]; };
- nvidiaLegacy96 = { modules = [ kernelPackages.nvidia_x11_legacy96 ]; driverName = "nvidia"; };
nvidiaLegacy173 = { modules = [ kernelPackages.nvidia_x11_legacy173 ]; driverName = "nvidia"; };
nvidiaLegacy304 = { modules = [ kernelPackages.nvidia_x11_legacy304 ]; driverName = "nvidia"; };
unichrome = { modules = [ pkgs.xorgVideoUnichrome ]; };
@@ -443,7 +442,6 @@ in
boot.extraModulePackages =
optional (elem "nvidia" driverNames) kernelPackages.nvidia_x11 ++
- optional (elem "nvidiaLegacy96" driverNames) kernelPackages.nvidia_x11_legacy96 ++
optional (elem "nvidiaLegacy173" driverNames) kernelPackages.nvidia_x11_legacy173 ++
optional (elem "nvidiaLegacy304" driverNames) kernelPackages.nvidia_x11_legacy304 ++
optional (elem "virtualbox" driverNames) kernelPackages.virtualboxGuestAdditions ++
@@ -497,7 +495,6 @@ in
pkgs.xdg_utils
]
++ optional (elem "nvidia" driverNames) kernelPackages.nvidia_x11
- ++ optional (elem "nvidiaLegacy96" driverNames) kernelPackages.nvidia_x11_legacy96
++ optional (elem "nvidiaLegacy173" driverNames) kernelPackages.nvidia_x11_legacy173
++ optional (elem "nvidiaLegacy304" driverNames) kernelPackages.nvidia_x11_legacy304
++ optional (elem "virtualbox" driverNames) xorg.xrefresh
@@ -521,8 +518,6 @@ in
XORG_DRI_DRIVER_PATH = "/run/opengl-driver/lib/dri"; # !!! Depends on the driver selected at runtime.
} // optionalAttrs (elem "nvidia" driverNames) {
LD_LIBRARY_PATH = "${xorg.libX11}/lib:${xorg.libXext}/lib:${kernelPackages.nvidia_x11}/lib";
- } // optionalAttrs (elem "nvidiaLegacy96" driverNames) {
- LD_LIBRARY_PATH = "${xorg.libX11}/lib:${xorg.libXext}/lib:${kernelPackages.nvidia_x11_legacy96}/lib";
} // optionalAttrs (elem "nvidiaLegacy173" driverNames) {
LD_LIBRARY_PATH = "${xorg.libX11}/lib:${xorg.libXext}/lib:${kernelPackages.nvidia_x11_legacy173}/lib";
} // optionalAttrs (elem "nvidiaLegacy304" driverNames) {
@@ -544,8 +539,6 @@ in
${optionalString cfg.driSupport32Bit
"ln -sf ${pkgs_i686.linuxPackages.nvidia_x11.override { libsOnly = true; kernelDev = null; } } /run/opengl-driver-32"}
''
- else if elem "nvidiaLegacy96" driverNames then
- "ln -sf ${kernelPackages.nvidia_x11_legacy96} /run/opengl-driver"
else if elem "nvidiaLegacy173" driverNames then
"ln -sf ${kernelPackages.nvidia_x11_legacy173} /run/opengl-driver"
else if elem "nvidiaLegacy304" driverNames then
View
8 pkgs/applications/virtualization/virtualbox/default.nix
@@ -1,5 +1,5 @@
{ stdenv, fetchurl, lib, iasl, dev86, pam, libxslt, libxml2, libX11, xproto, libXext
-, libXcursor, libXmu, qt4, libIDL, SDL, libcap, zlib, libpng, glib, kernelDev, lvm2
+, libXcursor, libXmu, qt4, libIDL, SDL, libcap, zlib, libpng, glib, kernel, lvm2
, which, alsaLib, curl, gawk
, xorriso, makeself, perl, pkgconfig
, javaBindings ? false, jdk ? null
@@ -52,7 +52,7 @@ let
};
in stdenv.mkDerivation {
- name = "virtualbox-${version}-${kernelDev.version}";
+ name = "virtualbox-${version}-${kernel.version}";
src = fetchurl {
url = "http://download.virtualbox.org/virtualbox/${version}/VirtualBox-${version}.tar.bz2";
@@ -61,14 +61,14 @@ in stdenv.mkDerivation {
buildInputs =
[ iasl dev86 libxslt libxml2 xproto libX11 libXext libXcursor qt4 libIDL SDL
- libcap glib kernelDev lvm2 python alsaLib curl pam xorriso makeself perl
+ libcap glib lvm2 python alsaLib curl pam xorriso makeself perl
pkgconfig which libXmu ]
++ optional javaBindings jdk
++ optional pythonBindings python;
prePatch = ''
set -x
- MODULES_BUILD_DIR=`echo ${kernelDev}/lib/modules/*/build`
+ MODULES_BUILD_DIR=`echo ${kernel.dev}/lib/modules/*/build`
sed -e 's@/lib/modules/`uname -r`/build@'$MODULES_BUILD_DIR@ \
-e 's@MKISOFS --version@MKISOFS -version@' \
-e 's@PYTHONDIR=.*@PYTHONDIR=${if pythonBindings then python else ""}@' \
View
8 pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, lib, patchelf, cdrkit, kernelDev, which, makeWrapper
+{ stdenv, fetchurl, lib, patchelf, cdrkit, kernel, which, makeWrapper
, xorg, dbus, virtualbox }:
let
@@ -8,14 +8,14 @@ let
in
stdenv.mkDerivation {
- name = "VirtualBox-GuestAdditions-${version}-${kernelDev.version}";
+ name = "VirtualBox-GuestAdditions-${version}-${kernel.version}";
src = fetchurl {
url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso";
sha256 = "f11a7f13dfe7bf9f246fb877144bb467fe6deadcd876568ec79b6ccd3b59d767";
};
- KERN_DIR = "${kernelDev}/lib/modules/*/build";
+ KERN_DIR = "${kernel.dev}/lib/modules/*/build";
buildInputs = [ patchelf cdrkit makeWrapper dbus ];
@@ -115,7 +115,7 @@ stdenv.mkDerivation {
for i in *
do
cd $i
- kernelVersion=$(cd ${kernelDev}/lib/modules; ls)
+ kernelVersion=$(cd ${kernel.dev}/lib/modules; ls)
export MODULE_DIR=$out/lib/modules/$kernelVersion/misc
find . -type f | xargs sed -i -e "s|-o root||g" \
-e "s|-g root||g"
View
4 pkgs/development/tools/profiling/systemtap/default.nix
@@ -1,9 +1,9 @@
-{ fetchurl, stdenv, linux, elfutils, latex2html, xmlto, docbook_xml_dtd_412
+{ fetchurl, stdenv, elfutils, latex2html, xmlto, docbook_xml_dtd_412
, libxml2, docbook_xsl, libxslt, texLive, texLiveExtra, ghostscript, pkgconfig
, gtkmm, libglademm, boost, perl, sqlite }:
stdenv.mkDerivation rec {
- name = "systemtap-1.2-${linux.version}";
+ name = "systemtap-1.2";
src = fetchurl {
url = "http://sources.redhat.com/systemtap/ftp/releases/${name}.tar.gz";
View
10 pkgs/os-specific/linux/acpi-call/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchgit, kernelDev }:
+{ stdenv, fetchgit, kernel }:
stdenv.mkDerivation {
- name = "acpi-call-${kernelDev.version}";
+ name = "acpi-call-${kernel.version}";
src = fetchgit {
url = "git://github.com/mkottman/acpi_call.git";
@@ -12,12 +12,12 @@ stdenv.mkDerivation {
preBuild = ''
sed -e 's/break/true/' -i examples/turn_off_gpu.sh
sed -e 's@/bin/bash@.bin/sh@' -i examples/turn_off_gpu.sh
- sed -e "s@/lib/modules/\$(.*)@${kernelDev}/lib/modules/${kernelDev.modDirVersion}@" -i Makefile
+ sed -e "s@/lib/modules/\$(.*)@${kernel.dev}/lib/modules/${kernel.modDirVersion}@" -i Makefile
'';
installPhase = ''
- mkdir -p $out/lib/modules/${kernelDev.modDirVersion}/misc
- cp acpi_call.ko $out/lib/modules/${kernelDev.modDirVersion}/misc
+ mkdir -p $out/lib/modules/${kernel.modDirVersion}/misc
+ cp acpi_call.ko $out/lib/modules/${kernel.modDirVersion}/misc
mkdir -p $out/bin
cp examples/turn_off_gpu.sh $out/bin/test_discrete_video_off.sh
chmod a+x $out/bin/test_discrete_video_off.sh
View
28 pkgs/os-specific/linux/atheros/0.9.4.nix
@@ -1,28 +0,0 @@
-{ stdenv, fetchurl, builderDefs, kernelDev }:
- let localDefs = builderDefs.passthru.function {
- src = /* put a fetchurl here */
- fetchurl {
- url = http://downloads.sourceforge.net/madwifi/madwifi-0.9.4.tar.gz;
- sha256 = "06jd5b8rfw7rmiva6jgmrb7n26g5plcg9marbnnmg68gbcqbr3xh";
- };
-
- buildInputs = [];
- configureFlags = [];
- makeFlags = [''KERNELPATH=${kernelDev}/lib/modules/*/build'' ''DESTDIR=$out''];
- };
- in with localDefs;
-let
-postInstall = fullDepEntry (''
- ln -s $out/usr/local/bin $out/bin
-'') [minInit doMakeInstall];
-in
-stdenv.mkDerivation rec {
- name = "atheros-0.9.4-${kernelDev.version}";
- builder = writeScript (name + "-builder")
- (textClosure localDefs [doMakeInstall
- postInstall doForceShare doPropagate]);
- meta = {
- description = "Atheros WiFi driver";
- inherit src;
- };
-}
View
11 pkgs/os-specific/linux/ati-drivers/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, kernelDev, xlibs, which, imake
+{ stdenv, fetchurl, kernel, xlibs, which, imake
, mesa # for fgl_glxgears
, libXxf86vm, xf86vidmodeproto # for fglrx_gamma
, xorg, makeWrapper, glibc, patchelf
@@ -22,9 +22,9 @@
assert stdenv.system == "x86_64-linux";
-stdenv.mkDerivation rec {
- name = "ati-drivers-${version}-${kernel.version}";
- version = "13.4";
+
+stdenv.mkDerivation {
+ name = "ati-drivers-13.4-${kernel.version}";
builder = ./builder.sh;
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
mesa
];
- kernel = kernelDev;
+ kernel = kernel.dev;
inherit glibc /* glibc only used for setting interpreter */;
@@ -72,6 +72,7 @@ stdenv.mkDerivation rec {
maintainers = [stdenv.lib.maintainers.marcweber];
platforms = [ "x86_64-linux" ];
hydraPlatforms = [];
+ broken = true;
};
# moved assertions here because the name is evaluated when the NixOS manual is generated
View
41 pkgs/os-specific/linux/aufs-util/2.nix
@@ -1,41 +0,0 @@
-{ stdenv, fetchurl, kernelDev, aufs }:
-
-assert aufs != null;
-
-let version = "20100506"; in
-
-stdenv.mkDerivation {
- name = "aufs2-util-${version}-${kernelDev.version}";
-
- src = fetchurl {
- url = "http://tarballs.nixos.org/aufs2-util-git-${version}.tar.bz2";
- sha256 = "0ly0c3p8fjxqbk8k5rmm1a91wg8wcrvhi1lv4aawalkkk8rqbnwk";
- };
-
- buildInputs = [ aufs ];
-
- makeFlags =
- [ "KDIR=${kernelDev}/lib/modules/${kernelDev.version}/build"
- "Install=install"
- "DESTDIR=$(out)"
- ];
-
- postInstall =
- ''
- mv $out/usr/* $out
- rmdir $out/usr
-
- cp aufs.shlib $out/lib/
-
- substituteInPlace $out/bin/aubrsync \
- --replace /sbin/mount $out/sbin/mount \
- --replace /usr/lib/aufs.shlib $out/lib/aufs.shlib
- '';
-
- meta = {
- description = "Utilities for AUFS2";
- homepage = http://aufs.sourceforge.net/;
- maintainers = [ stdenv.lib.maintainers.eelco ];
- platforms = stdenv.lib.platforms.linux;
- };
-}
View
40 pkgs/os-specific/linux/aufs-util/3.nix
@@ -1,40 +0,0 @@
-{ stdenv, fetchgit, kernelDev, aufs }:
-
-assert aufs != null;
-
-stdenv.mkDerivation {
- name = "aufs3-util-${aufs.patch.version}-${kernelDev.version}";
-
- src = fetchgit {
- url = git://aufs.git.sourceforge.net/gitroot/aufs/aufs-util.git;
- rev = aufs.patch.utilRev;
- sha256 = aufs.patch.utilHash;
- };
-
- buildInputs = [ aufs ];
-
- makeFlags =
- [ "KDIR=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build"
- "Install=install"
- "DESTDIR=$(out)"
- ];
-
- postInstall =
- ''
- mv $out/usr/* $out
- rmdir $out/usr
-
- cp aufs.shlib $out/lib/
-
- substituteInPlace $out/bin/aubrsync \
- --replace /sbin/mount $out/sbin/mount \
- --replace /usr/lib/aufs.shlib $out/lib/aufs.shlib
- '';
-
- meta = {
- description = "Utilities for AUFS3";
- homepage = http://aufs.sourceforge.net/;
- maintainers = [ stdenv.lib.maintainers.eelco ];
- platforms = stdenv.lib.platforms.linux;
- };
-}
View
43 pkgs/os-specific/linux/aufs/2.nix
@@ -1,43 +0,0 @@
-{ stdenv, fetchurl, kernelDev, perl, fetchgit }:
-
-assert kernelDev.features ? aufsBase;
-
-let version = "20100522"; in
-
-stdenv.mkDerivation {
- name = "aufs2-${version}-${kernelDev.version}";
-
- src =
- if (builtins.lessThan (builtins.compareVersions kernelDev.version "2.6.35") 0) then
- fetchurl {
- url = "http://tarballs.nixos.org/aufs2-standalone-git-${version}.tar.bz2";
- sha256 = "1g4mw4qx2xzpygdwjiw36bkhfz1hi7wxx7w79n2h0lr5grzzdnd6";
- }
- else
- fetchgit {
- url = "http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git";
- rev = "d950eef373ff1e0448ad3945b734da6ab050571d";
- sha256 = "816145b0341bd7862df50c058144cf6ebc25c05d2976f781ff0fe10d4559b853";
- };
-
- buildInputs = [ perl ];
-
- makeFlags = "KDIR=${kernelDev}/lib/modules/${kernelDev.version}/build";
-
- installPhase =
- ''
- mkdir -p $out/lib/modules/${kernelDev.version}/misc
- cp aufs.ko $out/lib/modules/${kernelDev.version}/misc
-
- # Install the headers because aufs2-util requires them.
- cp -prvd include $out/
- '';
-
- meta = {
- description = "Another Unionfs implementation for Linux (second generation)";
- homepage = http://aufs.sourceforge.net/;
- maintainers = [ stdenv.lib.maintainers.eelco
- stdenv.lib.maintainers.raskin ];
- platforms = stdenv.lib.platforms.linux;
- };
-}
View
44 pkgs/os-specific/linux/aufs/3.nix
@@ -1,44 +0,0 @@
-{ stdenv, kernelDev, perl }:
-
-let
-
- aufsPredicate = x:
- if x ? features then
- (if x.features ? aufs3 then x.features.aufs3 else false)
- else false;
- featureAbort = abort "This kernel does not have aufs 3 support";
- patch = stdenv.lib.findFirst aufsPredicate featureAbort kernelDev.kernelPatches;
-
-in
-
-stdenv.mkDerivation {
- name = "aufs3-${patch.version}-${kernelDev.version}";
-
- src = patch.patch.src;
-
- buildInputs = [ perl ];
-
- makeFlags = "KDIR=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build";
-
- NIX_CFLAGS_COMPILE="-I${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build/include/generated";
-
- installPhase =
- ''
- mkdir -p $out/lib/modules/${kernelDev.modDirVersion}/misc
- cp -v aufs.ko $out/lib/modules/${kernelDev.modDirVersion}/misc
-
- # Install the headers because aufs3-util requires them.
- mkdir -p $out/include/linux
- cp -v usr/include/linux/aufs_type.h $out/include/linux
- '';
-
- passthru = { inherit patch; };
-
- meta = {
- description = "Another Unionfs implementation for Linux (third generation)";
- homepage = http://aufs.sourceforge.net/;
- maintainers = [ stdenv.lib.maintainers.eelco
- stdenv.lib.maintainers.raskin ];
- platforms = stdenv.lib.platforms.linux;
- };
-}
View
10 pkgs/os-specific/linux/batman-adv/default.nix
@@ -1,17 +1,17 @@
-{ stdenv, fetchurl, kernelDev }:
+{ stdenv, fetchurl, kernel }:
-let base = "batman-adv-2013.2.0"; in
+let base = "batman-adv-2013.4.0"; in
stdenv.mkDerivation rec {
- name = "${base}-${kernelDev.version}";
+ name = "${base}-${kernel.version}";
src = fetchurl {
url = "http://downloads.open-mesh.org/batman/releases/${base}/${base}.tar.gz";
- sha1 = "7d2aff2ad118cbc5452de43f7e9da8374521ec0e";
+ sha1 = "870a85df5410b3b5623be69e75297e642c91a7d4";
};
preBuild = ''
- makeFlags="KERNELPATH=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build"
+ makeFlags="KERNELPATH=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
sed -i -e "s,INSTALL_MOD_DIR=,INSTALL_MOD_PATH=$out INSTALL_MOD_DIR=," \
-e /depmod/d Makefile
'';
View
12 pkgs/os-specific/linux/bbswitch/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl, kernelDev }:
+{ stdenv, fetchurl, kernel }:
let
baseName = "bbswitch";
version = "0.7";
- name = "${baseName}-${version}-${kernelDev.version}";
+ name = "${baseName}-${version}-${kernel.version}";
in
@@ -17,13 +17,13 @@ stdenv.mkDerivation {
preBuild = ''
substituteInPlace Makefile \
- --replace "\$(shell uname -r)" "${kernelDev.modDirVersion}" \
- --replace "/lib/modules" "${kernelDev}/lib/modules"
+ --replace "\$(shell uname -r)" "${kernel.modDirVersion}" \
+ --replace "/lib/modules" "${kernel.dev}/lib/modules"
'';
installPhase = ''
- ensureDir $out/lib/modules/${kernelDev.modDirVersion}/misc
- cp bbswitch.ko $out/lib/modules/${kernelDev.modDirVersion}/misc
+ ensureDir $out/lib/modules/${kernel.modDirVersion}/misc
+ cp bbswitch.ko $out/lib/modules/${kernel.modDirVersion}/misc
ensureDir $out/bin
tee $out/bin/discrete_vga_poweroff << EOF
View
12 pkgs/os-specific/linux/blcr/default.nix
@@ -1,13 +1,13 @@
-{ stdenv, fetchurl, kernelDev, perl, makeWrapper }:
+{ stdenv, fetchurl, kernel, perl, makeWrapper }:
# BLCR 0.8.4 works for kernel version up to 2.6.38 (including 2.6.38.x)
# BLCR 0.8.5 should works for kernel version up to 3.7.1
assert stdenv.isLinux;
-assert builtins.compareVersions "3.7.2" kernelDev.version == 1;
+assert builtins.compareVersions "3.7.2" kernel.version == 1;
stdenv.mkDerivation {
- name = "blcr_${kernelDev.version}-0.8.5";
+ name = "blcr_${kernel.version}-0.8.5";
src = fetchurl {
url = http://crd.lbl.gov/assets/Uploads/FTG/Projects/CheckpointRestart/downloads/blcr-0.8.5.tar.gz;
@@ -18,9 +18,9 @@ stdenv.mkDerivation {
preConfigure = ''
configureFlagsArray=(
- --with-linux=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build
- --with-kmod-dir=$out/lib/modules/${kernelDev.modDirVersion}
- --with-system-map=${kernelDev}/System.map
+ --with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build
+ --with-kmod-dir=$out/lib/modules/${kernel.modDirVersion}
+ --with-system-map=${kernel}/System.map
)
'';
View
49 pkgs/os-specific/linux/broadcom-sta-v6/default.nix
@@ -1,49 +0,0 @@
-{ stdenv, fetchurl, kernelDev }:
-let
- version = "6_30_223_141";
-in
-stdenv.mkDerivation {
- name = "broadcom-sta-${version}-${kernelDev.version}";
-
- src = if stdenv.system == "i686-linux" then (
- fetchurl {
- url = "http://www.broadcom.com/docs/linux_sta/hybrid-v35-nodebug-pcoem-${version}.tar.gz";
- sha256 = "19wra62dpm0x0byksh871yxr128b4v13kzkzqv56igjfpzv36z6m";
- } ) else (
- fetchurl {
- url = "http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-${version}.tar.gz";
- sha256 = "0jlvch7d3khmmg5kp80x4ka33hidj8yykqjcqq6j56z2g6wb4dsz";
- }
- );
-
- buildInputs = [ kernelDev ];
- patches = [
- ./linux-recent.patch
- ./license.patch
- ];
-
- makeFlags = "KBASE=${kernelDev}/lib/modules/${kernelDev.modDirVersion}";
-
- unpackPhase = ''
- sourceRoot=broadcom-sta
- mkdir "$sourceRoot"
- tar xvf "$src" -C "$sourceRoot"
- '';
-
- installPhase =
- ''
- binDir="$out/lib/modules/${kernelDev.modDirVersion}/kernel/net/wireless/"
- docDir="$out/share/doc/broadcom-sta/"
- mkdir -p "$binDir" "$docDir"
- cp wl.ko "$binDir"
- cp lib/LICENSE.txt "$docDir"
- '';
-
- meta = {
- description = "Kernel module driver for some Broadcom's wireless cards";
- homepage = http://www.broadcom.com/support/802.11/linux_sta.php;
- license = "unfree-redistributable";
- maintainers = with stdenv.lib.maintainers; [ phreedom vcunat ];
- platforms = stdenv.lib.platforms.linux;
- };
-}
View
13 pkgs/os-specific/linux/broadcom-sta-v6/license.patch
@@ -1,13 +0,0 @@
-diff -Naur hybrid-portsrc-x86_32-v5_10_91_9.orig/src/wl/sys/wl_linux.c hybrid-portsrc-x86_32-v5_10_91_9/src/wl/sys/wl_linux.c
---- hybrid-portsrc-x86_32-v5_10_91_9.orig/src/wl/sys/wl_linux.c 2009-04-23 02:48:59.000000000 +0900
-+++ hybrid-portsrc-x86_32-v5_10_91_9/src/wl/sys/wl_linux.c 2009-05-08 00:48:20.000000000 +0900
-@@ -171,6 +171,8 @@
- static void wl_free_if(wl_info_t *wl, wl_if_t *wlif);
- static void wl_get_driver_info(struct net_device *dev, struct ethtool_drvinfo *info);
-
-+MODULE_LICENSE("MIXED/Proprietary");
-+
- #if defined(WL_CONFIG_RFKILL)
- #include <linux/rfkill.h>
- static int wl_init_rfkill(wl_info_t *wl);
-
View
55 pkgs/os-specific/linux/broadcom-sta/default.nix
@@ -1,38 +1,37 @@
-{ stdenv, fetchurl, kernelDev }:
-
-let version = "5_100_82_112";
- bits = if stdenv.system == "i686-linux" then "32" else
- assert stdenv.system == "x86_64-linux"; "64";
+{ stdenv, fetchurl, kernel }:
+let
+ version = "6_30_223_141";
in
-
stdenv.mkDerivation {
- name = "broadcom-sta-${version}-${kernelDev.version}";
-
- src = fetchurl {
- url = "http://www.broadcom.com/docs/linux_sta/hybrid-portsrc_x86_${bits}-v${version}.tar.gz";
- sha256 = if bits == "32"
- then "1rvhw9ngw0djxyyjx5m01c0js89zs3xiwmra03al6f9q7cbf7d45"
- else "1qsarnry10f5m8a73wbr9cg2ifs00sqg6x0ay59l72vl9hb2zlww";
- };
-
- buildInputs = [ kernelDev ];
- patches =
- [ ./makefile.patch ./linux-2.6.39.patch ./linux-3.2.patch
- ./linux-3.4.patch ./license.patch
- ];
-
- makeFlags = "KDIR=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build";
-
- unpackPhase =
- ''
+ name = "broadcom-sta-${version}-${kernel.version}";
+
+ src = if stdenv.system == "i686-linux" then (
+ fetchurl {
+ url = "http://www.broadcom.com/docs/linux_sta/hybrid-v35-nodebug-pcoem-${version}.tar.gz";
+ sha256 = "19wra62dpm0x0byksh871yxr128b4v13kzkzqv56igjfpzv36z6m";
+ } ) else (
+ fetchurl {
+ url = "http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-${version}.tar.gz";
+ sha256 = "0jlvch7d3khmmg5kp80x4ka33hidj8yykqjcqq6j56z2g6wb4dsz";
+ }
+ );
+
+ patches = [
+ ./linux-recent.patch
+ ./license.patch
+ ];
+
+ makeFlags = "KBASE=${kernel.dev}/lib/modules/${kernel.modDirVersion}";
+
+ unpackPhase = ''
sourceRoot=broadcom-sta
mkdir "$sourceRoot"
tar xvf "$src" -C "$sourceRoot"
- '';
+ '';
installPhase =
''
- binDir="$out/lib/modules/${kernelDev.modDirVersion}/kernel/net/wireless/"
+ binDir="$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
docDir="$out/share/doc/broadcom-sta/"
mkdir -p "$binDir" "$docDir"
cp wl.ko "$binDir"
@@ -43,7 +42,7 @@ stdenv.mkDerivation {
description = "Kernel module driver for some Broadcom's wireless cards";
homepage = http://www.broadcom.com/support/802.11/linux_sta.php;
license = "unfree-redistributable";
- maintainers = [ stdenv.lib.maintainers.vcunat ];
+ maintainers = with stdenv.lib.maintainers; [ phreedom vcunat ];
platforms = stdenv.lib.platforms.linux;
};
}
View
9 pkgs/os-specific/linux/broadcom-sta/license.patch
@@ -1,12 +1,13 @@
diff -Naur hybrid-portsrc-x86_32-v5_10_91_9.orig/src/wl/sys/wl_linux.c hybrid-portsrc-x86_32-v5_10_91_9/src/wl/sys/wl_linux.c
--- hybrid-portsrc-x86_32-v5_10_91_9.orig/src/wl/sys/wl_linux.c 2009-04-23 02:48:59.000000000 +0900
+++ hybrid-portsrc-x86_32-v5_10_91_9/src/wl/sys/wl_linux.c 2009-05-08 00:48:20.000000000 +0900
-@@ -163,6 +163,8 @@
+@@ -171,6 +171,8 @@
static void wl_free_if(wl_info_t *wl, wl_if_t *wlif);
static void wl_get_driver_info(struct net_device *dev, struct ethtool_drvinfo *info);
+MODULE_LICENSE("MIXED/Proprietary");
+
- static struct pci_device_id wl_id_table[] = {
- { PCI_VENDOR_ID_BROADCOM, 0x4311, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
- { PCI_VENDOR_ID_BROADCOM, 0x4312, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+ #if defined(WL_CONFIG_RFKILL)
+ #include <linux/rfkill.h>
+ static int wl_init_rfkill(wl_info_t *wl);
+
View
11 pkgs/os-specific/linux/broadcom-sta/linux-2.6.39.patch
@@ -1,11 +0,0 @@
---- old/src/wl/sys/wl_cfg80211.c
-+++ new/src/wl/sys/wl_cfg80211.c
-@@ -1811,7 +1811,7 @@
- notif_bss_info->frame_len = offsetof(struct ieee80211_mgmt, u.beacon.variable) +
- wl_get_ielen(wl);
- freq = ieee80211_channel_to_frequency(notif_bss_info->channel
--#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)
- ,(notif_bss_info->channel <= CH_MAX_2G_CHANNEL) ? IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ
- #endif
- );
View
13 pkgs/os-specific/linux/broadcom-sta/linux-3.2.patch
@@ -1,13 +0,0 @@
-diff -Naur broadcom-sta-5.100.82.112.orig/src/wl/sys/wl_linux.c broadcom-sta-5.100.82.112/src/wl/sys/wl_linux.c
---- broadcom-sta-5.100.82.112.orig/src/wl/sys/wl_linux.c 2011-10-23 01:56:55.000000000 +0900
-+++ broadcom-sta-5.100.82.112/src/wl/sys/wl_linux.c 2011-11-22 00:56:07.021520421 +0900
-@@ -385,7 +385,9 @@
- #endif
- .ndo_get_stats = wl_get_stats,
- .ndo_set_mac_address = wl_set_mac_address,
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
- .ndo_set_multicast_list = wl_set_multicast_list,
-+#endif
- .ndo_do_ioctl = wl_ioctl
- };
-
View
12 pkgs/os-specific/linux/broadcom-sta/linux-3.4.patch
@@ -1,12 +0,0 @@
---- broadcom-sta.orig/src/wl/sys/wl_linux.c
-+++ broadcom-sta.new/src/wl/sys/wl_linux.c
-@@ -40,7 +40,9 @@
- #include <linux/pci_ids.h>
- #define WLC_MAXBSSCFG 1
-
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
- #include <asm/system.h>
-+#endif
- #include <asm/io.h>
- #include <asm/irq.h>
- #include <asm/pgtable.h>
View
0  ...specific/linux/broadcom-sta-v6/linux-recent.patch → ...os-specific/linux/broadcom-sta/linux-recent.patch
File renamed without changes
View
16 pkgs/os-specific/linux/broadcom-sta/makefile.patch
@@ -1,16 +0,0 @@
---- src/Makefile 2010-10-08 00:32:59.000000000 +0200
-+++ src/Makefile 2010-11-09 11:06:28.832999850 +0100
-@@ -27,10 +27,10 @@
- EXTRA_LDFLAGS := $(src)/lib/wlc_hybrid.o_shipped
-
- all:
-- KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`
-+ KBUILD_NOPEDANTIC=1 make -C ${KDIR} M=`pwd`
-
- clean:
-- KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd` clean
-+ KBUILD_NOPEDANTIC=1 make -C ${KDIR} clean
-
- install:
-- install -D -m 755 wl.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless/wl.ko
-+ install -D -m 755 wl.ko $out/lib/modules/${kernelVersion}/kernel/drivers/net/wireless/wl.ko
View
8 pkgs/os-specific/linux/cryptodev/default.nix
@@ -1,8 +1,8 @@
-{ fetchurl, stdenv, kernelDev, onlyHeaders ? false }:
+{ fetchurl, stdenv, kernel, onlyHeaders ? false }:
stdenv.mkDerivation rec {
pname = "cryptodev-linux-1.6";
- name = "${pname}-${kernelDev.version}";
+ name = "${pname}-${kernel.version}";
src = fetchurl {
url = "http://download.gna.org/cryptodev-linux/${pname}.tar.gz";
@@ -10,12 +10,12 @@ stdenv.mkDerivation rec {
};
buildPhase = if !onlyHeaders then ''
- make -C ${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build \
+ make -C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build \
SUBDIRS=`pwd` INSTALL_PATH=$out
'' else ":";
installPhase = stdenv.lib.optionalString (!onlyHeaders) ''
- make -C ${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build \
+ make -C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build \
INSTALL_MOD_PATH=$out SUBDIRS=`pwd` modules_install
'' + ''
mkdir -p $out/include/crypto
View
14 pkgs/os-specific/linux/e1000e/default.nix
@@ -1,19 +1,17 @@
-{ stdenv, fetchurl, kernelDev }:
+{ stdenv, fetchurl, kernel }:
stdenv.mkDerivation {
- name = "e1000e-1.5.1-${kernelDev.version}";
+ name = "e1000e-2.5.4-${kernel.version}";
src = fetchurl {
- url = "mirror://sourceforge/e1000/e1000e-1.5.1.tar.gz";
- sha256 = "0nzjlarpqcpm5y112n3vzra4qv32hiygpfkk10y8g4nln4adhqsw";
+ url = "mirror://sourceforge/e1000/e1000e-2.5.4.tar.gz";
+ sha256 = "0bmihkc7y37jzwi996ryqblnyflyhhbimbnrnmlk419vxlzg1pzi";
};
- buildInputs = [ kernelDev ];
-
configurePhase = ''
cd src
- kernel_version=$( cd ${kernelDev}/lib/modules && echo * )
- sed -i -e 's|/lib/modules|${kernelDev}/lib/modules|' Makefile
+ kernel_version=${kernel.modDirVersion}
+ sed -i -e 's|/lib/modules|${kernel.dev}/lib/modules|' Makefile
export makeFlags="BUILD_KERNEL=$kernel_version"
'';
View
56 pkgs/os-specific/linux/exmap/default.nix
@@ -1,56 +0,0 @@
-{ fetchurl, stdenv, kernelDev, pkgconfig, gtkmm, boost, pcre }:
-
-stdenv.mkDerivation rec {
- name = "exmap-0.10-${kernelDev.version}";
-
- src = fetchurl {
- url = "http://www.berthels.co.uk/exmap/download/${name}.tgz";
- sha256 = "0z00dhl6bdmaz7p9wlvnj0izf0zlrlkv34fz449kxyislpzzxmgn";
- };
-
- patchPhase = ''
- substituteInPlace "kernel/Makefile" \
- --replace '/lib/modules/$(shell uname -r)/build' \
- ${kernelDev}/lib/modules/*/build
-
- # The `proc_root' variable (the root of `/proc') is no longer exported
- # since 2.6.26. Fortunately, one can pass `NULL' instead of `&proc_root'.
- # See http://lkml.org/lkml/2008/3/30/57 .
- substituteInPlace "kernel/exmap.c" \
- --replace "&proc_root" "NULL"
-
- substituteInPlace "src/Makefile" --replace "-Werror" ""
- '';
-
- buildInputs = [ kernelDev pkgconfig gtkmm boost pcre ];
-
- buildPhase = "make build";
-
- # XXX: The tests can only be run one the `exmap' module is loaded.
- doCheck = false;
- #checkPhase = "make test"
-
- installPhase = ''
- mkdir -p "$out/share/${name}"
- cp kernel/*.ko "$out/share/${name}"
-
- mkdir -p "$out/bin"
- cp src/{gexmap,exmtool,elftool,showproc} "$out/bin"
- '';
-
- meta = {
- description = "Exmap, a tool showing the physical memory usage of processes";
-
- longDescription = ''
- Exmap is a utility which takes a snapshot of how the physical
- memory and swap space are currently used by all the processes on
- your system. It examines which page of memory are shared between
- which processes, so that it can share the cost of the pages
- fairly when calculating usage totals.
- '';
-
- homepage = http://www.berthels.co.uk/exmap/;
-
- license = "GPLv2+";
- };
-}
View
10 pkgs/os-specific/linux/frandom/default.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchurl, kernelDev }:
+{ stdenv, fetchurl, kernel }:
let baseName = "frandom-1.1";
in
stdenv.mkDerivation rec {
- name = "${baseName}-${kernelDev.version}";
+ name = "${baseName}-${kernel.version}";
src = fetchurl {
url = "mirror://sourceforge/frandom/${baseName}.tar.gz";
@@ -12,14 +12,14 @@ stdenv.mkDerivation rec {
};
preBuild = ''
- kernelVersion=$(cd ${kernelDev}/lib/modules && ls)
+ kernelVersion=${kernel.modDirVersion}
substituteInPlace Makefile \
--replace "\$(shell uname -r)" "$kernelVersion" \
- --replace "/lib/modules" "${kernelDev}/lib/modules"
+ --replace "/lib/modules" "${kernel.dev}/lib/modules"
'';
installPhase = ''
- kernelVersion=$(cd ${kernelDev}/lib/modules && ls)
+ kernelVersion=${kernel.modDirVersion}
ensureDir $out/lib/modules/$kernelVersion/misc
cp frandom.ko $out/lib/modules/$kernelVersion/misc
View
27 pkgs/os-specific/linux/iscsitarget/default.nix
@@ -1,27 +0,0 @@
-{ stdenv, fetchurl, kernelDev, module_init_tools}:
-
-stdenv.mkDerivation rec {
- name = "iscsitarget-1.4.20.2-${kernelDev.version}";
-
- src = fetchurl {
- url = "mirror://sourceforge/iscsitarget/iscsitarget/1.4.20.2/${name}.tar.gz";
- sha256 = "126kp0yc7vmvdbaw2xfav89340b0h91dvvyib5qbvyrq40n8wg0g";
- };
-
- KSRC = "${kernelDev}/lib/modules/*/build";
-
- DESTDIR = "$(out)";
-
- preConfigure = ''
- export PATH=$PATH:${module_init_tools}/sbin
- sed -i 's|/usr/|/|' Makefile
- '';
-
- buildInputs = [ module_init_tools ];
-
- meta = {
- description = "iSCSI Enterprise Target (IET), software for building an iSCSI storage system on Linux";
- license = "GPLv2+";
- homepage = http://iscsitarget.sourceforge.net;
- };
-}
View
40 pkgs/os-specific/linux/iwlwifi/default.nix
@@ -1,40 +0,0 @@
-{stdenv, fetchurl, kernelDev}:
-
-let version = "1.2.25"; in
-
-stdenv.mkDerivation rec {
- name = "iwlwifi-${version}-${kernelDev.version}";
-
- src = fetchurl {
- url = "http://www.intellinuxwireless.org/iwlwifi/downloads/iwlwifi-${version}.tgz";
- sha256 = "09fjy0swcyd77fdp8x2825wj5cd73hwbzl8mz9sy2ha21p1qwq1d";
- };
-
- preBuild = ''
- substituteInPlace scripts/generate_compatible \
- --replace '/usr/bin/env /bin/bash' $shell
- substituteInPlace Makefile \
- --replace /sbin/depmod true
-
- # Urgh, we need the complete kernel sources for some header
- # files. So unpack the original kernel source tarball and copy
- # the configured include directory etc. on top of it.
- kernelVersion=$(cd ${kernelDev}/lib/modules && ls)
- kernelBuild=$(echo ${kernelDev}/lib/modules/$kernelVersion/source)
- tar xvfj ${kernelDev.src}
- kernelSource=$(echo $(pwd)/linux-*)
- cp -prd $kernelBuild/* $kernelSource
-
- makeFlags=KSRC=$kernelSource
- make $makeFlags || true
- make $makeFlags
-
- installFlags=KMISC=$out/lib/modules/$kernelVersion/misc
- ''; # */
-
- meta = {
- description = "Intel Wireless WiFi Link drivers for Linux";
- homepage = http://www.intellinuxwireless.org/;
- license = "GPLv2";
- };
-}
View
25 pkgs/os-specific/linux/kernel-headers/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, kernel, perl }:
+
+let
+ baseBuildFlags = [ "INSTALL_HDR_PATH=$(out)" "headers_install" ];
+in stdenv.mkDerivation {
+ name = "linux-headers-${kernel.version}";
+
+ inherit (kernel) src patches;
+
+ nativeBuildInputs = [ perl ];
+
+ buildFlags = [ "ARCH=${stdenv.platform.kernelArch}" ] ++ baseBuildFlags;
+
+ crossAttrs = {
+ inherit (kernel.crossDrv) src patches;
+ buildFlags = [ "ARCH=${stdenv.cross.platform.kernelArch}" ] ++ baseBuildFlags;
+ };
+
+ installPhase = ''
+ find $out \( -name ..install.cmd -o -name .install \) -print0 | xargs -0 rm
+ '';
+
+ # Headers shouldn't reference anything else
+ allowedReferences = [];
+}
View
149 pkgs/os-specific/linux/kernel/builder.sh
@@ -1,149 +0,0 @@
-source $stdenv/setup
-
-
-makeFlags="ARCH=$arch SHELL=/bin/sh KBUILD_BUILD_VERSION=1-NixOS $makeFlags"
-if [ -n "$crossConfig" ]; then
- makeFlags="$makeFlags CROSS_COMPILE=$crossConfig-"
-fi
-
-postPatch() {
- # Makefiles are full of /bin/pwd, /bin/false, /bin/bash, etc.
- # Patch these away, assuming the tools are in $PATH.
- for mf in $(find -name Makefile); do
- echo "stripping FHS paths in \`$mf'..."
- sed -i "$mf" -e 's|/usr/bin/||g ; s|/bin/||g'
- done
-}
-
-configurePhase() {
- if test -n "$preConfigure"; then
- eval "$preConfigure"
- fi
-
- export INSTALL_PATH=$out
- export INSTALL_MOD_PATH=$out
-
- # Set our own localversion, if specified.
- rm -f localversion*
- if test -n "$localVersion"; then
- echo "$localVersion" > localversion-nix
- fi
-
- # Patch kconfig to print "###" after every question so that
- # generate-config.pl can answer them.
- sed -e '/fflush(stdout);/i\printf("###");' -i scripts/kconfig/conf.c
-
- # Get a basic config file for later refinement with $generateConfig.
- make $kernelBaseConfig ARCH=$arch
-
- # Create the config file.
- echo "generating kernel configuration..."
- echo "$kernelConfig" > kernel-config
- DEBUG=1 ARCH=$arch KERNEL_CONFIG=kernel-config AUTO_MODULES=$autoModules \
- perl -w $generateConfig
-}
-
-
-installPhase() {
-
- mkdir -p $out
-
- # New kernel versions have a combined tree for i386 and x86_64.
- archDir=$arch
- if test -e arch/x86 -a \( "$arch" = i386 -o "$arch" = x86_64 \); then
- archDir=x86
- fi
-
-
- # Copy the bzImage and System.map.
- cp System.map $out
- if test "$arch" = um; then
- mkdir -p $out/bin
- cp linux $out/bin
- elif test "$kernelTarget" != "vmlinux"; then
- # In any case we copy the 'vmlinux' ELF in the next lines
- cp arch/$archDir/boot/$kernelTarget $out
- fi
-
- cp vmlinux $out
-
- if grep -q "CONFIG_MODULES=y" .config; then
- # Install the modules in $out/lib/modules.
- make modules_install \
- DEPMOD=$kmod/sbin/depmod \
- $makeFlags "${makeFlagsArray[@]}" \
- $installFlags "${installFlagsArray[@]}"
-
- if test -z "$dontStrip"; then
- # Strip the kernel modules.
- echo "Stripping kernel modules..."
- if [ -z "$crossConfig" ]; then
- find $out -name "*.ko" -print0 | xargs -0 strip -S
- else
- find $out -name "*.ko" -print0 | xargs -0 $crossConfig-strip -S
- fi
- fi
-
- # move this to install later on
- # largely copied from early FC3 kernel spec files
- version=$(cd $out/lib/modules && ls -d *)
-
- # remove symlinks and create directories
- rm -f $out/lib/modules/$version/build
- rm -f $out/lib/modules/$version/source
- mkdir $out/lib/modules/$version/build
-
- # copy config
- cp .config $out/lib/modules/$version/build/.config
- ln -s $out/lib/modules/$version/build/.config $out/config
-
- if test "$arch" != um; then
- # copy all Makefiles and Kconfig files
- ln -s $out/lib/modules/$version/build $out/lib/modules/$version/source
- cp --parents `find -type f -name Makefile -o -name "Kconfig*"` $out/lib/modules/$version/build
- cp Module.symvers $out/lib/modules/$version/build
-
- if test "$dontStrip" = "1"; then
- # copy any debugging info that can be found
- cp --parents -rv `find -name \*.debug -o -name debug.a` \
- "$out/lib/modules/$version/build"
- fi
-
- # weed out unneeded stuff
- rm -rf $out/lib/modules/$version/build/Documentation
- rm -rf $out/lib/modules/$version/build/scripts
- rm -rf $out/lib/modules/$version/build/include
-
- # copy architecture dependent files
- cp -a arch/$archDir/scripts $out/lib/modules/$version/build/ || true
- cp -a arch/$archDir/*lds $out/lib/modules/$version/build/ || true
- cp -a arch/$archDir/Makefile*.cpu $out/lib/modules/$version/build/arch/$archDir/ || true
- cp -a --parents arch/$archDir/kernel/asm-offsets.s $out/lib/modules/$version/build/arch/$archDir/kernel/ || true
-
- # copy scripts
- rm -f scripts/*.o
- rm -f scripts/*/*.o
- cp -a scripts $out/lib/modules/$version/build
-
- # copy include files
- includeDir=$out/lib/modules/$version/build/include
- mkdir -p $includeDir
- (cd include && cp -a * $includeDir)
- (cd arch/$archDir/include && cp -a * $includeDir || true)
- (cd arch/$archDir/include && cp -a asm/* $includeDir/asm/ || true)
- (cd arch/$archDir/include && cp -a generated/asm/* $includeDir/asm/ || true)
- (cd arch/$archDir/include/asm/mach-generic && cp -a * $includeDir/ || true)
- # include files for special arm architectures
- if [ "$archDir" == "arm" ]; then
- cp -a --parents arch/arm/mach-*/include $out/lib/modules/$version/build
- fi
- fi
- fi
-
- if test -n "$postInstall"; then
- eval "$postInstall";
- fi
-}
-
-
-genericBuild
View
5 pkgs/os-specific/linux/kernel/generate-config.pl
@@ -11,6 +11,9 @@
use strict;
use IPC::Open2;
+use Cwd;
+
+my $wd = getcwd;
my $debug = $ENV{'DEBUG'};
my $autoModules = $ENV{'AUTO_MODULES'};
@@ -36,7 +39,7 @@
sub runConfig {
# Run `make config'.
- my $pid = open2(\*IN, \*OUT, "make config SHELL=bash ARCH=$ENV{ARCH}");
+ my $pid = open2(\*IN, \*OUT, "make -C $ENV{SRC} O=$wd config SHELL=bash ARCH=$ENV{ARCH}");
# Parse the output, look for questions and then send an
# appropriate answer.
View
168 pkgs/os-specific/linux/kernel/generic.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, mktemp, kmod, bc
+{ stdenv, perl, linuxManualConfig
, # The kernel source tarball.
src
@@ -23,20 +23,7 @@
# symbolic name and `patch' is the actual patch. The patch may
# optionally be compressed with gzip or bzip2.
kernelPatches ? []
-
-, # Allows you to set your own kernel version suffix (e.g.,
- # "-my-kernel").
- localVersion ? ""
-
-, preConfigure ? ""
, extraMeta ? {}
-, ubootChooser ? null
-, postInstall ? ""
-
-, # After the builder did a 'make all' (kernel + modules)
- # we force building the target asked: bzImage/zImage/uImage/...
- postBuild ? "make $makeFlags $kernelTarget; make $makeFlags -C scripts unifdef"
-
, ...
}:
@@ -52,93 +39,90 @@ let
map ({extraConfig ? "", ...}: extraConfig) kernelPatches;
in lib.concatStringsSep "\n" ([baseConfig] ++ configFromPatches);
+ configfile = stdenv.mkDerivation {
+ name = "linux-config-${version}";
+
+ generateConfig = ./generate-config.pl;
+
+ kernelConfig = kernelConfigFun config;
+
+ ignoreConfigErrors = stdenv.platform.name != "pc";
+
+ nativeBuildInputs = [ perl ];
+
+ platformName = stdenv.platform.name;
+ kernelBaseConfig = stdenv.platform.kernelBaseConfig;
+ kernelTarget = stdenv.platform.kernelTarget;
+ autoModules = stdenv.platform.kernelAutoModules;
+ arch = stdenv.platform.kernelArch;
+
+ crossAttrs = let
+ cp = stdenv.cross.platform;
+ in {
+ arch = cp.kernelArch;
+ platformName = cp.name;
+ kernelBaseConfig = cp.kernelBaseConfig;
+ kernelTarget = cp.kernelTarget;
+ autoModules = cp.kernelAutoModules;
+
+ # Just ignore all options that don't apply (We are lazy).
+ ignoreConfigErrors = true;
+
+ kernelConfig = kernelConfigFun configCross;
+
+ inherit (kernel.crossDrv) src patches preUnpack;
+ };
+
+ prePatch = kernel.prePatch + ''
+ # Patch kconfig to print "###" after every question so that
+ # generate-config.pl from the generic builder can answer them.
+ sed -e '/fflush(stdout);/i\printf("###");' -i scripts/kconfig/conf.c
+ '';
+
+ inherit (kernel) src patches preUnpack;
+
+ buildPhase = ''
+ cd $buildRoot
+
+ # Get a basic config file for later refinement with $generateConfig.
+ make -C ../$sourceRoot O=$PWD $kernelBaseConfig ARCH=$arch
+
+ # Create the config file.
+ echo "generating kernel configuration..."
+ echo "$kernelConfig" > kernel-config
+ DEBUG=1 ARCH=$arch KERNEL_CONFIG=kernel-config AUTO_MODULES=$autoModules \
+ SRC=../$sourceRoot perl -w $generateConfig
+ '';
+
+ installPhase = "mv .config $out";
+ };
+
+ kernel = linuxManualConfig {
+ inherit version modDirVersion src kernelPatches;
+
+ configfile = configfile.nativeDrv or configfile;
+
+ crossConfigfile = configfile.crossDrv or configfile;
+
+ config = { CONFIG_MODULES = "y"; CONFIG_FW_LOADER = "m"; };
+
+ crossConfig = { CONFIG_MODULES = "y"; CONFIG_FW_LOADER = "m"; };
+ };
+
configWithPlatform = kernelPlatform:
import ./common-config.nix { inherit stdenv version kernelPlatform extraConfig; };
config = configWithPlatform stdenv.platform;
configCross = configWithPlatform stdenv.cross.platform;
-in
-
-stdenv.mkDerivation {
- name = "linux-${version}";
-
- enableParallelBuilding = true;
-
passthru = {
- inherit version modDirVersion kernelPatches;
# Combine the `features' attribute sets of all the kernel patches.
features = lib.fold (x: y: (x.features or {}) // y) features kernelPatches;
+
+ meta = kernel.meta // extraMeta;
};
- builder = ./builder.sh;
-
- generateConfig = ./generate-config.pl;
-
- inherit preConfigure src kmod localVersion postInstall postBuild;
-
- patches = map (p: p.patch) kernelPatches;
-
- kernelConfig = kernelConfigFun config;
-
- # For UML and non-PC, just ignore all options that don't apply (We are lazy).
- ignoreConfigErrors = stdenv.platform.name != "pc";
-
- nativeBuildInputs = [ perl mktemp bc ];
-
- buildInputs = lib.optional (stdenv.platform.uboot != null)
- (ubootChooser stdenv.platform.uboot);
-
- platformName = stdenv.platform.name;
- kernelBaseConfig = stdenv.platform.kernelBaseConfig;
- kernelTarget = stdenv.platform.kernelTarget;
- autoModules = stdenv.platform.kernelAutoModules;
-
- # Should we trust platform.kernelArch? We can only do
- # that once we differentiate i686/x86_64 in platforms.
- arch =
- if stdenv.system == "i686-linux" then "i386" else
- if stdenv.system == "x86_64-linux" then "x86_64" else
- if stdenv.isArm then "arm" else
- if stdenv.system == "mips64el-linux" then "mips" else
- abort "Platform ${stdenv.system} is not supported.";
-
- crossAttrs = let
- cp = stdenv.cross.platform;
- in
- assert cp.name == "sheevaplug" -> cp.uboot != null;
- {
- arch = cp.kernelArch;
- platformName = cp.name;
- kernelBaseConfig = cp.kernelBaseConfig;
- kernelTarget = cp.kernelTarget;
- autoModules = cp.kernelAutoModules;
-
- # Just ignore all options that don't apply (We are lazy).
- ignoreConfigErrors = true;
-
- kernelConfig = kernelConfigFun configCross;
-
- # The substitution of crossAttrs happens *after* the stdenv cross adapter sets
- # the parameters for the usual stdenv. Thus, we need to specify
- # the ".crossDrv" in the buildInputs here.
- buildInputs = lib.optional (cp.uboot != null) (ubootChooser cp.uboot).crossDrv;
- };
-
- meta = {
- description =
- "The Linux kernel" +
- (if kernelPatches == [] then "" else
- " (with patches: "
- + lib.concatStrings (lib.intersperse ", " (map (x: x.name) kernelPatches))
- + ")");
- license = "GPLv2";
- homepage = http://www.kernel.org/;
- maintainers = [
- lib.maintainers.eelco
- lib.maintainers.chaoflow
- ];
- platforms = lib.platforms.linux;
- } // extraMeta;
-}
+ nativeDrv = lib.addPassthru kernel.nativeDrv passthru;
+ crossDrv = lib.addPassthru kernel.crossDrv passthru;
+in if kernel ? crossDrv then nativeDrv // { inherit nativeDrv crossDrv; } else lib.addPassthru kernel passthru
View
322 pkgs/os-specific/linux/kernel/manual-config.nix
@@ -1,45 +1,16 @@
-{ stdenv, runCommand, nettools, bc, perl, kmod, writeTextFile }:
+{ stdenv, runCommand, nettools, bc, perl, kmod, writeTextFile, ubootChooser }:
let
- inherit (stdenv.lib)
- hasAttr getAttr optionalAttrs optional optionalString maintainers platforms;
-
- # Function to parse the config file into a nix expression
- readConfig = configFile:
- let
- configAttrs = import "${runCommand "config.nix" {} ''
- echo "{" > "$out"
- while IFS='=' read key val; do
- [ "x''${key#CONFIG_}" != "x$key" ] || continue
- no_firstquote="''${val#\"}";
- echo ' "'"$key"'" = "'"''${no_firstquote%\"}"'";' >> "$out"
- done < "${configFile}"
- echo "}" >> $out
- ''}";
-
- config = configAttrs // rec {
- attrName = attr: "CONFIG_" + attr;
-
- isSet = attr: hasAttr (attrName attr) config;
-
- getValue = attr: if isSet attr then getAttr (attrName attr) config else null;
-
- isYes = attr: (isSet attr) && ((getValue attr) == "y");
-
- isNo = attr: (isSet attr) && ((getValue attr) == "n");
-
- isModule = attr: (isSet attr) && ((getValue attr) == "m");
-
- isEnabled = attr: (isModule attr) || (isYes attr);
-
- isDisabled = attr: (!(isSet attr)) || (isNo attr);
- };
- in
- config;
-
-in
-
-{
+ readConfig = configfile: import (runCommand "config.nix" {} ''
+ echo "{" > "$out"
+ while IFS='=' read key val; do
+ [ "x''${key#CONFIG_}" != "x$key" ] || continue
+ no_firstquote="''${val#\"}";
+ echo ' "'"$key"'" = "'"''${no_firstquote%\"}"'";' >> "$out"
+ done < "${configfile}"
+ echo "}" >> $out
+ '').outPath;
+in {
# The kernel version
version,
# The version of the kernel module directory
@@ -48,127 +19,212 @@ in
src,
# Any patches
kernelPatches ? [],
- # The kernel .config file
+ # Patches for native compiling only
+ nativeKernelPatches ? [],
+ # Patches for cross compiling only
+ crossKernelPatches ? [],
+ # The native kernel .config file
configfile,
+ # The cross kernel .config file
+ crossConfigfile ? configfile,
# Manually specified nixexpr representing the config
# If unspecified, this will be autodetected from the .config
- config ? optionalAttrs allowImportFromDerivation (readConfig configfile),
+ config ? stdenv.lib.optionalAttrs allowImportFromDerivation (readConfig configfile),
+ # Cross-compiling config
+ crossConfig ? if allowImportFromDerivation then (readConfig crossConfigfile) else config,
# Whether to utilize the controversial import-from-derivation feature to parse the config
allowImportFromDerivation ? false
}:
let
- installkernel = name: writeTextFile { name = "installkernel"; executable=true; text = ''
- #!/bin/sh
- mkdir $4
- cp -av $2 $4/${name}
- cp -av $3 $4
- '';};
-
- isModular = config.isYes "MODULES";
+ inherit (stdenv.lib)
+ hasAttr getAttr optional optionalString maintainers platforms;
- installsFirmware = (config.isEnabled "FW_LOADER") &&
- (isModular || (config.isDisabled "FIRMWARE_IN_KERNEL"));
+ installkernel = writeTextFile { name = "installkernel"; executable=true; text = ''
+ #!${stdenv.shell} -e
+ mkdir -p $4
+ cp -av $2 $4
+ cp -av $3 $4
+ ''; };
commonMakeFlags = [
"O=$(buildRoot)"
- "INSTALL_PATH=$(out)"
- ] ++ (optional isModular "INSTALL_MOD_PATH=$(out)")
- ++ optional installsFirmware "INSTALL_FW_PATH=$(out)/lib/firmware";
+ "DEPMOD=${kmod}/bin/depmod"
+ ];
- sourceRoot = stdenv.mkDerivation {
- name = "linux-${version}-source";
+ drvAttrs = config_: platform: kernelPatches: configfile:
+ let
+ config = let attrName = attr: "CONFIG_" + attr; in {
+ isSet = attr: hasAttr (attrName attr) config;
- inherit src;
+ getValue = attr: if config.isSet attr then getAttr (attrName attr) config else null;
- patches = map (p: p.patch) kernelPatches;
+ isYes = attr: (config.getValue attr) == "y";
- phases = [ "unpackPhase" "patchPhase" "installPhase" ];
+ isNo = attr: (config.getValue attr) == "n";
- prePatch = ''
- for mf in $(find -name Makefile -o -name Makefile.include -o -name install.sh); do
- echo "stripping FHS paths in \`$mf'..."
- sed -i "$mf" -e 's|/usr/bin/||g ; s|/bin/||g ; s|/sbin/||g'
- done
- sed -i Makefile -e 's|= depmod|= ${kmod}/sbin/depmod|'
- '';
+ isModule = attr: (config.getValue attr) == "m";
- installPhase = ''
- cd ..
- mv $sourceRoot $out
- '';
- };
-in
+ isEnabled = attr: (config.isModule attr) || (config.isYes attr);
-stdenv.mkDerivation {
- name = "linux-${version}";
+ isDisabled = attr: (!(config.isSet attr)) || (config.isNo attr);
+ } // config_;
- enableParallelBuilding = true;
+ isModular = config.isYes "MODULES";
- outputs = if isModular then [ "out" "dev" ] else null;
+ installsFirmware = (config.isEnabled "FW_LOADER") &&
+ (isModular || (config.isDisabled "FIRMWARE_IN_KERNEL"));
+ in {
+ outputs = if isModular then [ "out" "dev" ] else null;
- passthru = {
- inherit version modDirVersion config kernelPatches src;
- };
+ passthru = {
+ inherit version modDirVersion config kernelPatches;
+ };
- inherit sourceRoot;
+ inherit src;
+
+ preUnpack = ''
+ mkdir build
+ export buildRoot="$(pwd)/build"
+ '';
+
+ patches = map (p: p.patch) kernelPatches;
+
+ prePatch = ''
+ for mf in $(find -name Makefile -o -name Makefile.include -o -name install.sh); do
+ echo "stripping FHS paths in \`$mf'..."
+ sed -i "$mf" -e 's|/usr/bin/||g ; s|/bin/||g ; s|/sbin/||g'
+ done
+ '';
+
+ configurePhase = ''
+ runHook preConfigure
+ ln -sv ${configfile} $buildRoot/.config
+ make $makeFlags "''${makeFlagsArray[@]}" oldconfig
+ runHook postConfigure
+ '';
+
+ buildFlags = [ "KBUILD_BUILD_VERSION=1-NixOS" platform.kernelTarget ] ++ optional isModular "modules";
+
+ installFlags = [
+ "INSTALLKERNEL=${installkernel}"
+ "INSTALL_PATH=$(out)"
+ ] ++ (optional isModular "INSTALL_MOD_PATH=$(out)")
+ ++ optional installsFirmware "INSTALL_FW_PATH=$(out)/lib/firmware";
+
+ # Some image types need special install targets (e.g. uImage is installed with make uinstall)
+ installTargets = [ (if platform.kernelTarget == "uImage" then "uinstall" else "install") ];
+
+ postInstall = optionalString installsFirmware ''
+ mkdir -p $out/lib/firmware
+ '' + (if isModular then ''
+ make modules_install $makeFlags "''${makeFlagsArray[@]}" \
+ $installFlags "''${installFlagsArray[@]}"
+ unlink $out/lib/modules/${modDirVersion}/build
+ unlink $out/lib/modules/${modDirVersion}/source
+
+ mkdir -p $dev/lib/modules/${modDirVersion}
+ cd ..
+ mv $sourceRoot $dev/lib/modules/${modDirVersion}/source
+ cd $dev/lib/modules/${modDirVersion}/source
+
+ mv $buildRoot/.config $buildRoot/Module.symvers $TMPDIR
+ rm -fR $buildRoot
+ mkdir $buildRoot
+ mv $TMPDIR/.config $TMPDIR/Module.symvers $buildRoot
+ make modules_prepare $makeFlags "''${makeFlagsArray[@]}"
+ mv $buildRoot $dev/lib/modules/${modDirVersion}/build
+
+ # !!! No documentation on how much of the source tree must be kept
+ # If/when kernel builds fail due to missing files, you can add
+ # them here. Note that we may see packages requiring headers
+ # from drivers/ in the future; it adds 50M to keep all of its
+ # headers on 3.10 though.
+
+ chmod +w -R ../source
+ arch=`cd $dev/lib/modules/${modDirVersion}/build/arch; ls`
+
+ # Remove unusued arches
+ mv arch/$arch .
+ rm -fR arch
+ mkdir arch
+ mv $arch arch
+
+ # Remove all driver-specific code (50M of which is headers)
+ rm -fR drivers
+
+ # Keep all headers
+ find . -type f -name '*.h' -print0 | xargs -0 chmod -w
+
+ # Keep root and arch-specific Makefiles
+ chmod -w Makefile
+ chmod -w arch/$arch/Makefile
+
+ # Keep whole scripts dir
+ chmod -w -R scripts
+
+ # Delete everything not kept
+ find . -type f -perm -u=w -print0 | xargs -0 rm
+
+ # Delete empty directories
+ find -empty -type d -delete
+ '' else optionalString installsFirmware ''
+ make firmware_install $makeFlags "''${makeFlagsArray[@]}" \
+ $installFlags "''${installFlagsArray[@]}"
+ '');
+
+ # !!! This leaves references to gcc in $dev
+ # that we might be able to avoid
+ postFixup = if isModular then ''
+ if [ -z "$dontStrip" ]; then
+ find $out -name "*.ko" -print0 | xargs -0 -r ''${crossConfig+$crossConfig-}strip -S
+ fi
+ # !!! Should this be part of stdenv? Also patchELF should take an argument...
+ prefix=$dev
+ patchELF
+ prefix=$out
+ '' else null;
+
+ meta = {
+ description =
+ "The Linux kernel" +
+ (if kernelPatches == [] then "" else
+ " (with patches: "
+ + stdenv.lib.concatStrings (stdenv.lib.intersperse ", " (map (x: x.name) kernelPatches))
+ + ")");
+ license = "GPLv2";
+ homepage = http://www.kernel.org/;
+ maintainers = [
+ maintainers.shlevy
+ ];
+ platforms = platforms.linux;
+ };
+ };
+in
- unpackPhase = ''
- mkdir build
- export buildRoot="$(pwd)/build"
- cd ${sourceRoot}
- '';
+stdenv.mkDerivation ((drvAttrs config stdenv.platform (kernelPatches ++ nativeKernelPatches) configfile) // {
+ name = "linux-${version}";
- configurePhase = ''
- runHook preConfigure
- ln -sv ${configfile} $buildRoot/.config
- make $makeFlags "''${makeFlagsArray[@]}" oldconfig
- runHook postConfigure
- '';
+ enableParallelBuilding = true;
- nativeBuildInputs = [ perl bc nettools ];
+ nativeBuildInputs = [ perl bc nettools ] ++ optional (stdenv.platform.uboot != null)
+ (ubootChooser stdenv.platform.uboot);
makeFlags = commonMakeFlags ++ [
- "INSTALLKERNEL=${installkernel stdenv.platform.kernelTarget}"
+ "ARCH=${stdenv.platform.kernelArch}"
];
- crossAttrs = {
- makeFlags = commonMakeFlags ++ [
- "INSTALLKERNEL=${installkernel stdenv.cross.platform.kernelTarget}"
- ];
- };
-
- postInstall = optionalString installsFirmware ''
- mkdir -p $out/lib/firmware
- '' + (if isModular then ''
- make modules_install $makeFlags "''${makeFlagsArray[@]}" \
- $installFlags "''${installFlagsArray[@]}"
- rm -f $out/lib/modules/${modDirVersion}/build
- mkdir -p $dev/lib/modules/${modDirVersion}
- mv $out/lib/modules/${modDirVersion}/source $dev/lib/modules/${modDirVersion}/source
- mv $buildRoot $dev/lib/modules/${modDirVersion}/build
- '' else optionalString installsFirmware ''
- make firmware_install $makeFlags "''${makeFlagsArray[@]}" \
- $installFlags "''${installFlagsArray[@]}"
- '');
-
- postFixup = if isModular then ''
- if [ -z "$dontStrip" ]; then
- find $out -name "*.ko" -print0 | xargs -0 -r strip -S
- # Remove all references to the source directory to avoid unneeded
- # runtime dependencies
- find $out -name "*.ko" -print0 | xargs -0 -r sed -i \
- "s|${sourceRoot}|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-${sourceRoot.name}|g"
- fi
- '' else null;
-
- meta = {
- description = "The Linux kernel";
- license = "GPLv2";
- homepage = http://www.kernel.org/;
- maintainers = [
- maintainers.shlevy
- ];
- platforms = platforms.linux;
+ crossAttrs = let cp = stdenv.cross.platform; in
+ (drvAttrs crossConfig cp (kernelPatches ++ crossKernelPatches) crossConfigfile) // {
+ makeFlags = commonMakeFlags ++ [
+ "ARCH=${cp.kernelArch}"
+ "CROSS_COMPILE=$(crossConfig)-"
+ ];
+
+ # !!! uboot has messed up cross-compiling, nativeDrv builds arm tools on x86,
+ # crossDrv builds x86 tools on x86 (but arm uboot). If this is fixed, uboot
+ # can just go into buildInputs (but not nativeBuildInputs since cp.uboot
+ # may be different from stdenv.platform.uboot)
+ buildInputs = optional (cp.uboot != null) (ubootChooser cp.uboot).crossDrv;
};
-}
+})
View
46 pkgs/os-specific/linux/kernel/patches.nix
@@ -18,24 +18,6 @@ let
};
};
- makeAufs3StandalonePatch = {version, rev, sha256}:
-
- stdenv.mkDerivation {
- name = "aufs3-standalone-${version}.patch";
-
- src = fetchgit {
- url = git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git;
- inherit sha256 rev;
- };
-
- phases = [ "unpackPhase" "installPhase" ];
-
- # Instructions from http://aufs.git.sourceforge.net/git/gitweb.cgi?p=aufs/aufs3-standalone.git;a=blob;f=Documentation/filesystems/aufs/README;h=b8cf077635b323d1b454266366f05f476bbd09cb;hb=1067b9d8d64d23c70d905c9cd3c90a669e39c4d4
- installPhase = ''
- cat aufs3-base.patch aufs3-proc_map.patch aufs3-standalone.patch > $out
- '';
- };
-
makeAppArmorPatch = {apparmor, version}:
stdenv.mkDerivation {
name = "apparmor-${version}.patch";
@@ -68,34 +50,6 @@ rec {
features.secPermPatch = true;
};
- aufs3_2 = rec {
- name = "aufs3.2";
- version = "3.2.20121210";
- utilRev = "91af15f977d12e02165759620005f6ce1a4d7602";
- utilHash = "dda4df89828dcf0e4012d88b4aa3eda8c30af69d6530ff5fedc2411de872c996";
- patch = makeAufs3StandalonePatch {
- inherit version;
- rev = "0bf50c3b82f98e2ddc4c9ba0657f28ebfa8d15cb";
- sha256 = "bc4b65cb77c62744db251da98488fdf4962f14a144c045cea6cbbbd42718ff89";
- };
- features.aufsBase = true;
- features.aufs3 = true;
- };
-
- aufs3_4 = rec {
- name = "aufs3.4";
- version = "3.4.20121210";
- utilRev = "91af15f977d12e02165759620005f6ce1a4d7602";
- utilHash = "dda4df89828dcf0e4012d88b4aa3eda8c30af69d6530ff5fedc2411de872c996";
- patch = makeAufs3StandalonePatch {
- inherit version;
- rev = "2faacd9baffb37df3b9062cc554353eebe68df1e";
- sha256 = "3ecf97468f5e85970d9fd2bfc61e38c7f5ae2c6dde0045d5a17de085c411d452";
- };
- features.aufsBase = true;
- features.aufs3 = true;
- };
-
no_xsave =
{ name = "no-xsave";
patch = ./no-xsave.patch;
View
7 pkgs/os-specific/linux/kernel/perf.nix
@@ -1,13 +1,13 @@
-{ stdenv, kernelDev, elfutils, python, perl, newt, slang, asciidoc, xmlto
+{ stdenv, kernel, elfutils, python, perl, newt, slang, asciidoc, xmlto
, docbook_xsl, docbook_xml_dtd_45, libxslt, flex, bison, pkgconfig
, withGtk ? false, gtk ? null }:
assert withGtk -> gtk != null;
stdenv.mkDerivation {
- name = "perf-linux-${kernelDev.version}";
+ name = "perf-linux-${kernel.version}";
- inherit (kernelDev) src patches;
+ inherit (kernel) src patches;
preConfigure = ''
cd tools/perf
@@ -31,6 +31,7 @@ stdenv.mkDerivation {
propagatedBuildInputs = [ elfutils.crossDrv newt.crossDrv ];
makeFlags = "CROSS_COMPILE=${stdenv.cross.config}-";
elfutils = elfutils.crossDrv;
+ inherit (kernel.crossDrv) src patches;
};
meta = {
View
78 pkgs/os-specific/linux/klibc/default.nix
@@ -1,74 +1,48 @@
-{ stdenv, fetchurl, perl, bison, mktemp, linuxHeaders, linuxHeadersCross, kernelDev ? null }:
-
-assert stdenv.isLinux;
+{ stdenv, fetchurl, kernelHeaders, kernel, perl }:
let
- version = "1.5.24";
- baseMakeFlags = ["V=1" "prefix=$out" "SHLIBDIR=$out/lib"];
+ version = "2.0.3";
+
+ commonMakeFlags = [
+ "prefix=$(out)"
+ "SHLIBDIR=$(out)/lib"
+ ];
in
stdenv.mkDerivation {
- name = "klibc-${version}${stdenv.lib.optionalString (kernelDev != null) "-${kernelDev.version}"}";
+ name = "klibc-${version}-${kernel.version}";
src = fetchurl {
- url = "mirror://kernel/linux/libs/klibc/1.5/klibc-${version}.tar.bz2";
- sha256 = "18lm32dlj9k2ky9wwk274zmc3jndgrb41b6qm82g3lza6wlw3yki";
+ url = "mirror://kernel/linux/libs/klibc/2.0/klibc-${version}.tar.xz";
+ sha256 = "02035f2b230020de569d40605485121e0fe481ed33a93bdb8bf8c6ee2695fffa";
};
- # Trick to make this build on nix. It expects to have the kernel sources
- # instead of only the linux kernel headers.
- # 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 = stdenv.lib.optionalString (kernelDev == null) ''
- sed -i -e /headers_install/d scripts/Kbuild.install
- '';
-
- makeFlags = baseMakeFlags;
+ patches = [ ./no-reinstall-kernel-headers.patch ];
- inherit linuxHeaders;
+ nativeBuildInputs = [ perl ];
- crossAttrs = {
- makeFlags = baseMakeFlags ++ [ "CROSS_COMPILE=${stdenv.cross.config}-"
- "KLIBCARCH=${stdenv.cross.arch}" ];
+ makeFlags = commonMakeFlags ++ [
+ "KLIBCARCH=${stdenv.platform.kernelArch}"
+ "KLIBCKERNELSRC=${kernelHeaders}"
+ ] ++ stdenv.lib.optional (stdenv.platform.kernelArch == "arm") "CONFIG_AEABI=y";
- patchPhase = ''
- sed -i 's/-fno-pic -mno-abicalls/& -mabi=32/' usr/klibc/arch/mips/MCONFIG
- sed -i /KLIBCKERNELSRC/d scripts/Kbuild.install
- # Wrong check for __mips64 in klibc
- sed -i s/__mips64__/__mips64/ usr/include/fcntl.h
- '';
-
- linuxHeaders = linuxHeadersCross;
+ crossAttrs = {
+ makeFlags = commonMakeFlags ++ [
+ "KLIBCARCH=${stdenv.cross.platform.kernelArch}"
+ "KLIBCKERNELSRC=${kernelHeaders.crossDrv}"
+ "CROSS_COMPILE=${stdenv.cross.config}-"
+ ] ++ stdenv.lib.optional (stdenv.cross.platform.kernelArch == "arm") "CONFIG_AEABI=y";
};
-
- # The AEABI option concerns only arm systems, and does not affect the build for
- # other systems.
- preBuild = ''
- sed -i /CONFIG_AEABI/d defconfig
- echo "CONFIG_AEABI=y" >> defconfig
- makeFlags=$(eval "echo $makeFlags")
- '' + (if kernelDev == null then ''
- mkdir linux
- cp -prsd $linuxHeaders/include linux/
- chmod -R u+w linux/include/
- '' else ''
- tar xvf ${kernelDev.src}
- mv linux* linux
- cd linux
- ln -sv ${kernelDev}/config .config
- make prepare
- cd ..
- '');
-
# Install static binaries as well.
postInstall = ''
dir=$out/lib/klibc/bin.static
mkdir $dir
cp $(find $(find . -name static) -type f ! -name "*.g" -a ! -name ".*") $dir/
cp usr/dash/sh $dir/
+
+ for file in ${kernelHeaders}/include/*; do
+ ln -sv $file $out/lib/klibc/include
+ done
'';
-
- nativeBuildInputs = [ perl bison mktemp ];
}
View
11 pkgs/os-specific/linux/klibc/no-reinstall-kernel-headers.patch
@@ -0,0 +1,11 @@
+diff -Naur klibc-2.0.3-orig/scripts/Kbuild.install klibc-2.0.3/scripts/Kbuild.install
+--- klibc-2.0.3-orig/scripts/Kbuild.install 2013-12-03 13:53:46.000000000 -0500
++++ klibc-2.0.3/scripts/Kbuild.install 2014-01-04 18:17:09.342609021 -0500
+@@ -95,7 +95,6 @@
+ $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include
+ $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib
+ $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin
+- $(Q)$(MAKE) -C $(KLIBCKERNELSRC) ARCH=$(KLIBCARCH) INSTALL_HDR_PATH=$(INSTALLROOT)$(INSTALLDIR)/$(KCROSS) headers_install
+ $(Q)cp -rf usr/include/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/.
+ $(Q)chmod -R a+rX $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include
+ $(Q)$(install-data) $(srctree)/klcc/klcc.1 $(INSTALLROOT)$(mandir)/man1/$(KCROSS)klcc.1
View
6 pkgs/os-specific/linux/lttng-modules/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchurl, kernelDev }:
+{ stdenv, fetchurl, kernel }:
stdenv.mkDerivation rec {
pname = "lttng-modules-2.3.0";
- name = "${pname}-${kernelDev.version}";
+ name = "${pname}-${kernel.version}";
src = fetchurl {
url = "https://lttng.org/files/lttng-modules/${pname}.tar.bz2";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
patches = [ ./lttng-fix-build-error-on-linux-3.2.patch ];
preConfigure = ''
- export KERNELDIR="${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build"
+ export KERNELDIR="${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
export INSTALL_MOD_PATH="$out"
'';
View
18 pkgs/os-specific/linux/ndiswrapper/default.nix
@@ -1,14 +1,17 @@
-{ stdenv, fetchurl, kernelDev, perl }:
+{ stdenv, fetchurl, kernel, perl, kmod }:
stdenv.mkDerivation {
- name = "ndiswrapper-1.56-