···11-args @ { stdenv, fetchurl, extraConfig ? ""
22-, perl, mktemp, module_init_tools
33-, ... }:
44-55-let
66- configWithPlatform = kernelPlatform :
77- ''
88- # Power management and debugging for powertop.
99- DEBUG_KERNEL y
1010- PM_ADVANCED_DEBUG y
1111- PM_RUNTIME y
1212- TIMER_STATS y
1313- USB_SUSPEND y
1414- BACKTRACE_SELF_TEST n
1515- CPU_NOTIFIER_ERROR_INJECT? n
1616- DEBUG_DEVRES n
1717- DEBUG_NX_TEST n
1818- DEBUG_STACK_USAGE n
1919- DEBUG_STACKOVERFLOW n
2020- RCU_TORTURE_TEST n
2121- SCHEDSTATS n
2222-2323- # Support drivers that need external firmware.
2424- STANDALONE n
2525-2626- # Make /proc/config.gz available.
2727- IKCONFIG_PROC y
2828-2929- # Optimize with -O2, not -Os.
3030- CC_OPTIMIZE_FOR_SIZE n
3131-3232- # Enable the kernel's built-in memory tester.
3333- MEMTEST y
3434-3535- # Include the CFQ I/O scheduler in the kernel, rather than as a
3636- # module, so that the initrd gets a good I/O scheduler.
3737- IOSCHED_CFQ y
3838- BLK_CGROUP y # required by CFQ
3939-4040- # Enable NUMA.
4141- NUMA? y
4242-4343- # Disable some expensive (?) features.
4444- FTRACE n
4545- KPROBES n
4646- PM_TRACE_RTC n
4747-4848- # Enable various subsystems.
4949- ACCESSIBILITY y # Accessibility support
5050- AUXDISPLAY y # Auxiliary Display support
5151- DONGLE y # Serial dongle support
5252- HIPPI? y
5353- MTD_COMPLEX_MAPPINGS y # needed for many devices
5454- SCSI_LOWLEVEL y # enable lots of SCSI devices
5555- SCSI_LOWLEVEL_PCMCIA y
5656- SPI y # needed for many devices
5757- SPI_MASTER y
5858- WAN y
5959-6060- # Networking options.
6161- IP_PNP n
6262- IPV6_PRIVACY y
6363- NETFILTER_ADVANCED y
6464- IP_VS_PROTO_TCP y
6565- IP_VS_PROTO_UDP y
6666- IP_VS_PROTO_ESP y
6767- IP_VS_PROTO_AH y
6868- IP_DCCP_CCID3 n # experimental
6969- CLS_U32_PERF y
7070- CLS_U32_MARK y
7171-7272- # Wireless networking.
7373- IPW2100_MONITOR y # support promiscuous mode
7474- IPW2200_MONITOR y # support promiscuous mode
7575- HOSTAP_FIRMWARE y # Support downloading firmware images with Host AP driver
7676- HOSTAP_FIRMWARE_NVRAM y
7777- ATH9K_PCI y # Detect Atheros AR9xxx cards on PCI(e) bus
7878- ATH9K_AHB y # Ditto, AHB bus
7979-8080- # Some settings to make sure that fbcondecor works - in particular,
8181- # disable tileblitting and the drivers that need it.
8282-8383- # Enable various FB devices.
8484- FB y
8585- FB_EFI y
8686- FB_NVIDIA_I2C y # Enable DDC Support
8787- FB_RIVA_I2C y
8888- FB_ATY_CT y # Mach64 CT/VT/GT/LT (incl. 3D RAGE) support
8989- FB_ATY_GX y # Mach64 GX support
9090- FB_SAVAGE_I2C y
9191- FB_SAVAGE_ACCEL y
9292- FB_SIS_300 y
9393- FB_SIS_315 y
9494- FB_3DFX_ACCEL y
9595- FB_GEODE y
9696-9797- # Video configuration
9898- # Enable KMS for devices whose X.org driver supports it.
9999- DRM_I915_KMS y
100100- DRM_RADEON_KMS y
101101- # Hybrid graphics support
102102- VGA_SWITCHEROO y
103103-104104- # Sound.
105105- SND_AC97_POWER_SAVE y # AC97 Power-Saving Mode
106106- SND_HDA_INPUT_BEEP y # Support digital beep via input layer
107107- SND_USB_CAIAQ_INPUT y
108108- PSS_MIXER y # Enable PSS mixer (Beethoven ADSP-16 and other compatible)
109109-110110- # USB serial devices.
111111- USB_SERIAL_GENERIC y # USB Generic Serial Driver
112112- USB_SERIAL_KEYSPAN_MPR y # include firmware for various USB serial devices
113113- USB_SERIAL_KEYSPAN_USA28 y
114114- USB_SERIAL_KEYSPAN_USA28X y
115115- USB_SERIAL_KEYSPAN_USA28XA y
116116- USB_SERIAL_KEYSPAN_USA28XB y
117117- USB_SERIAL_KEYSPAN_USA19 y
118118- USB_SERIAL_KEYSPAN_USA18X y
119119- USB_SERIAL_KEYSPAN_USA19W y
120120- USB_SERIAL_KEYSPAN_USA19QW y
121121- USB_SERIAL_KEYSPAN_USA19QI y
122122- USB_SERIAL_KEYSPAN_USA49W y
123123- USB_SERIAL_KEYSPAN_USA49WLC y
124124-125125- # Filesystem options - in particular, enable extended attributes and
126126- # ACLs for all filesystems that support them.
127127- EXT2_FS_XATTR y # Ext2 extended attributes
128128- EXT2_FS_POSIX_ACL y # Ext2 POSIX Access Control Lists
129129- EXT2_FS_SECURITY y # Ext2 Security Labels
130130- EXT2_FS_XIP y # Ext2 execute in place support
131131- EXT4_FS_POSIX_ACL y
132132- EXT4_FS_SECURITY y
133133- REISERFS_FS_XATTR y
134134- REISERFS_FS_POSIX_ACL y
135135- REISERFS_FS_SECURITY y
136136- JFS_POSIX_ACL y
137137- JFS_SECURITY y
138138- XFS_QUOTA y
139139- XFS_POSIX_ACL y
140140- XFS_RT y # XFS Realtime subvolume support
141141- OCFS2_DEBUG_MASKLOG n
142142- BTRFS_FS_POSIX_ACL y
143143- UBIFS_FS_XATTR y
144144- UBIFS_FS_ADVANCED_COMPR y
145145- NFSD_V2_ACL y
146146- NFSD_V3 y
147147- NFSD_V3_ACL y
148148- NFSD_V4 y
149149- NFS_FSCACHE y
150150- CIFS_XATTR y
151151- CIFS_POSIX y
152152- CIFS_FSCACHE y
153153-154154- # Security related features.
155155- STRICT_DEVMEM y # Filter access to /dev/mem
156156- SECURITY_SELINUX_BOOTPARAM_VALUE 0 # disable SELinux by default
157157-158158- # Misc. options.
159159- 8139TOO_8129 y
160160- 8139TOO_PIO n # PIO is slower
161161- AIC79XX_DEBUG_ENABLE n
162162- AIC7XXX_DEBUG_ENABLE n
163163- AIC94XX_DEBUG n
164164- B43_PCMCIA y
165165- BLK_DEV_CMD640_ENHANCED y # CMD640 enhanced support
166166- BLK_DEV_IDEACPI y # IDE ACPI support
167167- BLK_DEV_INTEGRITY y
168168- BSD_PROCESS_ACCT_V3 y
169169- BT_HCIUART_BCSP y
170170- BT_HCIUART_H4 y # UART (H4) protocol support
171171- BT_HCIUART_LL y
172172- BT_RFCOMM m
173173- BT_RFCOMM_TTY y # RFCOMM TTY support
174174- CRASH_DUMP n
175175- DMAR? n # experimental
176176- DVB_DYNAMIC_MINORS y # we use udev
177177- EFI_STUB y # EFI bootloader in the bzImage itself
178178- FUSION y # Fusion MPT device support
179179- IDE_GD_ATAPI y # ATAPI floppy support
180180- IRDA_ULTRA y # Ultra (connectionless) protocol
181181- JOYSTICK_IFORCE_232 y # I-Force Serial joysticks and wheels
182182- JOYSTICK_IFORCE_USB y # I-Force USB joysticks and wheels
183183- JOYSTICK_XPAD_FF y # X-Box gamepad rumble support
184184- JOYSTICK_XPAD_LEDS y # LED Support for Xbox360 controller 'BigX' LED
185185- LDM_PARTITION y # Windows Logical Disk Manager (Dynamic Disk) support
186186- LEDS_TRIGGER_IDE_DISK y # LED IDE Disk Trigger
187187- LOGIRUMBLEPAD2_FF y # Logitech Rumblepad 2 force feedback
188188- LOGO n # not needed
189189- MEDIA_ATTACH y
190190- MEGARAID_NEWGEN y
191191- MICROCODE_AMD y
192192- MODVERSIONS y
193193- MOUSE_PS2_ELANTECH y # Elantech PS/2 protocol extension
194194- MTRR_SANITIZER y
195195- NET_FC y # Fibre Channel driver support
196196- PPP_MULTILINK y # PPP multilink support
197197- REGULATOR y # Voltage and Current Regulator Support
198198- SCSI_LOGGING y # SCSI logging facility
199199- SERIAL_8250 y # 8250/16550 and compatible serial support
200200- SLIP_COMPRESSED y # CSLIP compressed headers
201201- SLIP_SMART y
202202- THERMAL_HWMON y # Hardware monitoring support
203203- USB_DEBUG n
204204- USB_EHCI_ROOT_HUB_TT y # Root Hub Transaction Translators
205205- X86_CHECK_BIOS_CORRUPTION y
206206- X86_MCE y
207207-208208- # Linux Containers
209209- RT_GROUP_SCHED? y
210210- CGROUP_DEVICE? y
211211- CGROUP_MEM_RES_CTLR? y
212212- CGROUP_MEM_RES_CTLR_SWAP? y
213213- DEVPTS_MULTIPLE_INSTANCES? y
214214-215215- # Enable staging drivers. These are somewhat experimental, but
216216- # they generally don't hurt.
217217- STAGING y
218218-219219- # PROC_EVENTS requires that the netlink connector is not built
220220- # as a module. This is required by libcgroup's cgrulesengd.
221221- CONNECTOR y
222222- PROC_EVENTS y
223223-224224- # Tracing
225225- FTRACE y
226226- FUNCTION_TRACER y
227227- FTRACE_SYSCALLS y
228228- SCHED_TRACER y
229229-230230- # Devtmpfs support.
231231- DEVTMPFS y
232232-233233- ${if kernelPlatform ? kernelExtraConfig then kernelPlatform.kernelExtraConfig else ""}
234234- ${extraConfig}
235235- '';
236236-in
237237-238238-import ./generic.nix (
239239-240240- rec {
241241- version = "3.3.8";
242242- testing = false;
243243-244244- preConfigure = ''
245245- substituteInPlace scripts/depmod.sh --replace '-b "$INSTALL_MOD_PATH"' ""
246246- '';
247247-248248- src = fetchurl {
249249- url = "mirror://kernel/linux/kernel/v3.x/${if testing then "testing/" else ""}linux-${version}.tar.xz";
250250- sha256 = "0bgppngf711mlxp0jcsnv5xc0xxc8vs5rzc1czkv2igrfb1kvrnz";
251251- };
252252-253253- config = configWithPlatform stdenv.platform;
254254- configCross = configWithPlatform stdenv.cross.platform;
255255-256256- features.iwlwifi = true;
257257- features.efiBootStub = true;
258258- features.netfilterRPFilter = true;
259259- }
260260-261261- // removeAttrs args ["extraConfig"]
262262-)