Subject: kernels on the restore CD
To: None <port-cobalt@netbsd.org>
From: Rowdy <rowdy@netspace.net.au>
List: port-cobalt
Date: 12/31/2005 12:00:00
Greetings,

While trying to create a restore CD for 3.0, I have started poking 
around in the install scripts, and found an oddity.

The script I am looking at is /nfsroot/install/scripts/install-core.sh. 
  There is a function therein install_boot() that looks like this:

install_boot()
{
         printmsg "Setting up boot partition..."

         $MOUNT $ALTROOT_DEV /mnt
         mkdir /mnt/boot

         # Copy boot loader and the kernels as a backup measure
         $CP /cobalt/binary/kernel/boot.gz /mnt/boot
         $CP /cobalt/binary/kernel/netbsd.gz /mnt/boot
         $CP /cobalt/binary/kernel/netbsd-GENERIC.gz /mnt/boot

         cd /mnt/boot
         for i in $RAQ_KERNELS; do
                 $LN boot.gz $i
         done

         cd /
         $UMOUNT /mnt
}

It mounts /dev/wd0e, copies from the restore CD boot.gz (this is the one 
from Dennis' original restore CD), netbsd.gz (from the version of NetBSD 
being installed, in my case 3.0) and netbsd-GENERIC.gz (also from 3.0).

Then it iterates thru the $RAQ_KERNELS list (vmlinux.gz 
vmlinux-nfsroot.gz vmlinux_RAQ.gz vmlinux_raq-2800.gz) and links each 
one to boot.gz.

In the instructions.txt file, it notes that if the installation fails, 
you should manually boot, manually mount /dev/wd0e, and link each of the 
alternative names to netbsd.gz.

Which is correct?

After restoring from Dennis' restore CD, it seems that all kernels are 
linked to boot.gz, and the Qube boots.  After restoring from my 3.0 
restore CD, all the files are still linked to boot.gz (as per the 
install-core.sh script, above) but it does not boot.

If I manually link all the alternative names to netbsd.gz, the Qube does 
boot (albeit tries to mount root from tlp0, but that is another problem).

To aid my understanding of the files in the /boot directory, is the 
following correct:

boot.gz - created by Dennis(?) to boot a kernel called netbsd.gz

vmlinux.gz - booted automatically by the Qube's firmware

netbsd.gz - the NetBSD kernel

If that is correct, then vmlinux.gz should be linked to boot.gz, and 
when the firmware loads vmlinux.gz (i.e. when it loads boot.gz), boot.gz 
should take over and start netbsd.gz.

Thanx

Rowdy