···1-args @ { stdenv, fetchurl, extraConfig ? ""
2-, perl, mktemp, module_init_tools
3-, ... }:
4-5-let
6- configWithPlatform = kernelPlatform :
7- ''
8- # Power management and debugging for powertop.
9- DEBUG_KERNEL y
10- PM_ADVANCED_DEBUG y
11- PM_RUNTIME y
12- TIMER_STATS y
13- USB_SUSPEND y
14- BACKTRACE_SELF_TEST n
15- CPU_NOTIFIER_ERROR_INJECT? n
16- DEBUG_DEVRES n
17- DEBUG_NX_TEST n
18- DEBUG_STACK_USAGE n
19- DEBUG_STACKOVERFLOW n
20- RCU_TORTURE_TEST n
21- SCHEDSTATS n
22-23- # Support drivers that need external firmware.
24- STANDALONE n
25-26- # Make /proc/config.gz available.
27- IKCONFIG_PROC y
28-29- # Optimize with -O2, not -Os.
30- CC_OPTIMIZE_FOR_SIZE n
31-32- # Enable the kernel's built-in memory tester.
33- MEMTEST y
34-35- # Include the CFQ I/O scheduler in the kernel, rather than as a
36- # module, so that the initrd gets a good I/O scheduler.
37- IOSCHED_CFQ y
38- BLK_CGROUP y # required by CFQ
39-40- # Enable NUMA.
41- NUMA? y
42-43- # Disable some expensive (?) features.
44- FTRACE n
45- KPROBES n
46- PM_TRACE_RTC n
47-48- # Enable various subsystems.
49- ACCESSIBILITY y # Accessibility support
50- AUXDISPLAY y # Auxiliary Display support
51- DONGLE y # Serial dongle support
52- HIPPI? y
53- MTD_COMPLEX_MAPPINGS y # needed for many devices
54- SCSI_LOWLEVEL y # enable lots of SCSI devices
55- SCSI_LOWLEVEL_PCMCIA y
56- SPI y # needed for many devices
57- SPI_MASTER y
58- WAN y
59-60- # Networking options.
61- IP_PNP n
62- IPV6_PRIVACY y
63- NETFILTER_ADVANCED y
64- IP_VS_PROTO_TCP y
65- IP_VS_PROTO_UDP y
66- IP_VS_PROTO_ESP y
67- IP_VS_PROTO_AH y
68- IP_DCCP_CCID3 n # experimental
69- CLS_U32_PERF y
70- CLS_U32_MARK y
71-72- # Wireless networking.
73- IPW2100_MONITOR y # support promiscuous mode
74- IPW2200_MONITOR y # support promiscuous mode
75- HOSTAP_FIRMWARE y # Support downloading firmware images with Host AP driver
76- HOSTAP_FIRMWARE_NVRAM y
77- ATH9K_PCI y # Detect Atheros AR9xxx cards on PCI(e) bus
78- ATH9K_AHB y # Ditto, AHB bus
79-80- # Some settings to make sure that fbcondecor works - in particular,
81- # disable tileblitting and the drivers that need it.
82-83- # Enable various FB devices.
84- FB y
85- FB_EFI y
86- FB_NVIDIA_I2C y # Enable DDC Support
87- FB_RIVA_I2C y
88- FB_ATY_CT y # Mach64 CT/VT/GT/LT (incl. 3D RAGE) support
89- FB_ATY_GX y # Mach64 GX support
90- FB_SAVAGE_I2C y
91- FB_SAVAGE_ACCEL y
92- FB_SIS_300 y
93- FB_SIS_315 y
94- FB_3DFX_ACCEL y
95- FB_GEODE y
96-97- # Video configuration
98- # Enable KMS for devices whose X.org driver supports it.
99- DRM_I915_KMS y
100- DRM_RADEON_KMS y
101- # Hybrid graphics support
102- VGA_SWITCHEROO y
103-104- # Sound.
105- SND_AC97_POWER_SAVE y # AC97 Power-Saving Mode
106- SND_HDA_INPUT_BEEP y # Support digital beep via input layer
107- SND_USB_CAIAQ_INPUT y
108- PSS_MIXER y # Enable PSS mixer (Beethoven ADSP-16 and other compatible)
109-110- # USB serial devices.
111- USB_SERIAL_GENERIC y # USB Generic Serial Driver
112- USB_SERIAL_KEYSPAN_MPR y # include firmware for various USB serial devices
113- USB_SERIAL_KEYSPAN_USA28 y
114- USB_SERIAL_KEYSPAN_USA28X y
115- USB_SERIAL_KEYSPAN_USA28XA y
116- USB_SERIAL_KEYSPAN_USA28XB y
117- USB_SERIAL_KEYSPAN_USA19 y
118- USB_SERIAL_KEYSPAN_USA18X y
119- USB_SERIAL_KEYSPAN_USA19W y
120- USB_SERIAL_KEYSPAN_USA19QW y
121- USB_SERIAL_KEYSPAN_USA19QI y
122- USB_SERIAL_KEYSPAN_USA49W y
123- USB_SERIAL_KEYSPAN_USA49WLC y
124-125- # Filesystem options - in particular, enable extended attributes and
126- # ACLs for all filesystems that support them.
127- EXT2_FS_XATTR y # Ext2 extended attributes
128- EXT2_FS_POSIX_ACL y # Ext2 POSIX Access Control Lists
129- EXT2_FS_SECURITY y # Ext2 Security Labels
130- EXT2_FS_XIP y # Ext2 execute in place support
131- EXT4_FS_POSIX_ACL y
132- EXT4_FS_SECURITY y
133- REISERFS_FS_XATTR y
134- REISERFS_FS_POSIX_ACL y
135- REISERFS_FS_SECURITY y
136- JFS_POSIX_ACL y
137- JFS_SECURITY y
138- XFS_QUOTA y
139- XFS_POSIX_ACL y
140- XFS_RT y # XFS Realtime subvolume support
141- OCFS2_DEBUG_MASKLOG n
142- BTRFS_FS_POSIX_ACL y
143- UBIFS_FS_XATTR y
144- UBIFS_FS_ADVANCED_COMPR y
145- NFSD_V2_ACL y
146- NFSD_V3 y
147- NFSD_V3_ACL y
148- NFSD_V4 y
149- NFS_FSCACHE y
150- CIFS_XATTR y
151- CIFS_POSIX y
152- CIFS_FSCACHE y
153-154- # Security related features.
155- STRICT_DEVMEM y # Filter access to /dev/mem
156- SECURITY_SELINUX_BOOTPARAM_VALUE 0 # disable SELinux by default
157-158- # Misc. options.
159- 8139TOO_8129 y
160- 8139TOO_PIO n # PIO is slower
161- AIC79XX_DEBUG_ENABLE n
162- AIC7XXX_DEBUG_ENABLE n
163- AIC94XX_DEBUG n
164- B43_PCMCIA y
165- BLK_DEV_CMD640_ENHANCED y # CMD640 enhanced support
166- BLK_DEV_IDEACPI y # IDE ACPI support
167- BLK_DEV_INTEGRITY y
168- BSD_PROCESS_ACCT_V3 y
169- BT_HCIUART_BCSP y
170- BT_HCIUART_H4 y # UART (H4) protocol support
171- BT_HCIUART_LL y
172- BT_RFCOMM m
173- BT_RFCOMM_TTY y # RFCOMM TTY support
174- CRASH_DUMP n
175- DMAR? n # experimental
176- DVB_DYNAMIC_MINORS y # we use udev
177- EFI_STUB y # EFI bootloader in the bzImage itself
178- FUSION y # Fusion MPT device support
179- IDE_GD_ATAPI y # ATAPI floppy support
180- IRDA_ULTRA y # Ultra (connectionless) protocol
181- JOYSTICK_IFORCE_232 y # I-Force Serial joysticks and wheels
182- JOYSTICK_IFORCE_USB y # I-Force USB joysticks and wheels
183- JOYSTICK_XPAD_FF y # X-Box gamepad rumble support
184- JOYSTICK_XPAD_LEDS y # LED Support for Xbox360 controller 'BigX' LED
185- LDM_PARTITION y # Windows Logical Disk Manager (Dynamic Disk) support
186- LEDS_TRIGGER_IDE_DISK y # LED IDE Disk Trigger
187- LOGIRUMBLEPAD2_FF y # Logitech Rumblepad 2 force feedback
188- LOGO n # not needed
189- MEDIA_ATTACH y
190- MEGARAID_NEWGEN y
191- MICROCODE_AMD y
192- MODVERSIONS y
193- MOUSE_PS2_ELANTECH y # Elantech PS/2 protocol extension
194- MTRR_SANITIZER y
195- NET_FC y # Fibre Channel driver support
196- PPP_MULTILINK y # PPP multilink support
197- REGULATOR y # Voltage and Current Regulator Support
198- SCSI_LOGGING y # SCSI logging facility
199- SERIAL_8250 y # 8250/16550 and compatible serial support
200- SLIP_COMPRESSED y # CSLIP compressed headers
201- SLIP_SMART y
202- THERMAL_HWMON y # Hardware monitoring support
203- USB_DEBUG n
204- USB_EHCI_ROOT_HUB_TT y # Root Hub Transaction Translators
205- X86_CHECK_BIOS_CORRUPTION y
206- X86_MCE y
207-208- # Linux Containers
209- RT_GROUP_SCHED? y
210- CGROUP_DEVICE? y
211- CGROUP_MEM_RES_CTLR? y
212- CGROUP_MEM_RES_CTLR_SWAP? y
213- DEVPTS_MULTIPLE_INSTANCES? y
214-215- # Enable staging drivers. These are somewhat experimental, but
216- # they generally don't hurt.
217- STAGING y
218-219- # PROC_EVENTS requires that the netlink connector is not built
220- # as a module. This is required by libcgroup's cgrulesengd.
221- CONNECTOR y
222- PROC_EVENTS y
223-224- # Tracing
225- FTRACE y
226- FUNCTION_TRACER y
227- FTRACE_SYSCALLS y
228- SCHED_TRACER y
229-230- # Devtmpfs support.
231- DEVTMPFS y
232-233- ${if kernelPlatform ? kernelExtraConfig then kernelPlatform.kernelExtraConfig else ""}
234- ${extraConfig}
235- '';
236-in
237-238-import ./generic.nix (
239-240- rec {
241- version = "3.3.8";
242- testing = false;
243-244- preConfigure = ''
245- substituteInPlace scripts/depmod.sh --replace '-b "$INSTALL_MOD_PATH"' ""
246- '';
247-248- src = fetchurl {
249- url = "mirror://kernel/linux/kernel/v3.x/${if testing then "testing/" else ""}linux-${version}.tar.xz";
250- sha256 = "0bgppngf711mlxp0jcsnv5xc0xxc8vs5rzc1czkv2igrfb1kvrnz";
251- };
252-253- config = configWithPlatform stdenv.platform;
254- configCross = configWithPlatform stdenv.cross.platform;
255-256- features.iwlwifi = true;
257- features.efiBootStub = true;
258- features.netfilterRPFilter = true;
259- }
260-261- // removeAttrs args ["extraConfig"]
262-)