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 ac2035287f), this
should be unobjectionable.

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2014-01-05 07:13:19 -05:00
commit 139f8949e6
62 changed files with 539 additions and 1255 deletions

View File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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}";
name = "broadcom-sta-${version}-${kernel.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";
};
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 =
[ ./makefile.patch ./linux-2.6.39.patch ./linux-3.2.patch
./linux-3.4.patch ./license.patch
];
patches = [
./linux-recent.patch
./license.patch
];
makeFlags = "KDIR=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build";
makeFlags = "KBASE=${kernel.dev}/lib/modules/${kernel.modDirVersion}";
unpackPhase =
''
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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 @@ close ANSWERS;
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 File

@ -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 File

@ -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}
inherit (stdenv.lib)
hasAttr getAttr optional optionalString maintainers platforms;
installkernel = writeTextFile { name = "installkernel"; executable=true; text = ''
#!${stdenv.shell} -e
mkdir -p $4
cp -av $2 $4
cp -av $3 $4
'';};
isModular = config.isYes "MODULES";
installsFirmware = (config.isEnabled "FW_LOADER") &&
(isModular || (config.isDisabled "FIRMWARE_IN_KERNEL"));
''; };
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
'';
};
isEnabled = attr: (config.isModule attr) || (config.isYes attr);
isDisabled = attr: (!(config.isSet attr)) || (config.isNo attr);
} // config_;
isModular = config.isYes "MODULES";
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;
};
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
stdenv.mkDerivation {
stdenv.mkDerivation ((drvAttrs config stdenv.platform (kernelPatches ++ nativeKernelPatches) configfile) // {
name = "linux-${version}";
enableParallelBuilding = true;
outputs = if isModular then [ "out" "dev" ] else null;
passthru = {
inherit version modDirVersion config kernelPatches src;
};
inherit sourceRoot;
unpackPhase = ''
mkdir build
export buildRoot="$(pwd)/build"
cd ${sourceRoot}
'';
configurePhase = ''
runHook preConfigure
ln -sv ${configfile} $buildRoot/.config
make $makeFlags "''${makeFlagsArray[@]}" oldconfig
runHook postConfigure
'';
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}"
];
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;
};
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;
};
}
})

View File

@ -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 File

@ -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 File

