Installing Debian 3.1 Sarge on a Cobalt RaQ4

Submitted by Coyote on Tue, 06/27/2006 - 10:01pm.

Follow these instructions at your own risk. This worked perfectly on my Cobalt RaQ4, but may not work on all machines. I cannot be held responsible for your machine.

Click here for updates since my install.

I don't always check this page for comments, so please, leave your comments & then contact me using my contact page so I know to come by & respond.

The process below is how I installed Debian 3.1 Sarge on my Cobalt RaQ4. I used various sources of information to do this, but the most help came from the Debian Cobalt HOWTO that I found on the Internet. At the time this article was written, the site was down, so I've reposted the original on my site. I'll simply copy most parts of the original document because it is written SO well. So if you compare the two, you'll see a lot of similarities, but I've added/removed/changed the things that didn't work for me. I'll also include lessons learned throughout this process. Mostly things I wanted the cobalt to do, but it just won't do it. Many thanks to Tim Hockin, a former Cobalt engineer who has continued hacking the Cobalt kernel long after Sun backed out. Without his initial work on the Cobalt ROM Kernels, there's no way we could have been using these machines with a modern OS. So...let's get started. Shall we?

Installing Debian on the x86-based Cobalt Server Appliances is not too difficult. It essentially requires doing a set of steps twice. The first part is to set up an nfsroot enviromnent for netbooting the cobalt off of. The second part is to install Debian locally on the Appliance in question. Performing all of this is made easy by using Debian's "debootstrap" utility. It is assumed that the following procedure is being done on a Debian system.

The machine in which we perform the setup on and make an nfsroot area on will be referred to as the "server". The machine in which we do the final installation will be known as the "cobalt".

This procedure has been made to work on the following systems: RaQ3, RaQ4, RaQ XTR, RaQ 550, and the Qube3.

The one assumption is that you have a crossover serial cable with a female db9 connector on it to talk to the cobalt's serial console.

Part I

In this part, we'll set up an nfsroot enviromnent for netbooting the cobalt off of. Once this is done, it can be used to install as many cobalt appliances as desired.

1) Make sure "debootstrap" & "nfs-user-server" are installed on the server.
apt-get install debootstrap nfs-user-server

2) Install the beginnings of an nfsroot area on the server
debootstrap --arch i386 sarge /nfsroot-x86 http://ftp.us.debian.org/debian/
The "sarge" part is the release of debian that's desired. The installation must go into /nfsroot-x86... and then pick your favorite Debian mirror.

3) Edit /nfsroot-x86/etc/inittab
There are six lines for tty1 through tty6 starting with
1:2345:respawn:/sbin/getty 38400 tty1
Comment these out, and uncomment the line for ttyS0 and change to 115200 bps (from 9600) to look like:
T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100

4) Edit /nfsroot-x86/etc/securetty
Add "ttyS0" to the list so that root can log in on it. I didn't have to do this, but you may.

5) Copy /etc/apt/sources.list to /nfsroot-x86/etc/apt/sources.list
It should have something like:
deb http://ftp.us.debian.org/debian/ sarge main contrib non-free
deb-src http://ftp.us.debian.org/debian/ sarge main contrib non-free
deb http://non-us.debian.org/debian-non-US sarge/non-US main contrib non-free
deb-src http://non-us.debian.org/debian-non-US sarge/non-US main contrib non-free

deb http://security.debian.org/ sarge/updates main

6) Chroot into /nfsroot-x86
Simple "chroot /nfsroot-x86"... this will be to set up additional packages in the installation setup.
chroot /nfsroot-x86

7) Install whatever you need in the nfsroot
apt-get update
apt-get install debootstrap alien vim

Install whatever tools will be helpful for the next portion of the installation. This can be done during the next portion as well, so no big deal.

8) Exit the chroot

9) Create a /nfsroot-x86/etc/fstab
It'll look something like:
192.168.0.2:/nfsroot-x86    /      nfs   defaults  0  0
proc                        /proc  proc  defaults  0  0

Where you substitute out the "192.168.0.2" for the server's address.

10) NFS export /nfsroot-x86
echo '/nfsroot-x86    192.168.0.2/255.255.255.0(rw,no_root_squash)' >> /etc/exports
/etc/init.d/nfs-user-server restart

