2009-03-08

Debian Lenny on Cobalt Raq XTR Howto

Today I will show you how to install Debian Lenny on old Cobalt RAQ XTR hardware.

The Cobalt RAQ is a pentium 3 based 1 HE server. There are some specifies with this hardware, which make the install process a litte bit complicated.

There is no real BIOS on the RAQ rater it is using a small Linux on a rom for bootup. The Linux on the rom can boot different locations like the disks or via NFS.

Also the installation must be made over a network connection because the RAQ does not have a vga connector. For this we require a PC with a preinstalled Debian Lenny OS.

You also need a serial nullmodem cable between your desktop pc and the cobalt box. The right settings for this connection are 115200 8N1. For example you can use minicom or cu as your terminal software. If you can see many cryptic output in minicom during the cobalt startup, the connection will be ok.

1 Setup DHCP and NFS boot

To be able to work on the RAQ we will boot a Linux environment over NFS (We do not really boot a kernel via NFS, but we import a new root path for the rom kernel this way). We use this later to upgrade the rom and to install our OS on the disk.

First we require some additional packages

desktop:/# apt-get install debootstrap nfs-user-server dhcp3-server minicom cu

We start with installing a old debian sarge environment into the directory /nfsroot-x86. The name of this directory is important, because the rom kernel uses it. It is also important is that we install the old sarge distribution, because later we use the 2.4 rom-kernel with this environment. I also tried Lenny at this point, but it caused a kernel panic during the cobalt boot. I think that has something to do with the way the binaries were compiled.

desktop:/# mkdir /nfsroot-x86
desktop:/# debootstrap --arch i386 sarge /nfsroot-x86 http://archive.debian.org/debian-archive/
desktop:/# echo 'deb http://archive.debian.org/debian-archive sarge main' > /nfsroot-x86/etc/apt/sources.list
desktop:/# chroot /nfsroot-x86
desktop:/# passwd root
desktop:/# apt-get install ssh joe
desktop:/# exit

Because the RAQ does not own a vga interface, we need to enable a getty on the serial line. For this edit /nfsroot-x86/etc/inittab:

#1:2345:respawn:/sbin/getty 38400 tty1
#2:23:respawn:/sbin/getty 38400 tty2
#3:23:respawn:/sbin/getty 38400 tty3
#4:23:respawn:/sbin/getty 38400 tty4
#5:23:respawn:/sbin/getty 38400 tty5
#6:23:respawn:/sbin/getty 38400 tty6
T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100
T1:23:respawn:/sbin/getty -L ttyS0 115200 vt100

Next we edit the network configuration. For this edit /nfsroot-x86/etc/network/interfaces:

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet dhcp

Edit /nfsroot-x86/etc/fstab (but do not forget to change the ip to your desktop pc ip):

192.168.1.10:/nfsroot-x86 / nfs defaults 0 0
proc /proc proc defaults 0 0

Our Sarge environment shoud be finish, now. Next we edit the dhcpd configuration file /etc/dhcp3/dhcpd.conf:

authoritative;
subnet 192.168.1.0 netmask 255.255.255.0 {
host cobalt {
hardware ethernet XX:XX:XX:XX:XX:XX;
fixed-address 192.168.1.20;
option routers 192.168.1.1;
next-server 192.168.1.10;
option root-path "/nfsroot-x86";
option host-name "cobalt1";
}
}

We also need to export the /nfsroot-x86 directory. For this edit /etc/exports:

/nfsroot-x86 *(rw,no_root_squash,no_subtree_check)

Finally we have to restart the services:

desktop:/# /etc/init.d/nfs-user-server restart
desktop:/# /etc/init.d/dhcpd restart

Now, boot your Cobalt RAQ. During startup press the S button until you get into the menu. In this menu choose boot from net. Your cobalt shoud get an IP from your DHCP ans mount the NFS export. You should now be able to get a shell via SSH, now.

2 Flash The Boot Rom

First you have to download the new rom and the flashutils package. You can find both at http://sourceforge.net/project/showfiles.php?group_id=83123. For the XTR download the cobalt-2.10.3-ext3-1M.rom (You can also download the cobalt-2.10.3-xfs-1M.rom if you prefer XFS).

Extract the flashutils-file into the /nfsboot-x86 directory and copy the rom image into the new folder:

desktop:/# cd /nfsroot-x86
desktop:/nfsroot-x86/# tar xvzf romutils-1.0.tar.bz2
desktop:/nfsroot-x86/# mv cobalt-2.10.3-ext3-1M.rom romutils

Now we can use this tools on the Cobalt to upgrade the rom. At this stage you can damage your Cobalt. DO NOT POWER OF YOUR COBALT UNTIL THE FLASH PROCESS HAS FINISHED. If there are any errors until the flash process, do not power off your machine. Insted repeat the flash process until it worked without errors.

cobalt:/# cd romutils
cobalt:/romutils/# ./flashtool -v -r > backup.rom
cobalt:/romutils/# ./flashtool -v -w cobalt-2.10.3-ext3-1M.rom

After the flashing process has finished, reboot the cobalt (net boot again).

3 Install Lenny To The Disk

Now we need a second chroot environment for the Lenny system. We install it into the /nfsroot-x96 directory, so that we can access it from the cobalt.

desktop:/# mkdir /nfsroot-x86/lenny-root
desktop:/# debootstap --arch i386 lenny /nfsroot-x86/lenny-root/ http://ftp.debian.org/debian
desktop:/# cp /etc/apt/sources.list /nfsroot-x86/lenny-root/etc/apt/
desktop:/# cp /nfsroot-x86/etc/inittab /nfsroot-x86/lenny-root/etc/inittab
desktop:/# cp /nfsroot-x86/etc/network/interfaces /nfsroot-x86/lenny-root/etc/network/interfaces
desktop:/# chroot /nfsroot-x86/lenny-root/
desktop:/# apt-get update
desktop:/# apt-get install openssh-server joe linux-image
desktop:/# cd /boot
desktop:/boot/# ln -s vmlinuz-2.6.26-1-686 vmlinux.bz2
desktop:/boot/# ln -s initrd.img-2.6.26-1-686 initrd.img
desktop:/boot/# exit

The Cobalt rom kernel looks for a file named vmlinux.bz2 in the / or the /boot directory. So make sure that there is such a file, or a symlink with that name. For creating a customized kernel take a look at http://wiki.parvi.org/index.php/Cobalt_Kernel_Patch.

Now think about your futuere partitioning of your harddisks. Because we need to setup the /nfsroot-x86/etc/fstab file:

proc /proc proc defaults 0 0
/dev/hde1 / ext3 errors=remount-ro 0 1
/dev/hde2 none swap sw 0 0

As you can see, the naming of the devices does not start at A, it is starting at E!

Let us switch to the cobalt console again. We can start to do the partitioning stuff, now. Simply start fdisk /dev/hde and edit your partiton like this:

Device Boot Start End Blocks Id System
/dev/hde1 1 25189 12695224+ 83 Linux
/dev/hde2 25190 26500 660744 82 Linux swap / Solaris

Choose the sizes of your partitions like your preferences. After finishing the partitioning stuff, we can create the ext3 filesystem and prepare the swap partition.

cobalt:/# mkfs -t ext3 /dev/hde1
cobalt:/# mkswap /dev/hde2

Now mount the local disk and copy the Lenny environment to the disk:

cobalt:/# mount -t ext3 /dev/hde1 /mnt
cobalt:/# cd /lenny-root
cobalt:/lenny-root/# cp -a * /mnt/
cobalt:/# unmount /mnt
cobalt:/# reboot


Switch to your serial console now. During the startup you could see a message like "syncing disks". From now, press the space button multiple times until you are in the boot menu.

Type the following commands:

# boot
# set-boot-dev hde1
# set-root-dev hde1
# main
# bfd

At this point you should have a working Debian Lenny system on your cobalt.

4 Disclaimer And Ressources

Please notice that I wrote this howto at 2pm after figuring out the hole installation procedure. So it may be possible that the discription above includes some mistakes. All damages caused by this installation procedure are at your own risk.

You can find further information on this topic at the following locations. There are also some information how to create a specially patched kernel for your RAQ:

http://www.timntina.com/debian-cobalt-kernel-compile
http://www.timntina.com/debian-sarge-cobalt-install
http://wiki.parvi.org/index.php/Cobalt_Kernel_Patch
http://wiki.parvi.org/index.php/RaQ_Installation_Guide
http://braggtown.com/qubuntu.html
http://www.cobaltfaqs.com