Linux 3.x: Use our module directory during modules_install

The "unset MODULE_DIR" trick was enough to get Linux 3.x kernels compiling, but it was definitely the Wrong Thing
We NEED MODULE_DIR set so that depmod can store the right dependencies during the build. The REAL problem with the
3.x kernels was two-fold: Our module-init-tools was so old that the kernel build needed to introduce a hack when
calling depmod (involving creating a symlink prepending 99.98 to the version number), and the depmod wrapper was
moved out of the Makefile into scripts/depmod.sh, so our substituteInPlace to get rid of '-b $(INSTALL_MOD_PATH)' in
the Makefile was a noop and INSTALL_MOD_PATH was still being passed to depmod. This is now fixed and modprobe can
successfully find dependencies using the modules.dep created during install

svn path=/nixpkgs/trunk/; revision=29559
This commit is contained in:
Shea Levy 2011-10-02 11:01:08 +00:00
parent fa500dca25
commit 34144e835d
3 changed files with 8 additions and 14 deletions
pkgs/os-specific/linux/kernel

View File

@ -38,7 +38,6 @@
, extraMeta ? {}
, ubootChooser ? null
, postInstall ? ""
, setModuleDir ? true
, # After the builder did a 'make all' (kernel + modules)
# we force building the target asked: bzImage/zImage/uImage/...
@ -80,15 +79,6 @@ stdenv.mkDerivation {
inherit preConfigure src module_init_tools localVersion postInstall;
#Currently, the builder sets $MODULE_DIR during installPhase. This causes
#problems with at least linux 3.0, so we need to conditionally avoid
#setting $MODULE_DIR. This prepend to postBuild accomplishes this with a
#sed/eval trick thanks to MarcWeber
postBuild = (if setModuleDir then "" else ''
eval "$(type installPhase | sed -e '1d' -e '/export MODULE_DIR/d')";
'') + postBuild;
patches = map (p: p.patch) kernelPatches;
kernelConfig = kernelConfigFun config;

View File

@ -202,6 +202,10 @@ import ./generic.nix (
rec {
version = "3.0.4";
preConfigure = ''
substituteInPlace scripts/depmod.sh --replace '-b "$INSTALL_MOD_PATH"' ""
'';
src = fetchurl {
url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.bz2";
sha256 = "1vypjcdii75h5f4zsw9lm8wzxd5ix0mk5p94c96hxv828mqqkmhk";
@ -210,8 +214,6 @@ import ./generic.nix (
config = configWithPlatform stdenv.platform;
configCross = configWithPlatform stdenv.cross.platform;
setModuleDir = false;
features.iwlwifi = true;
}

View File

@ -203,6 +203,10 @@ import ./generic.nix (
version = "3.1-rc8";
modDirVersion = "3.1.0-rc8";
preConfigure = ''
substituteInPlace scripts/depmod.sh --replace '-b "$INSTALL_MOD_PATH"' ""
'';
src = fetchurl {
url = "https://github.com/torvalds/linux/tarball/v${version}";
@ -213,8 +217,6 @@ import ./generic.nix (
config = configWithPlatform stdenv.platform;
configCross = configWithPlatform stdenv.cross.platform;
setModuleDir = false;
features.iwlwifi = true;
}