11) Install a DHCP server on the network
apt-get install dhcp3-server

12) Configure your DHCP server (/etc/dhcp3/dhcpd.conf)
Declare a subnet in /etc/dhcp3/dhcpd.conf. Should look similar to the following:
subnet 192.168.0.0 netmask 255.255.255.0 {
  range 192.168.0.100 192.168.0.200;
  option domain-name-servers 192.168.0.1;
  option domain-name "my.domain.com";
  option routers 192.168.0.1;
  default-lease-time 600;
  max-lease-time 7200;
}

Make an entry that looks like the following to your /etc/dhcp3/dhcpd.conf.
host cobalt {
        hardware ethernet 00:00:00:00:00:00;
        fixed-address 192.168.0.3;
        option routers 192.168.0.1;
        next-server 192.168.0.2;
        option root-path "/nfsroot-x86";
        option host-name "cobalt";
}

Where 00:47:e6:05:74:60 is the MAC/Hardware address of eth0 on the cobalt,192.168.0.1 is the address of your router or other gateway device, 192.168.0.2 is the IP address of the server, & 192.168.0.3 is the IP address of the cobalt. If you don't already have a working OS on the cobalt, you'll have to tail syslog on the server when the cobalt tries to boot from the network to find the MAC address of your cobalt. If not you can use ifconfig to get it.

13) Restart your DHCP server
/etc/init.d/dhcp3-server restart

Part II

In this part, we'll install Debian locally on the Appliance(s) in question.

1) Upgrade the cobalt to the latest rom
Instructions for this are at
ftp://ftp-eng.cobalt.com/pub/users/thockin/2.4

2) Boot from the network
During bootup, hit the spacebar to go to the rom menu (not the boot monitor -- 'q' out of it if you get there). At the prompt, typ "bfn". This should hopefully get the system completely booted up with a login prompt. Don't forget that if you haven't gotten the cobalt's hardware address & set it up in dhcpd.conf, then you'll have to tail the syslog to get it. Log in as root.

3) Parition and format the local disks as desired.
This will mostly occur with the "fdisk" and "mke2fs" commands. Use "mkswap" to initialize the swap partition. Consult their manpages for more information. I used "cfdisk", but that's all personal preference. Both will work. One very important thing to note here. You can pretty much partition the disk however you want, but /boot & / must both be on /dev/hda1. The reason is that (1) the cobalt boot rom will load the rom kernel, then switch to the kernel on disk. It will only look on /dev/hda1 for it. So...if you plan on upgrading to a newer kernel (either a premade rpm or a cobalt patch to a debian kernel), then the kernel must be found here. (2) The rom by default has /dev/hda1 as the location of /. You can set that at boot by typing (set_params "root=/dev/hda2") in the boot menu of the rom. The only problem is that it doesn't save it. The next time the machine goes through the rom boot sequence, it'll forget that you told it where / was. There may be a way to set this permanently, however I haven't found it. If you know...please let me know. I'd love to be able to use ext3 on my / partition.

4) Mount the disks under /mnt as you've parititioned them.
For example, if you made a separate parition for /home, mount it under /mnt/home after you've mounted root in /mnt, and so forth.
mount -t ext2 /dev/hda1 /mnt

5) Put the initial Debian installation on the local disks
debootstrap --arch i386 sarge /mnt http://ftp.us.debian.org/debian/
The "sarge" part is the release of debian that's desired. The installation must go into /mnt... and then pick your favorite Debian mirror.

6) Copy files into /mnt/etc
Files to copy over are /etc/inittab, /etc/securetty and /etc/apt/sources.list

7) Edit /etc/network/interfaces
Should look something like this:

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
 
# The loopback interface
auto lo
iface lo inet loopback
 
# The first network card - this entry was created during the Debian installation
# (network, broadcast and gateway are optional)
auto eth0
iface eth0 inet static
        address 192.168.0.3
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.1

8) Edit /mnt/etc/fstab
Make an fstab describing how you want the disks to be mounted when you eventually boot from the disks. An example would look like:
/dev/hda1      /         ext2    defaults,errors=remount-ro  0  1
/dev/hda2      none      swap    sw                          0  0
proc           /proc     proc    defaults                    0  0
tmpfs          /dev/shm  tmpfs   defaults                    0  0

