tests/minimal-kernel: Add CIFS timeout patch

This commit is contained in:
Shea Levy 2012-08-01 23:36:48 -04:00
parent 9e300052bd
commit 3d20a308af
2 changed files with 14 additions and 4 deletions

View file

@ -5,11 +5,18 @@
with pkgs.lib;
let
kernel = config.boot.kernelPackages.kernel;
hasCIFSTimeout = if kernel ? features then kernel.features ? cifsTimeout
else (filter (p: p.name == "cifs-timeout") kernel.kernelPatches) != [];
in
{
config =
# Require a patch to the kernel to increase the 15s CIFS timeout.
mkAssert (config.boot.kernelPackages.kernel.features ? cifsTimeout) "
mkAssert hasCIFSTimeout "
VM tests require that the kernel has the CIFS timeout patch.
" {

View file

@ -7,11 +7,14 @@
configfile = builtins.storePath (builtins.toFile "config" (pkgs.lib.concatStringsSep "\n"
(map (builtins.getAttr "configLine") config.system.requiredKernelConfig)));
kernel = pkgs.lib.overrideDerivation (pkgs.linuxManualConfig {
origKernel = pkgs.linuxManualConfig {
inherit (pkgs.linux) src version;
inherit configfile;
allowImportFromDerivation = true;
}) (attrs: {
kernelPatches = [ pkgs.kernelPatches.cifs_timeout_2_6_38 ];
};
kernel = origKernel //(derivation (origKernel.drvAttrs // {
configurePhase = ''
runHook preConfigure
mkdir ../build
@ -19,7 +22,7 @@
make $makeFlags "''${makeFlagsArray[@]}" KCONFIG_ALLCONFIG=${configfile} allnoconfig
runHook postConfigure
'';
});
}));
kernelPackages = pkgs.linuxPackagesFor kernel kernelPackages;
in {