Building a Linux Media Network, one step at a time

Wednesday, February 01, 2006

Debian Post-Install

The more I use Debian, the more I like it. apt-get is a really powerful package management tool. The minimal install is a bit larger than I'd like, around 250Mb, but I've basically resigned myself to getting a bigger compact flash card, so it's not that big a deal. As long as I can keep it under 1Gb, I should be OK.

Here's how I customised the standard Debian install:

I got the installer onto the hard disk as described here.

I accepted all the defaults, the only tricky bit was to manually edit the partition table and force the install into one of my 2Gb partitions. That's just a matter of selecting the partition, specifying the file system you wish (I went with ext3), and setting it to be the root (/) mount point.

After the installer reboots, the last step in the installation process is to choose which "profile" you would like to set up the system with: file server, print server, web server, desktop, etc. The last option is to perform the package selection manually using aptitude, a frontend for apt-get. I went with that, and then promptly quit it without selecting any packages. This minimal install weighs in at 246Mb.

It's not quite suitable, though. The installer decided to use the i386 kernel, which is compatible with the VIA C3 chip, but doesn't take advantage of all its features. The modern (2.6.8) kernel has a special configuration for this chip, it's just a matter of specifying it at build-time. So let's build a fresh kernel.

The first thing to do is drag down the necessary packages via apt-get. This is going to incur another couple hundred megs of disk usage, but we can get rid of it all when we're done:

apt-get install kernel-source libncurses5-dev

Then, go into the /usr/src directory and expand the .tar.bz2 file:
tar xfvj kernel-source-2.6.8.tar.bz2
Then in the directory that just got created:

make mrproper menuconfig

This brings up the kernel configuration GUI. Under "processor family" select VIA C3-2 (Nehemiah). Exit. Save when prompted. Next, enter:

make install modules_install

And go get some coffee. Take a long lunch. Wash your car. Seriously. This will take about 3 hours, and 98% of this time will be spent compiling drivers for ISDN cards and SCSI devices and a whole host of other crap you don't need. If you know of a way to speed up this process, I'd love to know.

So far we've built and deployed the kernel and all the necessary kernel modules for the C3 chip. The penultimate step is to build a new initrd image:
mkinitrd -o /boot/initrd.img-2.6.8 2.6.8

And finally, to add the entries in the GRUB boot menu to boot our wonderful new creation:

title  Debian GNU/Linux, kernel 2.6.8
root (hd0,1)
kernel /boot/vmlinuz-2.6.8 root=/dev/hda2 ro
initrd /boot/initrd.img-2.6.8

title Debian GNU/Linux, kernel 2.6.8 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.8 root=/dev/hda2 ro single
initrd /boot/initrd.img-2.6.8

Note that your value for the root parameter may vary - details explained here.

Don't expect anything fancy when you reboot - there's still no X server or window manager. I'll get to those next.


Post a Comment

<< Home