9) Edit /etc/hosts
Should look something like this:

127.0.0.1       localhost.localdomain
192.168.0.3     cobalt.yourdomain.com cobalt
 
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

10) Copy applicable kernel files onto the disks
You can either take a cobalt kernel rpm and run "alien" on it, or grab one of the kernels from http://cobalt.iceblink.org/debian/. At the time this article was written, the site was down. I will try to repost them on my site soon. In the meantime, try http://imbezol.criticaldamage.com/linux/cobalt/. If you plan on upgrading your hard drive, you should really take a look at http://www.cobaltfaqs.com/index.php/Using_ATA133_Hard_Disks_w/RAQ4_hardware_and_RAQ550_OS

I like to copy the files into /mnt/root

11) Install the kernel
First, chroot into /mnt. Then dpkg -i the kernel .deb that you want. Make sure that you have a /boot/vmlinux.bz2 file or link, as that's what the rom will look for at boot time. If you plan on doing this step & upgrading to a newer kernel, you may have to load the ethernet drivers as a module. If you system comes up & eth0 is not configured, then add "eepro100" to /etc/modules to get it to load the ethernet module at bootup.

12) Finish up
You can apt-get install anything you want now & run base-config to setup the system. Be sure to exit the chroot... and MAKE SURE TO UNMOUNT THE LOCAL DISKS BEFORE YOU REBOOT.

That should just about do it. Enjoy your new Debian machine.

Sources:
http://cobalt.iceblink.org/debian/
http://www.cobaltfaqs.com/
http://imbezol.criticaldamage.com/linux/cobalt/
ftp://ftp-eng.cobalt.com/pub/users/thockin/2.4
http://hugues.lepesant.com/stuff/cobalt/
http://hugues.lepesant.com/ (translated to English)



Updates

2006.09.14

My cobalt has been running flawlessly since I finished my install. It performs perfectly for what I wanted to use it for. Being a K6-III 450, I didn't expect it to do a ton. I just wanted a dev environment to work in for this site as well as a couple others that I run. I also wanted a dev/testing area for some of the coding I play around with. I got the Cobalt front panel working using the lcd-panelutils package & directions that I found at http://hugues.lepesant.com/index.php?paged=2. I tweaked that utility to make the panel show exactly what I wanted it to. Using awk I was able to scrape the CPU temperature from /proc/cpuinfo, so I included the temperature on the front panel. I've got a CRON job that updates the panel every 5 minutes with the new temperature. Click here if you'd like to see a picture of my Cobalt front panel temperature monitor. If you'd like to know how I've done this...let me know and I'll post it.

Currently I've got MySQL v.4.1.20, PHP v.4.3.4, Apache v.2.2.3, dhcp3-server debian package, ntp-server debian package, djbdns (tinydns/dnscache) installed & running on it. I use it mostly for a development & testing area for my websites (including this one). I also use the MySQL instance for various data analysis tasks. My favorite thing about having a dedicated Debian machine is having an area to work on my coding skills, testing & experimenting with my own code. Currently the one utility that I use the most is one that will e-mail me when my home public IP address changes so that I can update my DNS records...even if I'm away from home. That way I always have access to it externally. It's nothing special...but very helpful to me...which is who I ultimately wrote it for anyway. :) The machine runs surprisingly cool. The hottest I've seen it run is around 47 or 48 degrees Celsius...and that was on a hot day without air conditioning while bzipping some files...pretty much pegging the CPU. It also runs my DHCP & DNS (internal & external) for my local network.

Issues? Surprisingly...not really anything big. I did, however, chase my tail for a while trying to figure out why Apache was delivering zero length files for static files, but dynamically generated contect was fine. Turns out, I was getting an error testing it with wget that said "Connection closed at byte 0. Retrying." After recompiling httpd 2.2.3, compiling & installing httpd 2.2.0, again recompiling httpd 2.2.3 with different options & then finally doing some research on the error...I finally found out that I had to turn off the EnableSendfile directive in httpd.conf. Aparently...Sendfile is a feature of some kernels that allow the file to be transferred using the kernel rather than httpd, lowing the dependence on the CPU for that process. The 2.4 Cobalt kernel that I'm using obviously doesn't support that. So I uncommented "EnableSendfile off" in httpd.conf & presto...it works.