@ -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 ];
makeFlags = commonMakeFlags ++ [
"KLIBCARCH=${stdenv.platform.kernelArch}"
"KLIBCKERNELSRC=${kernelHeaders}"
] ++ stdenv.lib.optional (stdenv.platform.kernelArch == "arm") "CONFIG_AEABI=y";
crossAttrs = {
makeFlags = baseMakeFlags ++ [ "CROSS_COMPILE=${stdenv.cross.config}-"
"KLIBCARCH=${stdenv.cross.arch}" ];
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;
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 File

@ -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 File

@ -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 File

@ -1,14 +1,17 @@
{ stdenv, fetchurl, kernelDev, perl }:
{ stdenv, fetchurl, kernel, perl, kmod }:
stdenv.mkDerivation {
name = "ndiswrapper-1.56-${kernelDev.version}";
name = "ndiswrapper-1.59-${kernel.version}";
patches = [ ./no-sbin.patch ];
# need at least .config and include
kernel = kernelDev;
kernel = kernel.dev;
buildPhase = "
echo make KBUILD=$(echo \$kernel/lib/modules/*/build);
echo -n $kernel/lib/modules/*/build > kbuild_path
export PATH=${kmod}/sbin:$PATH
make KBUILD=$(echo \$kernel/lib/modules/*/build);
";
@ -23,14 +26,11 @@ stdenv.mkDerivation {
# should we use unstable?
src = fetchurl {
url = mirror://sourceforge/ndiswrapper/ndiswrapper-1.56.tar.gz;
sha256 = "10yqg1a08v6z1qm1qr1v4rbhl35c90gzrazapr09vp372hky8f57";
url = mirror://sourceforge/ndiswrapper/ndiswrapper-1.59.tar.gz;
sha256 = "1g6lynccyg4m7gd7vhy44pypsn8ifmibq6rqgvc672pwngzx79b6";
};
buildInputs = [ kernelDev perl ];
# this is a patch against svn head, not stable version
patches = [./prefix.patch];
buildInputs = [ perl ];
meta = {
description = "Ndis driver wrapper for the Linux kernel";

View File

@ -0,0 +1,12 @@
diff -Naur ndiswrapper-1.59-orig/driver/Makefile ndiswrapper-1.59/driver/Makefile
--- ndiswrapper-1.59-orig/driver/Makefile 2013-11-28 14:42:35.000000000 -0500
+++ ndiswrapper-1.59/driver/Makefile 2014-01-04 18:31:43.242377375 -0500
@@ -191,7 +191,7 @@
rm -rf .tmp_versions
install: config_check $(MODULE)
- @/sbin/modinfo $(MODULE) | grep -q "^vermagic: *$(KVERS) " || \
+ @modinfo $(MODULE) | grep -q "^vermagic: *$(KVERS) " || \
{ echo "$(MODULE)" is not for Linux $(KVERS); exit 1; }
mkdir -p -m 755 $(DESTDIR)$(INST_DIR)
install -m 0644 $(MODULE) $(DESTDIR)$(INST_DIR)

View File

@ -1,66 +0,0 @@
diff -r -u ndiswrapper-1.53/driver/loader.c ndiswrapper-1.53/driver/loader.c
--- ndiswrapper-1.53/driver/loader.c 2008-05-28 06:54:08.000000000 +0400
+++ ndiswrapper-1.53/driver/loader.c 2008-06-15 17:05:07.000000000 +0400
@@ -100,7 +100,7 @@
EXIT1(return NULL);
}
INIT_COMPLETION(loader_complete);
- ret = call_usermodehelper("/sbin/loadndisdriver", argv, env, 1);
+ ret = call_usermodehelper(USERMOD_HELPER, argv, env, 1);
if (ret) {
up(&loader_mutex);
ERROR("couldn't load driver %s; check system log "
@@ -262,7 +262,7 @@
EXIT1(return NULL);
}
INIT_COMPLETION(loader_complete);
- ret = call_usermodehelper("/sbin/loadndisdriver", argv, env, 1);
+ ret = call_usermodehelper(USERMOD_HELPER, argv, env, 1);
if (ret) {
up(&loader_mutex);
ERROR("couldn't load file %s/%s; check system log "
@@ -698,7 +698,7 @@
EXIT1(return NULL);
}
INIT_COMPLETION(loader_complete);
- ret = call_usermodehelper("/sbin/loadndisdriver", argv, env, 1);
+ ret = call_usermodehelper(USERMOD_HELPER, argv, env, 1);
if (ret) {
up(&loader_mutex);
TRACE1("couldn't load device %04x:%04x; check system "
diff -r -u ndiswrapper-1.53/driver/Makefile ndiswrapper-1.53/driver/Makefile
--- ndiswrapper-1.53/driver/Makefile 2008-05-28 06:54:08.000000000 +0400
+++ ndiswrapper-1.53/driver/Makefile 2008-06-15 17:03:31.000000000 +0400
@@ -95,6 +95,10 @@
EXTRA_CFLAGS += -DWRAP_PREEMPT
endif
+ifdef DIST_DESTDIR
+EXTRA_CFLAGS += -DPREFIX=\"$(DIST_DESTDIR)\"
+endif
+
OBJS = crt.o hal.o iw_ndis.o loader.o ndis.o ntoskernel.o ntoskernel_io.o \
pe_linker.o pnp.o proc.o rtl.o wrapmem.o wrapndis.o wrapper.o
diff -r -u ndiswrapper-1.53/driver/ndiswrapper.h ndiswrapper-1.53/driver/ndiswrapper.h
--- ndiswrapper-1.53/driver/ndiswrapper.h 2008-05-28 06:54:08.000000000 +0400
+++ ndiswrapper-1.53/driver/ndiswrapper.h 2008-06-15 17:06:37.000000000 +0400
@@ -19,8 +19,17 @@
#define DRIVER_VERSION "1.53"
#define UTILS_VERSION "1.9"
+#ifndef PREFIX
+#define PREFIX
+#endif
+
#define DRIVER_NAME "ndiswrapper"
-#define DRIVER_CONFIG_DIR "/etc/ndiswrapper"
+
+#ifndef DRIVER_CONFIG_DIR
+# define DRIVER_CONFIG_DIR PREFIX "/etc/ndiswrapper"
+#endif
+
+#define USERMOD_HELPER PREFIX "/sbin/loadndisdriver"
#define SSID_MAX_WPA_IE_LEN 40
#define NDIS_ESSID_MAX_SIZE 32

View File

@ -1,7 +1,7 @@
{ stdenv, fetchurl, kernelDev, zlib }:
{ stdenv, fetchurl, kernel, zlib }:
stdenv.mkDerivation {
name = "netatop-${kernelDev.version}-0.3";
name = "netatop-${kernel.version}-0.3";
src = fetchurl {
url = http://www.atoptool.nl/download/netatop-0.3.tar.gz;
@ -12,9 +12,9 @@ stdenv.mkDerivation {
preConfigure = ''
patchShebangs mkversion
sed -i -e 's,^KERNDIR.*,KERNDIR=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build,' \
sed -i -e 's,^KERNDIR.*,KERNDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build,' \
*/Makefile
sed -i -e 's,/lib/modules.*extra,'$out'/lib/modules/${kernelDev.modDirVersion}/extra,' \
sed -i -e 's,/lib/modules.*extra,'$out'/lib/modules/${kernel.modDirVersion}/extra,' \
-e s,/usr,$out, \
-e /init.d/d \
-e /depmod/d \
@ -23,7 +23,7 @@ stdenv.mkDerivation {
preInstall = ''
ensureDir $out/bin $out/sbin $out/share/man/man{4,8}
ensureDir $out/lib/modules/${kernelDev.modDirVersion}/extra
ensureDir $out/lib/modules/${kernel.modDirVersion}/extra
'';
meta = {

View File

@ -29,11 +29,10 @@ buildPhase() {
# Create the module.
kernelVersion=$(cd $kernel/lib/modules && ls)
sysSrc=$(echo $kernel/lib/modules/$kernelVersion/build/)
sysSource=$(echo $kernel/lib/modules/$kernelVersion/source)
sysOut=$(echo $kernel/lib/modules/$kernelVersion/build)
unset src # used by the nv makefile
# Hack necessary to compile on 2.6.28.
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$sysSrc/include/asm/mach-default"
make SYSSRC=$sysSrc module
make SYSSRC=$sysSource SYSOUT=$sysOut module
cd ../../..
fi
}

View File

@ -14,11 +14,10 @@ buildPhase() {
echo "Building linux driver against kernel: $kernel";
cd kernel
kernelVersion=$(cd $kernel/lib/modules && ls)
sysSrc=$(echo $kernel/lib/modules/$kernelVersion/build/)
sysSrc=$(echo $kernel/lib/modules/$kernelVersion/source)
sysOut=$(echo $kernel/lib/modules/$kernelVersion/build)
unset src # used by the nv makefile
# Hack necessary to compile on 2.6.28.
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$sysSrc/include/asm/mach-default -I$sysSrc/include/generated"
make SYSSRC=$sysSrc module
make SYSSRC=$sysSrc SYSOUT=$sysOut module
cd ..
fi
}

View File

@ -16,11 +16,10 @@ buildPhase() {
echo "Building linux driver against kernel: $kernel";
cd kernel
kernelVersion=$(cd $kernel/lib/modules && ls)
sysSrc=$(echo $kernel/lib/modules/$kernelVersion/build/)
sysSrc=$(echo $kernel/lib/modules/$kernelVersion/source)
sysOut=$(echo $kernel/lib/modules/$kernelVersion/build)
unset src # used by the nv makefile
# Hack necessary to compile on 2.6.28.
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$sysSrc/include/asm/mach-default -I$sysSrc/include/generated"
make SYSSRC=$sysSrc module
make SYSSRC=$sysSrc SYSOUT=$sysOut module
cd ..
fi
}

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, kernelDev ? null, xlibs, zlib, perl
{ stdenv, fetchurl, kernel ? null, xlibs, zlib, perl
, gtk, atk, pango, glib, gdk_pixbuf
, # Whether to build the libraries only (i.e. not the kernel module or
# nvidia-settings). Used to support 32-bit binaries on 64-bit
@ -15,7 +15,7 @@ let
in
stdenv.mkDerivation {
name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernelDev.version}"}";
name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernel.version}"}";
builder = ./builder.sh;
@ -34,7 +34,7 @@ stdenv.mkDerivation {
inherit versionNumber libsOnly;
kernel = if libsOnly then null else kernelDev;
kernel = if libsOnly then null else kernel.dev;
dontStrip = true;

View File

@ -1,13 +1,13 @@
{stdenv, fetchurl, kernelDev, xlibs, zlib, gtk, atk, pango, glib, gdk_pixbuf}:
{stdenv, fetchurl, kernel, xlibs, zlib, gtk, atk, pango, glib, gdk_pixbuf}:
let
versionNumber = "173.14.36";
versionNumber = "173.14.39";
in
stdenv.mkDerivation {
name = "nvidia-x11-${versionNumber}-${kernelDev.version}";
name = "nvidia-x11-${versionNumber}-${kernel.version}";
builder = ./builder-legacy.sh;
@ -15,16 +15,16 @@ stdenv.mkDerivation {
if stdenv.system == "i686-linux" then
fetchurl {
url = "http://us.download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}-pkg0.run";
sha256 = "19wnikms9wradf1kmaywnp7hykrdm4xqz2ka7az66s3ma096y95c";
sha256 = "08xb7s7cxmj4zv4i3645kjhlhhwxiq6km9ixmsw3vv91f7rkb6d0";
}
else if stdenv.system == "x86_64-linux" then
fetchurl {
url = "http://us.download.nvidia.com/XFree86/Linux-x86_64/${versionNumber}/NVIDIA-Linux-x86_64-${versionNumber}-pkg0.run";
sha256 = "1xf1w6qvqw0a3vd807hp3cgqmzm1wkpz2by52p0qgpjqld421k2s";
sha256 = "1p2ls0xj81l8v4n6dbjj3p5wlw1iyhgzyvqcv4h5fdxhhs2cb3md";
}
else throw "nvidia-x11 does not support platform ${stdenv.system}";
kernel = kernelDev;
kernel = kernel.dev;
inherit versionNumber;

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, kernelDev ? null, xlibs, zlib, perl
{ stdenv, fetchurl, kernel ? null, xlibs, zlib, perl
, gtk, atk, pango, glib, gdk_pixbuf
, # Whether to build the libraries only (i.e. not the kernel module or
# nvidia-settings). Used to support 32-bit binaries on 64-bit
@ -11,7 +11,7 @@ with stdenv.lib;
let versionNumber = "304.117"; in
stdenv.mkDerivation {
name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernelDev.version}"}";
name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernel.version}"}";
builder = ./builder-legacy304.sh;
@ -30,7 +30,7 @@ stdenv.mkDerivation {
inherit versionNumber libsOnly;
kernel = if libsOnly then null else kernelDev;
kernel = if libsOnly then null else kernel.dev;
dontStrip = true;

View File

@ -1,44 +0,0 @@
{stdenv, fetchurl, kernelDev, xlibs, zlib, gtk, atk, pango, glib}:
let
versionNumber = "96.43.23";
in
stdenv.mkDerivation {
name = "nvidia-x11-${versionNumber}-${kernelDev.version}";
builder = ./builder-legacy.sh;
src =
if stdenv.system == "i686-linux" then
fetchurl {
url = "http://us.download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}-pkg0.run";
sha256 = "0hi10h26l51mknr57zsdg0zaxcqdz1lp3hsz0hi1c1vkpbsavrji";
}
else if stdenv.system == "x86_64-linux" then
fetchurl {
url = "http://us.download.nvidia.com/XFree86/Linux-x86_64/${versionNumber}/NVIDIA-Linux-x86_64-${versionNumber}-pkg0.run";
sha256 = "09vynha40rsxpklj1m0qjfg853ckdpi9g87h06irikh405x57kzp";
}
else throw "nvidia-x11 does not support platform ${stdenv.system}";
kernel = kernelDev;
inherit versionNumber;
dontStrip = true;
glPath = stdenv.lib.makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr];
cudaPath = stdenv.lib.makeLibraryPath [zlib stdenv.gcc.gcc];
programPath = stdenv.lib.makeLibraryPath [ gtk atk pango glib xlibs.libXv ];
meta = {
homepage = http://www.nvidia.com/object/unix.html;
description = "X.org driver and kernel module for Legacy NVIDIA graphics cards";
license = "unfree";
};
}

View File

@ -1,14 +1,15 @@
{ stdenv, fetchurl, kernelDev}:
stdenv.mkDerivation rec {
name = "open-iscsi-2.0-871-${kernelDev.version}";
{ stdenv, fetchurl, kernel}:
let
pname = "open-iscsi-2.0-871";
in stdenv.mkDerivation {
name = "${pname}-${kernel.version}";
src = fetchurl {
url = "http://www.open-iscsi.org/bits/${name}.tar.gz";
url = "http://www.open-iscsi.org/bits/${pname}.tar.gz";
sha256 = "1jvx1agybaj4czhz41bz37as076spicsmlh5pjksvwl2mr38gsmw";
};
KSRC = "${kernelDev}/lib/modules/*/build";
KSRC = "${kernel.dev}/lib/modules/*/build";
DESTDIR = "$(out)";
preConfigure = ''
@ -21,5 +22,6 @@ stdenv.mkDerivation rec {
description = "A high performance, transport independent, multi-platform implementation of RFC3720";
license = "GPLv2+";
homepage = http://www.open-iscsi.org;
broken = true;
};
}

View File

@ -1,15 +1,17 @@
{ stdenv, fetchurl, kernelDev, zlib }:
{ stdenv, fetchurl, kernel, zlib }:
/* Only useful for kernels 3.2 to 3.5.
Fails to build in 3.8.
3.9 upstream already includes a proper alps driver for this */
assert builtins.compareVersions "3.8" kernel.version == 1;
let
ver = "1.3";
bname = "psmouse-alps-${ver}";
in
stdenv.mkDerivation {
name = "psmouse-alps-${kernelDev.version}-${ver}";
name = "psmouse-alps-${kernel.version}-${ver}";
src = fetchurl {
url = http://www.dahetral.com/public-download/alps-psmouse-dlkm-for-3-2-and-3-5/at_download/file;
@ -19,12 +21,12 @@ stdenv.mkDerivation {
buildPhase = ''
cd src/${bname}/src
make -C ${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build \
make -C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build \
SUBDIRS=`pwd` INSTALL_PATH=$out
'';
installPhase = ''
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
'';

View File

@ -1,7 +1,7 @@
{ stdenv, fetchurl, kernelDev, perl, autoconf, automake, libtool, coreutils, gawk }:
{ stdenv, fetchurl, kernel, perl, autoconf, automake, libtool, coreutils, gawk }:
stdenv.mkDerivation {
name = "spl-0.6.2-${kernelDev.version}";
name = "spl-0.6.2-${kernel.version}";
src = fetchurl {
url = http://archive.zfsonlinux.org/downloads/zfsonlinux/spl/spl-0.6.2.tar.gz;
sha256 = "196scl8q0bkkak6m0p1l1fz254cgsizqm73bf9wk3iynamq7qmrw";
@ -9,7 +9,7 @@ stdenv.mkDerivation {
patches = [ ./install_prefix.patch ];
buildInputs = [ perl kernelDev autoconf automake libtool ];
buildInputs = [ perl autoconf automake libtool ];
preConfigure = ''
./autogen.sh
@ -23,8 +23,8 @@ stdenv.mkDerivation {
'';
configureFlags = ''
--with-linux=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build
--with-linux-obj=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build
--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source
--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build
'';
enableParallelBuilding = true;

View File

@ -1,23 +1,21 @@
{stdenv, fetchurl, kernelDev}:
{stdenv, fetchurl, kernel}:
stdenv.mkDerivation {
name = "tp_smapi-0.41-${kernelDev.version}";
name = "tp_smapi-0.41-${kernel.version}";
src = fetchurl {
url = "https://github.com/downloads/evgeni/tp_smapi/tp_smapi-0.41.tar.gz";
sha256 = "6aef02b92d10360ac9be0db29ae390636be55017990063a092a285c70b54e666";
};
buildInputs = [ kernelDev ];
makeFlags = [
"KBASE=${kernelDev}/lib/modules/${kernelDev.modDirVersion}"
"KBASE=${kernel.dev}/lib/modules/${kernel.modDirVersion}"
"SHELL=/bin/sh"
];
installPhase = ''
install -v -D -m 644 thinkpad_ec.ko "$out/lib/modules/${kernelDev.modDirVersion}/kernel/drivers/firmware/thinkpad_ec.ko"
install -v -D -m 644 tp_smapi.ko "$out/lib/modules/${kernelDev.modDirVersion}/kernel/drivers/firmware/tp_smapi.ko"
install -v -D -m 644 thinkpad_ec.ko "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/firmware/thinkpad_ec.ko"
install -v -D -m 644 tp_smapi.ko "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/firmware/tp_smapi.ko"
'';
dontStrip = true;

View File

@ -1,7 +1,7 @@
{stdenv, fetchurl, klibc, kernelDev, withKlibc ? true}:
{stdenv, fetchurl, klibc, kernel, withKlibc ? true}:
stdenv.mkDerivation rec {
name = "v86d-${version}-${kernelDev.version}";
name = "v86d-${version}-${kernel.version}";
version = "0.1.10";
src = fetchurl {
@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
configureFlags = if withKlibc then [ "--with-klibc" ] else [ "--default" ];
makeFlags = [
"KDIR=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/source"
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
"DESTDIR=$(out)"
];
@ -27,7 +27,6 @@ stdenv.mkDerivation rec {
homepage = http://dev.gentoo.org/~spock/projects/uvesafb/;
license = "BSD";
platforms = [ "i686-linux" "x86_64-linux" ];
broken = true;
};
}

View File

@ -1,4 +1,4 @@
{stdenv, fetchurl, kernelDev, ncurses, fxload}:
{stdenv, fetchurl, kernel, ncurses, fxload}:
let
@ -12,7 +12,7 @@ let
in
stdenv.mkDerivation {
name = "wis-go7007-0.9.8-${kernelDev.version}";
name = "wis-go7007-0.9.8-${kernel.version}";
src = fetchurl {
url = http://gentoo.osuosl.org/distfiles/wis-go7007-linux-0.9.8.tar.bz2;
@ -47,16 +47,6 @@ stdenv.mkDerivation {
'';
preBuild = ''
# 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
#includeDir=$out/lib/modules/$kernelVersion/source/include/linux
includeDir=$TMPDIR/scratch
substituteInPlace Makefile \
--replace '$(DESTDIR)$(KSRC)/include/linux' $includeDir \
@ -65,7 +55,7 @@ stdenv.mkDerivation {
mkdir -p $out/etc/hotplug/usb
mkdir -p $out/etc/udev/rules.d
makeFlagsArray=(KERNELSRC=$kernelSource \
makeFlagsArray=(KERNELSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source \
FIRMWARE_DIR=$out/firmware FXLOAD=${fxload}/sbin/fxload \
DESTDIR=$out SKIP_DEPMOD=1 \
USE_UDEV=y)
@ -79,5 +69,6 @@ stdenv.mkDerivation {
meta = {
description = "Kernel module for the Micronas GO7007, used in a number of USB TV devices";
homepage = http://oss.wischip.com/;
broken = true;
};
}

View File

@ -1,7 +1,7 @@
{ stdenv, fetchurl, kernelDev, spl, perl, autoconf, automake, libtool, zlib, libuuid, coreutils, utillinux }:
{ stdenv, fetchurl, kernel, spl, perl, autoconf, automake, libtool, zlib, libuuid, coreutils, utillinux }:
stdenv.mkDerivation {
name = "zfs-0.6.2-${kernelDev.version}";
name = "zfs-0.6.2-${kernel.version}";
src = fetchurl {
url = http://archive.zfsonlinux.org/downloads/zfsonlinux/zfs/zfs-0.6.2.tar.gz;
@ -10,7 +10,7 @@ stdenv.mkDerivation {
patches = [ ./mount_zfs_prefix.patch ./nix-build.patch ];
buildInputs = [ kernelDev spl perl autoconf automake libtool zlib libuuid coreutils ];
buildInputs = [ spl perl autoconf automake libtool zlib libuuid coreutils ];
# for zdb to get the rpath to libgcc_s, needed for pthread_cancel to work
NIX_CFLAGS_LINK = "-lgcc_s";
@ -28,8 +28,8 @@ stdenv.mkDerivation {
'';
configureFlags = ''
--with-linux=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build
--with-linux-obj=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build
--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source
--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build
--with-spl=${spl}/libexec/spl
'';

View File

@ -1,10 +1,10 @@
{ stdenv, fetchurl, which, autoconf, automake, flex, yacc,
kernelDev, glibc, ncurses, perl, krb5 }:
kernel, glibc, ncurses, perl, krb5 }:
assert stdenv.isLinux;
stdenv.mkDerivation {
name = "openafs-1.6.1-${kernelDev.version}";
name = "openafs-1.6.1-${kernel.version}";
src = fetchurl {
url = http://www.openafs.org/dl/openafs/1.6.1/openafs-1.6.1-src.tar.bz2;
@ -14,7 +14,7 @@ stdenv.mkDerivation {
buildInputs = [ autoconf automake flex yacc ncurses perl which ];
preConfigure = ''
ln -s ${kernelDev}/lib/modules/*/build $TMP/linux
ln -s ${kernel.dev}/lib/modules/*/build $TMP/linux
patchShebangs .
for i in `grep -l -R '/usr/\(include\|src\)' .`; do

View File

@ -84,7 +84,9 @@ let
if system == "armv6l-linux" then platforms.raspberrypi
else if system == "armv5tel-linux" then platforms.sheevaplug
else if system == "mips64el-linux" then platforms.fuloong2f_n32
else platforms.pc;
else if system == "x86_64-linux" then platforms.pc64
else if system == "i686-linux" then platforms.pc32
else platforms.pcBase;
platform = if platform_ != null then platform_
else config.platform or platformAuto;
@ -6707,10 +6709,9 @@ let
kernelPatches = callPackage ../os-specific/linux/kernel/patches.nix { };
linux_3_2 = makeOverridable (import ../os-specific/linux/kernel/linux-3.2.nix) {
inherit fetchurl stdenv perl mktemp bc kmod ubootChooser;
inherit fetchurl stdenv perl linuxManualConfig;
kernelPatches =
[ kernelPatches.sec_perm_2_6_24
# kernelPatches.aufs3_2
];
};
@ -6757,10 +6758,9 @@ let
});
linux_3_4 = makeOverridable (import ../os-specific/linux/kernel/linux-3.4.nix) {
inherit fetchurl stdenv perl mktemp bc kmod ubootChooser;
inherit fetchurl stdenv perl linuxManualConfig;
kernelPatches =
[ kernelPatches.sec_perm_2_6_24
# kernelPatches.aufs3_4
] ++ lib.optionals (platform.kernelArch == "mips")
[ kernelPatches.mips_fpureg_emu
kernelPatches.mips_fpu_sigill
@ -6776,11 +6776,11 @@ let
});
linux_3_6_rpi = makeOverridable (import ../os-specific/linux/kernel/linux-rpi-3.6.nix) {
inherit fetchurl stdenv perl mktemp bc kmod ubootChooser;
inherit fetchurl stdenv perl linuxManualConfig;
};
linux_3_10 = makeOverridable (import ../os-specific/linux/kernel/linux-3.10.nix) {
inherit fetchurl stdenv perl mktemp bc kmod ubootChooser;
inherit fetchurl stdenv perl linuxManualConfig;
kernelPatches =
[
kernelPatches.sec_perm_2_6_24
@ -6801,7 +6801,7 @@ let
});
linux_3_11 = makeOverridable (import ../os-specific/linux/kernel/linux-3.11.nix) {
inherit fetchurl stdenv perl mktemp bc kmod ubootChooser;
inherit fetchurl stdenv perl linuxManualConfig;
kernelPatches =
[
kernelPatches.sec_perm_2_6_24
@ -6813,7 +6813,7 @@ let
};
linux_3_12 = makeOverridable (import ../os-specific/linux/kernel/linux-3.12.nix) {
inherit fetchurl stdenv perl mktemp bc kmod ubootChooser;
inherit fetchurl stdenv perl linuxManualConfig;
kernelPatches =
[
kernelPatches.sec_perm_2_6_24
@ -6834,8 +6834,6 @@ let
linuxPackagesFor = kernel: self: let callPackage = newScope self; in {
inherit kernel;
kernelDev = kernel.dev or kernel;
acpi_call = callPackage ../os-specific/linux/acpi-call {};
batman_adv = callPackage ../os-specific/linux/batman-adv {};
@ -6844,45 +6842,20 @@ let
ati_drivers_x11 = callPackage ../os-specific/linux/ati-drivers { };
aufs =
if self.kernel.features ? aufs2 then
callPackage ../os-specific/linux/aufs/2.nix { }
else if self.kernel.features ? aufs3 then
callPackage ../os-specific/linux/aufs/3.nix { }
else null;
aufs_util =
if self.kernel.features ? aufs2 then
callPackage ../os-specific/linux/aufs-util/2.nix { }
else if self.kernel.features ? aufs3 then
callPackage ../os-specific/linux/aufs-util/3.nix { }
else null;
blcr = callPackage ../os-specific/linux/blcr { };
cryptodev = callPackage ../os-specific/linux/cryptodev { };
e1000e = callPackage ../os-specific/linux/e1000e {};
exmap = callPackage ../os-specific/linux/exmap { };
frandom = callPackage ../os-specific/linux/frandom { };
iscsitarget = callPackage ../os-specific/linux/iscsitarget { };
iwlwifi = callPackage ../os-specific/linux/iwlwifi { };
lttngModules = callPackage ../os-specific/linux/lttng-modules { };
atheros = callPackage ../os-specific/linux/atheros/0.9.4.nix { };
broadcom_sta = callPackage ../os-specific/linux/broadcom-sta/default.nix { };
broadcom_sta6 = callPackage ../os-specific/linux/broadcom-sta-v6/default.nix { };
nvidia_x11 = callPackage ../os-specific/linux/nvidia-x11 { };
nvidia_x11_legacy96 = callPackage ../os-specific/linux/nvidia-x11/legacy96.nix { };
nvidia_x11_legacy173 = callPackage ../os-specific/linux/nvidia-x11/legacy173.nix { };
nvidia_x11_legacy304 = callPackage ../os-specific/linux/nvidia-x11/legacy304.nix { };
@ -6892,9 +6865,9 @@ let
wis_go7007 = callPackage ../os-specific/linux/wis-go7007 { };
klibc = callPackage ../os-specific/linux/klibc {
linuxHeaders = glibc.kernelHeaders;
};
kernelHeaders = callPackage ../os-specific/linux/kernel-headers { };
klibc = callPackage ../os-specific/linux/klibc { };
/* compiles but has to be integrated into the kernel somehow
Let's have it uncommented and finish it..
@ -6909,15 +6882,6 @@ let
spl = callPackage ../os-specific/linux/spl/default.nix { };
sysprof = callPackage ../development/tools/profiling/sysprof {
inherit (gnome) libglade;
};
systemtap = callPackage ../development/tools/profiling/systemtap {
linux = self.kernelDev;
inherit (gnome) libglademm;
};
tp_smapi = callPackage ../os-specific/linux/tp_smapi { };
v86d = callPackage ../os-specific/linux/v86d { };
@ -6955,7 +6919,7 @@ let
# A function to build a manually-configured kernel
linuxManualConfig = import ../os-specific/linux/kernel/manual-config.nix {
inherit (pkgs) stdenv runCommand nettools bc perl kmod writeTextFile;
inherit (pkgs) stdenv runCommand nettools bc perl kmod writeTextFile ubootChooser;
};
keyutils = callPackage ../os-specific/linux/keyutils { };
@ -7106,6 +7070,10 @@ let
sysfsutils = callPackage ../os-specific/linux/sysfsutils { };
sysprof = callPackage ../development/tools/profiling/sysprof {
inherit (gnome) libglade;
};
# Provided with sysfsutils.
libsysfs = sysfsutils;
systool = sysfsutils;
@ -7118,6 +7086,10 @@ let
systemd = callPackage ../os-specific/linux/systemd { };
systemtap = callPackage ../development/tools/profiling/systemtap {
inherit (gnome) libglademm;
};
# In nixos, you can set systemd.package = pkgs.systemd_with_lvm2 to get
# LVM2 working in systemd.
systemd_with_lvm2 = pkgs.lib.overrideDerivation pkgs.systemd (p: {

View File

@ -1,5 +1,5 @@
rec {
pc = {
pcBase = {
name = "pc";
uboot = null;
kernelHeadersBaseConfig = "defconfig";
@ -7,12 +7,17 @@ rec {
# Build whatever possible as a module, if not stated in the extra config.
kernelAutoModules = true;
kernelTarget = "bzImage";
# Currently ignored - it should be set according to 'system' once it is
# not ignored. This is for stdenv-updates.
kernelArch = "i386";
};
pc_simplekernel = pc // {
pc64 = pcBase // { kernelArch = "x86_64"; };
pc32 = pcBase // { kernelArch = "i386"; };
pc32_simplekernel = pc32 // {
kernelAutoModules = false;
};
pc64_simplekernel = pc64 // {
kernelAutoModules = false;
};

View File

@ -192,7 +192,7 @@ let
arch = "i586";
float = "hard";
withTLS = true;
platform = pkgs.platforms.pc;
platform = pkgs.platforms.pc32;
libc = "glibc";
openssl.system = "hurd-x86"; # Nix depends on OpenSSL.
};

View File

@ -1082,8 +1082,6 @@ let
acpi_call = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
atheros = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
ati_drivers_x11 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
aufs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
aufs_util = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
bbswitch = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
broadcom_sta = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
cryptodev = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };