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