I hope everyone has as much luck with their install as I have. I'm really enjoying having this machane. It's the perfect server for my setup & fits perfectly under my monitor shelf on my desk.

2007.09.23

Well, it's about time for another update. I've upgraded quite a few things on this machine. First off, I'm now running Apache 2.2.3, PHP 5.2.0, & MySQL 5.0.27 (all except for MySQL compiled from source). I've also started trying to keep the kernel up to date after seeing Jim Tuttle's instructions on compiling the kernel on these Cobalts. You can find that along with a few other things on his Ubuntu Dapper on Qube3 HOWTO. Thanks for the help Jim. My RaQ4 is now running linux-2.6.22.6. I've also written my own HOWTO that's based on his with a few changes & more suited for me. You can find that in my Compiling Linux Kernel v.2.6.22.6 for Debian Cobalt x86 Machines HOWTO. I also upgraded to Debian Etch (v.4.0) when it was released. This I did simply with an apt-get dist-upgrade. Nothing fancy this time. It went smoothly. And that's when I decided to upgrade the rest of my LAMP components since I had a new Debian version & new kernel. I've also found an additional use for it. With a little help from an IPTABLES front end called Firestarter (a Debian package in the apt repository) I've turned it into a router/firewall. The hardest part was that Firestarter is a GUI application, but I tried it & and it works fine without one. I DID, however, have to install it on my Debian laptop & play with settings so I'd know how the config files were setup. Currently my internal interface is a USB NIC & I want to change that. I've got an eepro100 sitting here on my desk, I just have to get "un-lazy" & put it in. That's all the updates I have now, I'll be sure to update again in the future.


*  »

ozindfw Says:

In the process of going through a short stack of RAQs I discovered few that wouldn't boot off the NFS server.

Once flashed up with the cobalt-2.10.3-ext3-1M.rom everything is happy. I'd planned on doing this anyway.

All is well except for the one I bricked. I wasn't paying enough attention and missed a failure message. Oh well. It's probably recoverable if the ROMs support JTAG programming. We'll see.

»

ozindfw Says:

I have the RAQ ROM updated to 2.10.3-ext3. I have it booting off of the server, but I can't seem to get it to find the local hard drive. I can boot off the original disk, but when I boot from the network, it can't find the disk. A df shows:

Filesystem 1K-blocks Used Available Use% Mounted on
192.168.10.10:/nfsroot-x86
2917360 2095512 673652 76% /

no "hd" devices show in /dev

dmesg|grep hd
ide0: BM-DMA at 0xfdd0-0xfdd7, BIOS settings: hda:DMA, hdb:DMA
ide1: BM-DMA at 0xfdd8-0xfddf, BIOS settings: hdc:DMA, hdd:DMA
hda: ST315323A, ATA DISK drive
hda: attached ide-disk driver.
hda: host protected area => 1
hda: 30008475 sectors (15364 MB) w/512KiB Cache, CHS=29770/16/63, UDMA(33)
hda: hda1 hda2 hda3 hda4

Seems to indicate that it sees the drive ok, but somehow it's lost on kernel initialization.

I'm out of my depth as far as where to look. Any suggestions?

---------

d'oh! I needed to create files in /dev

moving on to figuring out why I have a kernel Panic!

»

ozindfw Says:

So, I got to the point where the kernel didn't panic, just hung.

In attempting to recompile with a slightly different config, somehow I loaded something with 686 code.

Next I've tried compiling on the RAQ using the NFS mount, but I'm getting clock skew errors between the Cobalt and the NFS Server.

Anybody got a clean, known good, late model 2.6 kernel I can use to remove that set of variables for the moment? All the links here are rotten and Google didn't turn anything trustworthy up. I think I'm chasing too many problems at one time and have started flailing a bit.

»

ozindfw Says:

Success!

I snagged a kernel off the Strongbolt site and confirmed that I had everything else correct.

Once that was running I was able to do a clean kernel compile on the cobalt (not using the NFS mount.)

