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