During the past month, I had to do all tmpfs development on my laptop. This includes coding and testing. If you have ever done any kernel hacking you know what this means: reboot every now and then to test your changes, which can drive you crazy after few reboots (specially if things keep breaking).

So when I got back home, the first thing I did was to set up a machine I had lying around for kernel testing exclusively. The machine is a Pentium 133Mhz with 32MB of RAM and a 3GB hard disk, more than enough for my purposes. (I'd have also used qemu... but since I had the hardware...)

Here are some details about its configuration, designed to minimize manual intervention:

  • The machine is in headless mode. I.e., no monitor nor keyboard and connected to my development machine using a null serial cable. I did all the installation of NetBSD over the serial line. In order to connect to it, I use the tip(1) command.
  • The machine uses GRUB (also configured to use the serial line) to load the development kernel from my server and boot it, all of this in an unattended manner. Note that GRUB has some problems loading modern NetBSD kernels: some of them can be avoided by tweaking the configuration file, but others can't.
  • All services (e.g., sendmail, cron, inetd...) are disabled during startup to reduce boot time.
  • getty(8) is configured to automatically log in the root user. This can be done through the al parameter in /etc/gettytab.
  • root's ~/.profile fetches the new kernel again and installs it as /netbsd. Then, it asks me to press a key to run tmpfs regression tests afterward. (I made it require a key press to let me cancel the execution of tests if wanted.)
  • The development machine, after successful builds, uploads new kernels to the server from which GRUB fetches them.

With this setup, whenever I have built a new kernel in my development machine, I can instantly reboot the testing machine, press RETURN when asked for it and see the results. No need to copy the kernel to the second box in any way nor to enter any command!