That clean compile boots nicely. I'll put it up somewhere and drop the link here.

Thanks to all who created this instruction set, and thanks to Tim for his contribution to the instructions and for hosting this.

»

rjchute Says:

So using primarily these instructions I was able to get Debian 4.0 installed on my RaQ3 (yay its useful again!). However, a problem I came into, particularily unexpected when setting static IP address, was that for some reason the net cards are eth1 and eth2, not the expected eth0 and eth1... is this normal or did I miss something?

»

tillywern Says:

So I have followed along and have a working Raq3 with the latest ROM fro sourceforge. I have been trying to compile a 2.6.21.3 kernel with the linux-cobalt-2.6.20-r1-2007022201.illogical.patch.

Compile works fine. Tried both gzipped version and bzip2'd version. Every time I "bfd" my kernel panic's before even displaying the kernel version.

The only output I get is a message on the LCD telling me "kernel panic".

I am actually building the kernel on the cobalt as well. Not a fast process but one that I am hoping will provide the most stable results.

Any ideas?

»

tillywern Says:

Well you all didn't get much of a chance to respond. I have it working now. I went through another cycle of 'make config' and now my config works.

2.6.21.3 with the Jeffs 2.6.x patches.

The problem may have stemmed from two places. The first was a old initrd, from a previous kernel, that was in /. The second being just finding the correct kernel config.

I would be happy to post the kernel config I used if anyone is interested in it.

Now on to the rest of the stuff.

»

silver Says:

wouldnt only be nice to get the kernel config, would also be nice to get hold of the Debian kernel package...

»

Coyote Says:

I've now posted a Cobalt Debian Kernel Compile HOWTO which includes config file & updated patch for linux-2.6.22.6. As for the completed deb files, I thought about that, but since you have to run 'make modules modules_install' on a patched source anyway, might as well go throught the trouble of compiling everything (it's really simple anyway). The kernel compile only took 56 minutes on a RaQ4. I can't imagine it'd take much longer than that. Besides, it's just enough time to make something to eat & enjoy a meal. ;-)

- Coyote
Living life 32 beats at a time...

»

calvin Says:

