mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-29 06:45:54 +03:00
tests/minimal-kernel: Add CIFS timeout patch
This commit is contained in:
parent
9e300052bd
commit
3d20a308af
@ -5,11 +5,18 @@
|
|||||||
|
|
||||||
with pkgs.lib;
|
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 =
|
config =
|
||||||
# Require a patch to the kernel to increase the 15s CIFS timeout.
|
# 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.
|
VM tests require that the kernel has the CIFS timeout patch.
|
||||||
" {
|
" {
|
||||||
|
|
||||||
|
@ -7,11 +7,14 @@
|
|||||||
configfile = builtins.storePath (builtins.toFile "config" (pkgs.lib.concatStringsSep "\n"
|
configfile = builtins.storePath (builtins.toFile "config" (pkgs.lib.concatStringsSep "\n"
|
||||||
(map (builtins.getAttr "configLine") config.system.requiredKernelConfig)));
|
(map (builtins.getAttr "configLine") config.system.requiredKernelConfig)));
|
||||||
|
|
||||||
kernel = pkgs.lib.overrideDerivation (pkgs.linuxManualConfig {
|
origKernel = pkgs.linuxManualConfig {
|
||||||
inherit (pkgs.linux) src version;
|
inherit (pkgs.linux) src version;
|
||||||
inherit configfile;
|
inherit configfile;
|
||||||
allowImportFromDerivation = true;
|
allowImportFromDerivation = true;
|
||||||
}) (attrs: {
|
kernelPatches = [ pkgs.kernelPatches.cifs_timeout_2_6_38 ];
|
||||||
|
};
|
||||||
|
|
||||||
|
kernel = origKernel //(derivation (origKernel.drvAttrs // {
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
runHook preConfigure
|
runHook preConfigure
|
||||||
mkdir ../build
|
mkdir ../build
|
||||||
@ -19,7 +22,7 @@
|
|||||||
make $makeFlags "''${makeFlagsArray[@]}" KCONFIG_ALLCONFIG=${configfile} allnoconfig
|
make $makeFlags "''${makeFlagsArray[@]}" KCONFIG_ALLCONFIG=${configfile} allnoconfig
|
||||||
runHook postConfigure
|
runHook postConfigure
|
||||||
'';
|
'';
|
||||||
});
|
}));
|
||||||
|
|
||||||
kernelPackages = pkgs.linuxPackagesFor kernel kernelPackages;
|
kernelPackages = pkgs.linuxPackagesFor kernel kernelPackages;
|
||||||
in {
|
in {
|
||||||
|
Loading…
Reference in New Issue
Block a user