HOWTO: Installing RedHat 9 on a Qube 3

This is a draft - the document is not yet complete, and lots of steps are missing. I started doing this a while back, and then decided it was not worth the hassle at this point, since I was unable to compile a suitable kernel to make the network install work.

(Yes, I know I can always remove the hard disk and place it on a PC, but I always thought that was a particularly lame approach - and I wanted a clean upgrade process, maybe even a "restore" CD.)

Update: I had a partial success with Core 1 a while back - I got it to install OK, but failed to get it to boot afterward (couldn't get a stable kernel into it either). From what I've read recently, some of the K6 optimizations were fundamentally broken on some gcc builds, so this might be something to try again - probably with Core 2 and i386 optimization, plus a few more Flash upgrades...


Introduction

Following the demise of our Qube 3 and given Sun's extinction of most of the Cobalt product line (I'm talking about the gen_III hardware - the RaQ 3, 4 and 550 - with which the Qube shares most characteristics), I decided that the best way to extend the little box's useful lifetime would be to completely forego the Cobalt distribution and install 9 on it.

I tinkered briefly with the notion of installing on it, but 9 seemed a better (and more stable) starting point. Furthermore, I had come across two sets of instructions to install on a Cobalt (one set for RedHat 8.0 on a RaQ, and another for 7.2 on a Qube), and the differences between 8 and 9 are still relatively fresh in my mind.

The base procedure should be applicable to any gen_III box, and besides voiding your warranty (if you still have any of these boxes under warranty, of course) carries a definite risk of rendering your hardware completely useless. As usual, I take no responsibility for the accuracy or completeness of this procedure, or for the consequences of anyone following it to upgrade their hardware.

Overview

This procedure replaces the Cobalt distro by booting off an NFS share, fooling the Cobalt into installing under the guise of the normal OS Restore mechanism built into the Cobalt's ROM.

To achieve this, however, you must first upgrade the device's ROM to support booting a different (larger) kernel. This is the most dangerous part of the procedure, and the only thing that can't easily be undone - the rest can be easily rolled back with a normal OS Restore CD.

The kernel used is not a stock kernel, but a Cobalt 2.4 kernel with proper support for the LCD and network hardware - which means we have to diddle with the installation a bit too, but nothing too fancy.

Rebuilding a Cobalt kernel from the latest 2.4 sources is left as an exercise to the reader, but may well be the subject of a later .

You must have a working Cobalt box to start with, and I recommend doing a full OS Restore first to remove any cruft you may have installed. It only takes about half an hour and you can set up the rest of the environment in the meantime.

Ingredients

You need:

  • A Cobalt box to perform the upgrade on (obvious)
  • A box to act as DHCP and boot server with enough disk space to host the files (2GB is enough)
  • A null-modem cable to connect to your Cobalt console port
  • The 9.0 CDs or ISO images
  • The Cobalt flashtool utility and ROMs, available here (the 2.9.34 ROM used here is in the unified_rom directory).

Preparing the Serial Console

The Cobalt Series ROM supports a serial console for displaying boot messages, but it is disabled by default. To enable it, you must use a toothpick or paper clip to hold down the recessed "change password" button (in the Qube 3, it is the small hole underneath the power button).

To access the console, simply connect the Cobalt via a null-modem cable to a PC or and use a terminal emulator like minicom or set to 115,200 baud, no parity, eight data bits, one stop bit (115200 N81). Then hold down the "change password" button while power cycling the Cobalt - you'll see Console ON flash on the LCD display and a very normal set of boot messages scroll by on the terminal.

         Cobalt Networks, Inc. - Connecting the Dots
                  Firmware version 2.3.35

Current date: Oct 05 17:38:43 UTC 2003
ROM build info: Mon Oct 9 20:05:49 PDT 2000 war.cobalt.com
System serial number: 3606EWXXXXXXX
Memory found: 128 MB
Initializing I2C bus: done
Scanning PCI bus: done
Initializing IDE: waiting to spinup second channel...done
  IDE 0 master: found
Initializing SCSI: done
Initializing ethernet: 2 ethernet controllers installed - done
  National Semiconductor DP83815 Found at port 0x6200, MAC: 00:10:e0:04:XX:XX
  National Semiconductor DP83815 Found at port 0x6300, MAC: 00:10:e0:04:XX:YY
Initializing flash: done
  Flash bank 0: AMD AM29F080B 1MB (1:d5)
  Flash bank 1: not installed.
Initializing USB: done
Mounting rom_fs: done
Initializing i18n - language "en": done

Press spacebar to enter ROM mode
Booting default method - From disk

Setting up the NFS Boot Server