sorry, but i am having trouble with the debootstrap step already (=

# debootstrap --arch i386 sarge /nfsroot-x86 http://ftp.us.debian.org/debian/
but i get this error:
W: Failure trying to run: chroot /nfsroot-x86 mount -t proc proc /proc

i am running debian unstable on a x86 machine, i also notice that the apt or the apt-util package is not extracted from the list when i run the debootstrap command.

/nfsroot-x86/etc/inittab is not there either..

»

calvin Says:

can someone please tell me what to do with the serial cable? (=
sorry, i've never used one before..

whats the latest kernel on the cobalt? 2.6?

ext3 available?

thanks

----------------
just ignore these few comments.. i got them all working now.

»

Edward Says:

Hi,

Thanks for this clear how to. When booting my Raq 4r, I have a problem. All seems to go well but on the serial console I get the following error message;
INIT: Id "T0" respawning too fast: disabled for 5 minutes INIT: no more processes left in this runlevel

Do you have any hints or clue's how to resolve this?

Thanks,
Edward

»

Coyote Says:

I remember getting this same message at some point during my multiple installs (to help write the HOWTO) & I'm 99% sure that this error comes from not setting the correct baud in inittab for the serial port. The correct speed should be 115200 as the line below:

T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100
I'm not 100% positive...and I can't seem to find any documentation to back this up, but I think this was the solution.

- Coyote
Living life 32 beats at a time...

»

thenickberry Says:

I came across this error too.. it's because /dev/ttyS0 does not exist within /nfsroot-x86

chroot /nfsroot-x86
mknod -m 660 /dev/ttyS0 c 4 64

voila!

thanks for the great guide, I now have a working Cobalt Raq4 again!

»

Edward Says:

Hi,

I got it working after installing Debian Stable on my laptop it works like a charme. Now I'm copilling a 2.6 kernel with the patches for the Cobalt RaQ.

Thanks for the clear how to. As a newby it is a steap learning curve.

If you are interested in the Kernel let me know.

Cheers,
Edward

»

Coyote Says:

If you get the kernel running, I'd definitely be interested. I was going to do it myself, but haven't had the time. Now that I've got it running...I've been putting it to use for my dev environment. At some point I'll start hacking at it...but for now...I'm just glad to have the thing running that I don't want to bring it down just yet. Definitely let me know though, I'd be more than willing to be a tester for this kernel.

- Coyote
Living life 32 beats at a time...

»

Edward Says:

What I did is actually follow the guide from http://gentoo.404ster.com/texts.php?action=view&id=10

And to enable ext3 is downloaded the tools from http://sourceforge.net/projects/cobalt-rom

Since the lcd isn't working as I want I will try and fix that with the help of some friends ;-)

And for the speed I think these machines are still great to use.

Edward

»

Edward Says:

I noticed I forgot something, when configuring the after configuring the kernel use bzip2 to create the vmlinux file. I noticed this works a bit faster then gzip file. Keep the bz2 file less than 1800KB.

I recently bought 5 cobalts RaQ4r and playing arounsd with one of them. the others are all up and running in my test environment.

Hope this helps a bit. Like I said my linux experiance is a matter of months reather then years. So for me it's a lot of reading and trial and error.

»

calvin Says:

did you compile it the debian way or just the normal way?

nevermind. i did it the make vmlinux way and it works great... EVERYTHING is working great on my qube3 with 2.6.19.1

»

jtuttle Says:

I recently bought a Qube 3 and am planning to install Ubuntu. Thanks for sharing your experiences installing Debian. I've been making notes and collecting tools, but I'm not sure which ROM to use from thokin. I see the Generation III ROM, 2.3.40.rom, and the paged ROM, 2.9.36-paged.rom. Which did you use?

Also, would you mind responding with a follow-up? I'd love to hear about how your RaQ4 is running, issues, performance, etc. Thanks again.

If you wouldn't mind, perhaps you could email me and we could talk?

Jim

http://www.prairienet.org/~jtuttle

»

Coyote Says:

The Qube3 is a very similar machine. We've actually got one at work that we're trying to retire...at which point I'd love to pick up for myself. As for your ROM version...the 2.3.40 is the one I used, because it's the latest that was built specifically for the Gen III cobalts (RaQ4/Qube3). The 2.9.36 I believe was built for the Gen IV (RaQ550) cobalts. I didn't want to take a chance at trying it & ending up with a rack mount paper weight. I've heard that it's possible to get the 2.9 working...but again...I didn't want to take the chance.

- Coyote
Living life 32 beats at a time...

»

jtuttle Says:

Hey Tim,

Hope all is well. I wondered if you'd ever seen this error when working on your Raq.

Warning: unable to open an initial console.
Kernel panic: No init found. Try passing init= option to kernel

I've tried quite a few things, but my knowledge of the kernel, the boot process, and modules, is pretty sketchy. I wondered if you have any experience dealing with it. I followed your instructions to the letter to no avail.

If you live near Raleigh-Durham, I'd be glad to buy you a beer sometime.

Jim

http://www.prairienet.org/~jtuttle

»

calvin Says:

the problem maybe your kernel is too old and the hdd is too new/big.

what kernel you using? how big is the hdd?

i had that problem for a while, i got it fix by reinstalling the system including repartitioning the hdd.

now i am on a 80gig hdd with 2.6.19 kernel and no problem booting up.

ps: i never got any reply on my posts. i dont even know if tim still checks this or not. good luck dude.

»

Coyote Says:

Sorry fellas, I'm still pretty surprised that this is actually useful for some people, so I don't expect comments. Hence why I don't check for them often.

As for your problem jtuttle, make sure that /nfsroot-x86/etc/inittab & /nfsroot-x86/etc/securetty are setup properly in Steps 3 & 4 of Part I. I saw the same error when setting mine up (I should've documented it better), but I think the problem was solved with those steps.

- Coyote
Living life 32 beats at a time...

»

pabilo Says:

It's friday 04:13 and my cobalt cube 3 is running Debian Etch. Thanks to Timothy.

With a lot of oeps and oei's but the cube is alive!!

»

Coyote Says:

Yeah, man...that was fun. I'm glad it's finally going now. And now is where the fun really begins.

- Coyote
Living life 32 beats at a time...

»