summary refs log tree commit diff
path: root/pkgs/os-specific/linux/zen-kernel/2.6.33-zen1.nix
blob: a3824a4fb15e98797654d97f8afd4753f0cbbe54 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
args @ {stdenv, fetchurl, xz, runCommand, userModeLinux ? false, extraConfig ? "", 
  kernelPatches ? [], extraMeta ? {}, 
  features ? {}, preConfigure ? "",
  ...}:

let 
  conf = import ../kernel/config-blocks.nix; 

  baseKernelVersion = "2.6.33";
  ZenSuffix = "zen1";

in

import ../kernel/generic.nix (
  rec {
    version = "${baseKernelVersion}-${ZenSuffix}";

    src = fetchurl {
      url = "mirror://kernel/linux/kernel/v2.6/linux-${baseKernelVersion}.tar.bz2";
      sha256 = "1inmam21w13nyf5imgdb5palhiap41zcxf9k32i4ck1w7gg3gqk3";
    };

    kernelPatches = [
      {
         name = "${ZenSuffix}"; 
         patch = runCommand "${baseKernelVersion}-${ZenSuffix}.patch" {} "${xz}/bin/lzma -d < ${ fetchurl {
	   name = "${baseKernelVersion}-${ZenSuffix}.patch.lzma";
           url = "http://downloads.zen-kernel.org/${baseKernelVersion}/${baseKernelVersion}-${ZenSuffix}.patch.lzma";
           sha256 = "0a72d8allr4qi4p6hbbjh33kmcgbg84as0dfb50gsffvaj2d3kwf";
         } } > $out";
      }
    ]
    ++
    stdenv.lib.attrByPath ["kernelPatches"] [] args;

    features = {
      iwlwifi = true;
      zen = true;
      fbConDecor = true;
      aufs = true;
    } // (stdenv.lib.attrByPath ["features"] {} args);

    config = with conf;
    ''
      ${generalOptions}
      ${noDebug}
      ${virtualisation}
      ${if stdenv.lib.attrByPath ["features" "oldI686"] false args then noPAE else ""}
      ${usefulSubsystems}
      ${cfq}
      ${noNUMA}
      ${networking}
      ${wireless}
      ${fb}
      ${fbConDecor}
      ${sound}
      ${usbserial}
      ${fsXattr}
      ${security}
      ${blockDevices}
      ${bluetooth}
      ${misc}
      ${if stdenv.lib.attrByPath ["features" "ckSched"] false args then bfsched else forceCFSched}
    '';

    preConfigure = ''
      mv README.zen README-zen
    '' + stdenv.lib.attrByPath ["preConfigure"] "" args;

    extraMeta = {
      maintainers = [stdenv.lib.maintainers.raskin];
      platforms = with stdenv.lib.platforms;
        linux;
    } // stdenv.lib.attrByPath ["extraMeta"] {} args;
  } 
  // removeAttrs args ["extraConfig" "extraMeta" "features" "kernelPatches" 
                        "xz" "runCommand" "preConfigure"]
)