jump to navigation

Technical goals to meet by the end of April March 30, 2006

Posted by spanky in carpc, Linux, programming.
add a comment
  • Have some kind of definite software solution for the CarPC system. As it is, I'm bouncing between distros trying to balance boot time/bloat with functionality. amaroK looks like it's going to be the backbone of the music-playing site since it has great plugins, supports ratings, and will sync with a music player/ipod with probably not too much fuss.
  • Make a honeypot and look at some attack profiles the script kiddies generally use. Hopefully get a good idea of a rootkitter's MO
  • Make and maintain a Linux distro (more on this later; it's contingent on progress in a project I have no control over)

Optimizing Linux boot times and other kernel tuning February 5, 2006

Posted by spanky in carpc, Linux.
add a comment

So as part of my CarPC project, I’m putting together a build of Linux that is very light and very fast. I didn’t start out with any particular distro or set of tools in mind. The hardware is one of the main project constraints, in this case a Duron 700 with a Riva128 (Thanks, Jon!) and a meager 128 MB of old and busted system memory.

I tried Damn Small Linux, which is a Knoppix-derived LiveCD build. It booted in about ~60 seconds from power on to X/fluxbox session accepting user input. It’s very fast, even on this system, but had a lot of quirks, and had all the disadvantages of a binary-only distro as well. Installing odd software and tweaking it is critical to my application, so this wasn’t really the direction in which I wanted to go.

Given that DSL wasn’t for me, there are two ways I could have gone. I’ve heard of people getting very fast boot times with Linux From Scratch, but that would involve building an entire distro from scratch, and having to probably install packages and such all by hand. It’d have all the advantages of a bottom-up approach, but may or may not be worth it in the end.

The second solution, which is what I’m trying now, is to do a top-down approach: install a bare Gentoo system, and pare it down to exactly what I need, and nothing more. I’m very familiar with the Gentoo install process (it still took forever, though), and yesterday I put together a working system. It went from power on to a terminal login prompt in about 45 seconds. I’ve made a lot of changes since then, the kernel is getting smaller at each recompile as I zero in on exactly what I need. Things I’ve used to help my boot time:

  • Everything I need and only what I need are compiled directly into the kernel. No modules, I eliminated those module autodetect scripts from startup, and so forth. Definitely saves a few steps and at least 7 seconds.
  • I noticed an inexplicable delay between the last init script starting and getting a login prompt. It’s gone away, what I *think* fixed it was changing an option in /etc/conf.d/rc that says whether or not Linux should save /dev to a tarball on shutdown and restore it on startup.
  • I spent a bit of time trying to figure out why nvidia’s X drivers for the Riva128 weren’t working. I found a bit on some forums about their latest Linux driver breaking compatibility with their older cards, and that downgrading might help, but it’s really a moot point. X.org takes a decent amount of time to start up, and Xvesa takes about 1 second.
  • There’s an option in /etc/conf.d/rc that allows some parallelization of bootup, but I don’t think it makes that much of a difference for a single-processor system (at least it doesn’t for me), but YMMV

Some links I found that I’ll be checking up on:

IBM Article on faster boot times

Optimizing the boot process

This is really sweet : Bootchart tells you where your system is spending time in the boot process.  If it comes down to it, I’ll use this, though it may not be necessary.
Current boot: 25 seconds

Follow

Get every new post delivered to your Inbox.