Get the 9.0 ISO files (or the CDs) and dump the contents to a directory on your boot server (don't forget to check the md5sum if you download the ISO files):

# mkdir -p /storage/RedHat/iso
# cd /storage/RedHat/iso; ncftpget my.favorite.mirror/path/to/isos/shrike*
# md5sum *.iso
400c7fb292c73b793fb722532abd09ad  shrike-i386-disc1.iso
6b8ba42f56b397d536826c78c9679c0a  shrike-i386-disc2.iso
af38ac4316ba20df2dec5f990913396d  shrike-i386-disc3.iso

Now build the directory from the CD-ROM files, mounting each one in turn as a loop device (the RELEASE-NOTES come in handy, but they are not strictly necessary):

# mkdir -p /storage/RedHat/nfs
# cd /storage/RedHat/nfs
# mount -o loop /storage/RedHat/iso/shrike-i386-disc1.iso /mnt/cdrom
# cp -a /mnt/cdrom/RELEASE-NOTES* .
# cp -a /mnt/cdrom/images .
# cp -a /mnt/cdrom/RedHat .
# umount /mnt/cdrom
# mount -o loop /storage/RedHat/iso/shrike-i386-disc2.iso /mnt/cdrom
# cp -a /mnt/cdrom/RedHat .
# umount /mnt/cdrom
# mount -o loop /storage/RedHat/iso/shrike-i386-disc3.iso /mnt/cdrom
# cp -a /mnt/cdrom/RedHat .
# umount /mnt/cdrom

You should end up with a directory tree like this:

/storage/RedHat/nfs --+-- RedHat --+-- RPMS
                      |            |
                      |            +-- base
                      |
                      +-- images

Now we have to mount the boot disk image and extract its contents. To do that, we'll work off the bootdisk.img image in the 9 distro:

# umount /mnt/cdrom
# mount -o loop /storage/RedHat/nfs/images/bootdisk.img /mnt/cdrom
# cp /mnt/cdrom/isolinux/initrd.img /storage/RedHat/nfs/initrd.img.gz
# cd /storage/RedHat/nfs
# umount /mnt/cdrom
# gunzip initrd.img.gz
# mount -o loop initrd.img /mnt/cdrom

This makes the boot disk accessible on /mnt/cdrom. Since the Cobalt network boot over NFS requires the boot files to be on /nfsroot-x86, we'll create that directory and copy them there, making them world-writable so that the installation program can use them:

# mkdir /nfsroot-x86
# cd /mnt/cdrom/
# cp -a . /nfsroot-x86/
# cd
# umount /mnt/cdrom
# chmod -R 777 /nfsroot-x86

Now to actually export the filesystems so that the Cobalt can boot off them. The file /etc/exports must have the mount points denoted like this:

# cat /etc/exports
/nfsroot-x86 192.168.0.0/24 (rw)
/storage/RedHat/nfs 192.168.0.0/24 (rw)

This exports the files to your local subnet (change the network addresses accordingly). Make sure NFS is running. If it's not, you can start it by running the portmapper and the NFS daemon like this, and making sure the filesystems are exported:

# /etc/rc.d/init.d/portmap start
# /etc/rc.d/init.d/nfs start
# exportfs

Building a Boot Kernel

Exporting the filesystems is only half the battle. We now need to provide the Cobalt with a kernel to bootstrap the installation process, which is to be placed in /nfsboot-x86.

Here's how to build it: on a 9 system, install the kernel-sources package (plus whatever else is necessary to build a kernel). Go to /usr/src/linux-2.4 and pick a configuration file to build the new kernel (the actual file name depends on the kernel version you have. Mine is 2.4.20-18.9):

# cd /usr/sr/linux-2.4
# cp /usr/src/linux-2.4/configs/kernel-2.4.20-i386.config ./.config

Now the .config file must be changed to handle basic Cobalt hardware stuff. Find the following settings:

CONFIG_BLK_DEV_LVM=m
CONFIG_BLK_DEV_LOOP=m
CONFIG_EEPRO100=m

...and change them to:

CONFIG_BLK_DEV_LVM=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_EEPRO100=y

Now build the kernel:

# make oldconfig; make dep; make vmlinux

...and go take a cup of coffee or something. The result will be a vmlinux file in the /usr/src/linux-2.4 directory, which has to be compressed (I'm partial to gzip) and placed in the NFS boot directory:

# gzip -9 vmlinux
# mv vmlinux.gz /nfsroot-x86

The Cobalt ROM searches for suitable kernels in the following places:

BOOTLOADER: opening "/boot/vmlinux.bz2"
BOOTLOADER: opening "/vmlinux.bz2"
BOOTLOADER: opening "/boot/vmlinux.gz"
BOOTLOADER: opening "/vmlinux.gz"

Finally, all that remains is to make the Cobalt boot from the NFS server:

Press spacebar to enter ROM mode

Cobalt:Main Menu> boot

Cobalt:Boot Menu> bfn

If you have issues with NFS, try making sure that your NFS server's /etc/hosts has an entry for the Cobalt (find out which IP was allocated to it by your DHCP) and edit exports accordingly.

After a while, if everything goes well, you'll see:

Welcome to Red Hat Linux

                   +---------+ Choose a Language +---------+
                   |                                       |
                   | What language would you like to use   |
                   | during the installation process?      |
                   |                                       |
                   |       Chinese(Simplified)    #        |
                   |       Chinese(Traditional)   #        |
                   |       Czech                  #        |
                   |       Danish                 #        |
                   |       Dutch                  #        |
                   |       English                #        |
                   |       French                 #        |
                   |       German                 #        |
                   |                                       |
                   |                +----+                 |
                   |                | OK |                 |
                   |                +----+                 |
                   |                                       |
                   |                                       |
                   +---------------------------------------+

  <Tab>/<Alt-Tab> between elements  | <Space> selects | <F12> next screen

Note:: I got it working up to this point, but I have so far been unable to compile a working kernel that could be loaded by the ROM monitor and which had loop device support - which is essential to installing 9.


Upgrading the ROM

There are several ROM images available for gen_III hardware, which belong to two main series: the 2.3 series (of which 2.3.40 seems to be the latest) is unsupported but deemed mostly stable, and the 2.9 series is branded as "experimental" (or worse).

Given the number of revisions the 2.9 series has gone through, I decided to go with it. But first, we must obtain and test flashtool:

$ wget ftp://ftp-eng.cobalt.com/pub/users/thockin/2.4/flashtool
$ md5sum flashtool
cab48351fae6963852746094ad344c0f  flashtool
$ chmod +x flashtool
$ ./flashtool
./flashtool, Copyright (c) 2001 Sun Microsystems, Inc.
$Revision: 1.16 $
usage: ./flashtool [options] <mode>
options:
  -h                 : get this help
  -v                 : enable verbose output
  -V                 : print version info
modes:
  -r                 : read the rom (to stdout)
  -w <rom image>     : write the rom

Then, we su to root and make a backup copy of the existing ROM:

$ su
Password:
# ./flashtool -v -r > stock.backup.rom
./flashtool: searching for PCI 10b9:7101 : found it at /proc/bus/pci/00/03.0
./flashtool: systype = COBT_3K
./flashtool: bank 0: AMD AM29F080B 1MB
./flashtool: Using pthread POSIX real time scheduling.
./flashtool: reading page 0
./flashtool: reading page 1
./flashtool: reading page 2
./flashtool: reading page 3
./flashtool: reading page 4
./flashtool: reading page 5
./flashtool: reading page 6
./flashtool: reading page 7
./flashtool: reading page 8
./flashtool: reading page 9
./flashtool: reading page 10
./flashtool: reading page 11
./flashtool: reading page 12
./flashtool: reading page 13
./flashtool: reading page 14
./flashtool: reading page 15
./flashtool: flushing buffers

Then we obtain the 2.9.34 ROM and flash it:

# wget ftp://ftp-eng.cobalt.com/pub/users/thockin/2.4/unified_rom/2.9.34-paged.rom
# md5sum 2.9.34-paged.rom
33d104cd7a350d30b47573a350413508  2.9.34-paged.rom
# ./flashtool -v -w 2.9.34-paged.rom
./flashtool: searching for PCI 10b9:7101 : found it at /proc/bus/pci/00/03.0
./flashtool: systype = COBT_3K
./flashtool: bank 0: AMD AM29F080B 1MB
./flashtool: Using pthread POSIX real time scheduling.
./flashtool: writing page 0
./flashtool: buffer page 0 does not exist - creating it
./flashtool: writing page 1
./flashtool: buffer page 1 does not exist - creating it
./flashtool: writing page 2
./flashtool: buffer page 2 does not exist - creating it
./flashtool: writing page 3
./flashtool: buffer page 3 does not exist - creating it
./flashtool: writing page 4
./flashtool: buffer page 4 does not exist - creating it
./flashtool: writing page 5
./flashtool: buffer page 5 does not exist - creating it
./flashtool: writing page 6
./flashtool: buffer page 6 does not exist - creating it
./flashtool: writing page 7
./flashtool: buffer page 7 does not exist - creating it
./flashtool: writing page 8
./flashtool: buffer page 8 does not exist - creating it
./flashtool: writing page 9
./flashtool: buffer page 9 does not exist - creating it
./flashtool: writing page 10
./flashtool: buffer page 10 does not exist - creating it
./flashtool: writing page 11
./flashtool: buffer page 11 does not exist - creating it
./flashtool: writing page 12
./flashtool: buffer page 12 does not exist - creating it
./flashtool: writing page 13
./flashtool: buffer page 13 does not exist - creating it
./flashtool: writing page 14
./flashtool: buffer page 14 does not exist - creating it
./flashtool: writing page 15
./flashtool: buffer page 15 does not exist - creating it
./flashtool: flushing buffers
./flashtool:   flushing block 0 to ROM... verifying...  done
./flashtool:   flushing block 1 to ROM... verifying...  done
./flashtool:   flushing block 2 to ROM... verifying...  done
./flashtool:   flushing block 3 to ROM... verifying...  done
./flashtool:   flushing block 4 to ROM... verifying...  done
./flashtool:   flushing block 5 to ROM... verifying...  done
./flashtool:   flushing block 6 to ROM... verifying...  done
./flashtool:   flushing block 7 to ROM... verifying...  done
./flashtool:   flushing block 8 to ROM... verifying...  done
./flashtool:   flushing block 9 to ROM... verifying...  done
./flashtool:   flushing block 10 to ROM... verifying...  done
./flashtool:   flushing block 11 to ROM... verifying...  done
./flashtool:   flushing block 12 to ROM... verifying...  done
./flashtool:   flushing block 13 to ROM... verifying...  done
./flashtool:   flushing block 14 to ROM... verifying...  done
./flashtool:   flushing block 15 to ROM... verifying...  done

If anything goes wrong at all, retry the procedure once with the new ROM, then revert to the old one. Whatever you do, don't power down the device with a mis-written ROM image - it will never boot again.

The default boot method for the new ROM is "from network", and the serial console output looks like this:

         Sun Cobalt - Smaller, Bluer, Better
               Firmware version 2.9.34

Current date: Mar 02 11:03:18 UTC 1976
ROM build info: Fri Apr 5 00:05:20 PST 2002 galvatron.cobalt.com
System serial number: Uninitialized
System type: 3000 series system, Version 2 board
Silicon serial number: 59000007e50XXXXX
Monitor: 153712 bytes
Memory: 96 MB
CPU: 1 processor(s) detected
  CPU 0: AuthenticAMD 298MHz (3 x 100MHz host bus) [BSP]
Initializing flash: done
  Flash Bank 0: AMD AM29F080B 1024KB (01:d5)
  Flash Bank 1: not installed.
Mounting ROM fs: done
Initializing PCI: done
  Host Bus: 0 (device 1d:04) [33MHz]
    Device: 00:00 10b9:1541 Acer Labs M1541 Aladdin V Host Bridge
    Device: 01:00 10b9:5243 Acer Labs M5243 AGP Controller
    Device: 02:00 10b9:5237 Acer Labs M5237 USB Controller (IRQ 6)
    Device: 03:00 10b9:7101 Acer Labs M7101 PMU
    Device: 07:00 10b9:1533 Acer Labs M1543 Aladdin V PCI-ISA Bridge
    Device: 0e:00 1000:000f Symbios Logic SYM53C875 SCSI Controller (IRQ 12)
    Device: 0f:00 10b9:5229 Acer Labs M5229 TXpro IDE Controller (IRQ 14)
    Device: 10:00 100b:0020 National DP83815 MacPhyter Ethernet (IRQ 11)
    Device: 12:00 100b:0020 National DP83815 MacPhyter Ethernet (IRQ 10)
    Device: 14:00 1011:0024 DEC 21152 PCI-PCI bridge
  Bridged Bus: 1 (bridge: 00:01:00)
  Bridged Bus: 2 (bridge: 00:14:00)
    Device: 04:00 8086:1229 Intel 82557 EEPro100 Fast Ethernet (IRQ 9)
    Device: 05:00 8086:1229 Intel 82557 EEPro100 Fast Ethernet (IRQ 10)
Initializing ethernet: 2 controller(s) found
  National Semiconductor DP83815 Found at port 0xec00, MAC: 00:10:e0:04:XX:XX
  National Semiconductor DP83815 Found at port 0xeb00, MAC: 00:10:e0:04:XX:YY
Initializing IDE: found ALI M5229 at 00:78
  spinning up second channel: done
  scanning ide0: master
  scanning ide1:
IDE: stabilizing spinup: 100%
Checking Memory: done

Press spacebar to enter ROM mode