Subject: Re: kernels on the restore CD
To: None <port-cobalt@netbsd.org>
From: Rowdy <rowdy@netspace.net.au>
List: port-cobalt
Date: 01/01/2006 11:42:38
Rowdy wrote:
> 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:
> 
<snip>
> 
> 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
> 
> 

Answering my own questions ...

boot.gz is the NetBSD cobalt bootloader that should be linked from
vmlinux.gz etc. and, when booted by the Qube firmware, attempts to load
/netbsd from wd0a (and then tries a few other names if that file could
not be found) (thanx to Dennis and manpage boot(8) circa Jan-2004).

The netbsd.gz in wd0e:/boot is just for convenience and is not actually
used, unless you interrupt the boot process and specify 'bfd
/boot/netbsd.gz', in which case it must conform to the firmware's size
limitations.

So in theory the netbsd-GENERIC.gz should be able to be booted by the
boot.gz bootloader, and should be copied to /.

netbsd-INSTALL.gz is a stripped-down kernel intended for
installation/recovery purposes (comments by Tsutsui-san somewhere), and
for the purpose of a restore CD should not be required (but it might be
nice to copy it to wd0e:/boot as a sort of proto-emergency resort).

I suspect that the restore CD's suggestion to link vmlinux.gz to
netbsd.gz in wd0e:/boot is in case the boot loader fails for some
reason, then provided netbsd.gz in /boot is within the size limit (and
also matches wd0a:/netbsd) the Qube should boot.

Rowdy