About a year ago I made some notes about plucking out parts of the 2.6.25.5 kernel — as well as some other ideas — with a goal of knocking down the boot time on an eight-year-old 550Mhz Celeron to about 16 seconds from Grub to X. I’ve configured a lot of kernels for a variety of machines in that time, and I have a few more subtractions to recommend.
I have the same disclaimers as last time.
- I am by no means an expert.
- This is not a beginner’s task.
- You should be able to do everything described in the Crux Handbook before you try this.
- Do not copy and paste into your system. I am 99 percent sure your computer won’t even boot.
The good news is, depending on your hardware, core functions like graphics and networking rely only a few settings scattered here and there. You can reasonably get by without needing to leave in a whole lot.
Which is what we want: Everything nonessential stripped out. And that’s one of the benefits of working with older machine — you can relax in the knowledge that, after a while, your machine is so mainstream that kernel changes and updates are highly unlikely to require a lot of work. Find a configuration that works for you, and kernel updates after this will, more than likely, be no-brainers.
But again, it’s important for you to know your hardware, inside and out, before you get started. As I have mentioned in the past, you would do well not to start with this, but to start with something like Arch Linux or even Ubuntu, check and see what the automated systems picked for you, and scribble those down on a piece of paper (you do remember what paper is, don’t you?). Then start up the Crux installation CD, make sure the stuff you need is in place, and start building.
Enough talk. Here are the dirty details.
From the initial menuconfig menu, I disable Enable loadable module support. We’ve already stumbled onto something that is strongly-hardware related. I can afford to run with a lighter, faster kernel, which supposedly is what this option allows, because I don’t have any hardware that requires loadable module support. Some things require it; for example if you want to use a proprietary driver for your Nvidia card, you have to leave it enabled. Some other things, like some network drivers and so on, will also require it. The key is, if it breaks, change it back.
Under General setup,
- Disable Prompt for development and/or incomplete code/drivers. I do this because, again, I don’t have any hardware on this machine that needs those drivers. That Atheros-based Corega wireless card I was using a few months ago needed those incomplete drivers though. Maybe that had something to do with why it was misbehaving.
- Disable BSD Process Accounting, Export task/process statistics through netlink, Auditing support, Control Group support, Initial RAM filesystem and RAM disk (initramfs/initrd) support, Profiling support and Activate markers.
With a machine this old I have the luxury of omitting almost anything marked “EXPERIMENTAL” and as a general rule, it seems to work. Again, if you pop a high-end wireless card into your Pentium II laptop, you might need to pay a little closer attention.
On very, very old systems, like my Pentium, Optimize for size seems to have a visible effect on boot time. Smaller kernels load faster than larger ones, I guess. But on a newer, faster system, I wonder if you’ll really notice a difference.
Under Enable the block layer > IO Schedulers,
- I disable Anticipatory I/O scheduler and Deadline I/O scheduler. My experience with Ubuntu suggests that CFQ is the quickest option, although you might find it worth your time to try one of the other two.
Under Processor type and features,
- I disable Tickless System (Dynamic Ticks), High Resolution Timer Support, Symmetric multi-processing support, Support for extended (non-PC) x86 platforms, Generic x86 support, HPET Timer Support, Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4, Enable X86 board specific fixups for reboot, /dev/cpu/microcode – microcode support, Check for low memory corruption, Reserve low 64K of RAM on AMI/Phoenix BIOSen, EFI runtime service support, Enable seccomp to safely compute untrusted bytecode and kexec system call.
My rationale on most of these should be fairly obvious — a 550Mhz Celeron doesn’t need multiprocessor support, I don’t plan on swapping kernels midstream, etc. If the hardware doesn’t have it or I don’t need it, I remove it.
- Processor family is set to Pentium-III/Celeron(Coppermine)/Pentium-III Xeon.
- High Memory Support is off.
- I leave the Timer frequency at 1000 HZ.
One small note for very, very old machines: I’ve noticed that x86 PAT support keeps my Pentium from booting.
Under Power management and ACPI options,
- I disable Power Management Debug Support (this is just the beginning of all the debugging stuff I disable), Suspend to RAM and standby (with a machine that starts in 11 seconds, I don’t need suspend
), and Hibernation (aka ‘suspend to disk’).
- Under ACPI (Advanced Configuration and Power Interface) Support,
- I disable everything described as “deprecated”, everything described as “future”, and Battery. My battery is dead.
- Under CPU Frequency scaling I disable all of CPU Frequency scaling.
Don’t quit now. There’s lots more fun coming. Under Bus options (PCI etc.),
- I turn off PCI Express support and Support for PCI Hotplug.
- For PCCard (PCMCIA/CardBus) support,
- I disable 16-bit PCMCIA support. That leaves only the yenta-compatible support, which is what I use in this machine.
Networking support is a fun one. First, turn off Amateur Radio support and RF switch subsystem support. I have no idea why Amateur Radio is enabled in a default kernel, but I regularly turn it off. Next, under Networking options,
- I turn off Transformation user configuration interface, IP: multicasting, IP: advanced router, IP: policy routing, IP: kernel level autoconfiguration, IP: TCP syncookie support, Large Receive Offload (ipv4/tcp), TCP: advanced congestion control, The IPv6 protocol, NetLabel subsystem support, Security Marking, Network packet filtering framework (Netfilter), and QoS and/or fair queueing.
And yes, to answer your question, I can still surf the Internet. If you want to know details of what those things do (and by extension, why I don’t use them on a 550Mhz Celeron), check the help pages for each one.
- This is a wireless machine, so most of what is listed under Wireless is useful. All the same I disable Old wireless static regulatory definitions and Wireless extensions sysfs files.
Bouncing back up to Device Drivers, I turn off Generic Driver Options > Managed device resources verbose debug messages. Then
- I turn off Block devices > RAM block device support, Misc devices, Serial ATA (prod) and Parallel ATA (experimental) drivers, Multiple devices driver support (RAID and LVM), Macintosh device drivers, Power supply class support, Hardware Monitoring support, Watchdog Timer Support, Multimedia devices > DAB adapters, EDAC – error detection and reporting and DMA Engine Support.
- I enable ATA/ATAPI/MFM/RLL support, along with Include IDE/ATAPI CDROM support and the Intel PIIX/ICH chipsets support. I turn off Probe IDE PCI devices in the PCI bus order (DEPRECATED).
- Because I have a Thinkpad laptop, I enable X86 Platform Specific Device Drivers > ThinkPad ACPI Laptop Extras. Not that it’s a particularly good reason, but. …
- Graphics support can be a little tricky. On a framebuffer only system I enable most of the framebuffer stuff, but on X systems I have a tendency to leave it all out. The final product is what determines the configuration here. As it stands now this is a framebuffer-only machine so
Sound is best described as disabling absolutely everything, and enabling only ALSA and the option for Intel/SiS/nVidia/AMD/ALi AC97 Controller. And yes, sound works fine on this machine.
Under HID Devices, I disable HID debugging support, /dev/hidraw raw HID device support, PID device support and /dev/hiddev raw HID device support. For Special HID drivers, I enable everything I possibly can, and then, after this is all done, usually float back through this menu to find some things that are locked until later. It’s a little annoying, but worth it not to compile support for some esoteric force-feedback game controller.
USB support is similar; I disable USB verbose debug messages, USB announce new devices, USB selective suspend/resume and wakeup, USB Monitor, EHCI HCD (USB 2.0) support (because this is a 1.1-only machine) and USB Printer support.
Moving backward slightly, under Device Drivers > Input device support, I disable Support for memoryless force-feedback devices, Polled input device skeleton and anything labeled as Joysticks, Tablets, Touchscreens, Miscellaneous or otherwise. In the Hardware I/O ports section, I drop Serial port line discipline.
Similarly, for Character devices, I turn off Non-standard serial port support, Serial drivers > 8250/16550 and compatible serial support, Hardware Random Number Generator Core support and HPET – High Precision Event Timer.
Don’t forget to disable I2C support when the option opens up.
Next on the menu: All the way back up to File systems. I am partial to ext2, so I enable Second extended fs support and drop DNotify support, Inotify file change notification support, Quota support, Kernel automounter version 4 support (also supports v3) and Miscellaneous filesystems. As this machine has no DVD or CDRW drive, I leave off UDF file system support under CD-ROM/DVD Filesystems.
(A side note: I regularly connect between machines with NFS, so I enable both NFS client and server support under Network File Systems. It’s not necessary for the running of the machine, but I use it, so I thought I should mention it.)
I disable everything under Partition Types > Advanced partition selection. I enable the Japanese character sets under Native language support.
Kernel hacking is kind of fun. I turn off Kernel debugging, Compile the kernel with frame pointers, Tracers > Support for tracing block io actions, Remote debugging over FireWire early on boot, Early printk via EHCI debug port and Allow gcc to uninline functions marked ‘inline’.
I turn off all the Security options I can. I like to live on the edge.
Under Cryptographic API I disable only the Hardware crypto devices submenu, because I have no hardware crypto devices. Similarly, jumping back up to the top menu, I disable Virtualization, because using a 550Mhz Celeron for virtualization is rather like sprinting with cement blocks stapled to your feet.
And believe it or not, that’s about it. If you look over the end of that last post, where I talk about compilation options and so forth, most of that is still the same. I don’t use X on this machine any longer and that’s a good thing, so the dip in start time between this machine now and that machine then is mostly due to the fact that I don’t have to wait for it to start. With X, these newer kernels were shaving about 2 or 3 seconds off the 16-second mark. But it’s been a long time since I could use X on this, so I might be conveniently misremembering.
If you have suggestions, warnings or apocryphal tales of single-digit startups on Pentium II machines with exceedingly sparse kernels … I’m all ears.
And now, because I know someone is going to ask, here’s the dot-config file. After the “more” break, of course.
Continue reading ‘Running the 2.6.30.1 kernel ultralight’
Recent Comments