NetBSD/cobalt Frequently Asked Questions
General Questions
- How do I install on my fresh Cobalt?
- What can I do with the front panel buttons?
- How do I do a netboot?
- Are there any restrictions on the kernel that can be loaded?
- What's the process when booting from local disk?
- How can I boot a non-default kernel?
- How do I prepare the harddisk for installing NetBSD?
- Serial Interface for the Qube2700
- The system hangs at random times
- Where can I find the latest snapshot of NetBSD/cobalt?
- How do I get "make install" working for the kernel?
- How do I install without a serial cable?
- How do I create a Restore CD?
Other sources of information
- Diskless NetBSD HOW-TO
- Homepage of the Official Cobalt users group
- The TeamRushmere TeraQube2
- Resources from Sun Cobalt
General Questions
How do I install on my fresh Cobalt? (top)
Until an install kernel is built you will have to do everything manually. This includes:
- setting up an NFS server machine to serve a diskless filesystem and (optionally) the kernel
- repartitioning the drive, setting up filesystems, and extracting the sets
- configuring the system
If you are unfamiliar with NetBSD or how to layout portions of the system, take a look at The NetBSD Guide .
Since the kernel does not have the ramdisk image to support an installer it has to have its root filesystem provided externally. The NFS server must be able to serve out not just files, but also device nodes (/dev entries). This may not be possible with non-Unix-like NFS servers. First one needs to prepare the server and then netboot the kernel. See the NetBooting question for details. After setting up the diskless root, you will want to copy the sets over for easy installation.
The original disk in the cobalts came partitioned for Linux. The first FDISK partition is special (Linux root (/)) and must always exist. This is because the firmware looks to there for the kernel to boot. The remaining partitions can be removed and the space used for NetBSD. See the preparing the harddisk for installing NetBSD question for instructions.
Note: If your system did not have Linux on it before,
tools to build an ext2fs in the first FDISK partition can
be found in pkgsrc under
sysutils/e2fsprogs.
The last step is to configure the system. The NetBSD Guide can assist you in this.
What can I do with the front panel buttons? (top)
-
Hold the reset button ("pencil" button left of the keypad area on the front) in while powering on to toggle on/off the firmware console on the serial port. It runs at 115200 bps, 8N1. After changing that setting, the machine needs another power-cycle to actually use the new setting.
Press the space bar while the diagnostics run to halt the autoboot process.
Type ? at the firmware prompt to get a list of commands.
- Holding in all four cursor buttons while powering on boots the kernel /usr/games/.doug .
- Holding in the left and right cursor buttons
in while powering on executes the command
bfd /boot/vmlinux.gz root=/dev/nfs
nfsroot=/nfsroot
, resulting in a netboot. On RaQ 1's, the default
kernel name is
vmlinux_RAQ.gzand on RaQ 2's, it isvmlinux_raq-2800.gz.
How do I do a netboot? (top)
Break into the debugger (see above), you can netboot with e.g. with the following command:
# bfd /netbsd.gz nfsroot=/home/raq/root
The firmware is picky about syntax and in general, so
if things fail mysteriously, try to conform to the
conventions described above. For netbooting, you need to
NFS-export the directory given to "
nfsroot=
", and the named kernel ("
/netbsd.gz
") needs to be executable and in that directory. You will
also need to setup rarp and dhcp. Once the kernel is loaded
with the command line values, the data given via DHCP is
used to mount the root filesystem. Here is a DHCP entry
that is known working:
host raq {
hardware ethernet 0:10:e0:0:52:62; # raq MAC
fixed-address 10.0.0.15; # raq address
filename "/netbsd.gz"; # kernel name in root-path
option root-path "/home/raq/root"; # absolute dir on nfs server
server-name="10.0.0.3"; # IP of nfs server
}
See the Diskless NetBSD HOW-TO .
Are there any restrictions on the kernel that can be loaded? (top)
The firmware can only load gzipped kernels, and they have to be smaller than about 1000000/2500000 bytes compress/uncompressed.
Also, various models expect different filenames for the kernel as noted above. You can use the /usr/mdec/installboot script to create them all.
What's the process when booting from local disk? (top)
The disk is expected to have an "FDISK" style partition table with a "Linux native" (ID 131) partition with an ext2fs (old style, pre-Linux 2.2; see posting by Andrew Gillham for more details).
The default autoboot process loads a gzip'ed ELF
kernel or boot loader from
/boot/vmlinux.gz
(or
/boot/vmlinux_RAQ.gz
or
/boot/vmlinux_raq-2800.gz
) from the EXT2 filesystem on the first MBR partition on
the primary disk.
There is no provision for changing the boot path beyond disabling autoboot and the kernel or the boot loader must always be gzip'ed.
When there is no NetBSD disklabel on the disk, the four MBR partitions are mapped to [e-h].
How can I boot a non-default kernel? (top)
To boot a non-default kernel (see above ), e.g. to test a new feature or kernel, you can do so with the following steps:
- Copy a compressed kernel to (say) /boot/test.gz on the ext2 partition that has the usual kernels
- Shut down the system
- At the console, type:
# bfd /boot/test.gz
How do I prepare the harddisk for installing NetBSD? (top)
The firmware basically needs:
- "FDISK" style partition table with a "linux native" first partition is formatted as ext2fs.
-
/boot/vmlinux.gz-- holds the gzipped kernel or boot loader (in Linux partition) -
/boot/vmlinux_RAQ.gz-- alternative name for RaQ 1 -
/boot/vmlinux_raq-2800.gz-- alternative name for RaQ 2 -
/usr/games/.doug-- optional backup kernel (in same Linux partition)
Everything else on the Linux filesystem can be trashed as it is totally unnecessary. You should be able to just fdisk/partition/newfs and copy a kernel onto the new filesystem. You shouldn't need to do a complete install on the disk.
The disk that comes in the Raq2 has four partitions:
- linux root (/): Recognizes as /dev/wd0e when there's no NetBSD disklabel on the disk, e.g. when doing a netboot. This partition has the compressed kernel or boot loader held at /boot/vmlinux.gz.
- linux swap: This can be used later to swap into when NetBSD is installed, saves setting up a NetBSD swap partition. Identified as /dev/wd0f.
- linux /var: This 200MB partition has some data on it that I decided to ignore, and keep on the disk in case I need to go back to Linux. Identified as /dev/wd0g in default disklabel.
- linux /home: This >3GB partition had very little data on it that I copied over to the Linux /var partition so that I can use it for NetBSD's system disk. Identified as /dev/wd0h by default, installation steps below.
All the Linux partitions are of ext2 filesystem, and they can be checked (if needed) and mounted from NetBSD with:
# fsck -t ext2fs /dev/wd0e # fsck -t ext2fs /dev/wd0g # fsck -t ext2fs /dev/wd0h # mount -t ext2fs /dev/wd0e /mnt # mount -t ext2fs /dev/wd0g /mnt/var # mount -t ext2fs /dev/wd0h /mnt/home
Before installing NetBSD, it is recommended to back up the data of the Linux /home partition to the Linux /var partition. Then, use NetBSD's “fdisk -u” command to change the partition ID from 131 (Linux userland) to 169 (NetBSD). Following a reboot to get the new partition data, a disklabel can be written:
# disklabel wd0 >x # disklabel -r -R wd0 x
The disklabel now lacks a NetBSD root partition (wd0a), and we use the old Linux home partition (wd0h) for that. Just change the "h:" in "disklabel -e wd0" to "a:", the filesystem type to 4.2BSD, and you're set. Next, create a filesystem and mount it:
# newfs /dev/wd0a # mount /dev/wd0a /mnt
After that, the NetBSD sets can be extracted from
NFS. You need to extract at least etc, base and kern, comp
is strongly recommended, the others (text, games, man,
xbase, ...) don't hurt. The sets are in the
cobalt/binary/sets directory of the
latest NetBSD release:
# tar pzvxCf /mnt etc.tgz # tar pzvxCf /mnt base.tgz # tar pzvxCf /mnt kern.tgz
After that, the "/dev" dir needs to be populated:
# cd /mnt/dev # sh MAKEDEV all
The final step is to ensure we can boot a NetBSD
kernel which we can do in a couple of ways. In either case
setting up an entry in
(/mnt)/etc/fstab
to mount the Linux
root partition is recommended:
# /dev/wd0e /altroot ext2fs rw 0 1
- Using NetBSD kernel as
/boot/vmlinux.gzFor this, we compress the kernel from the kern.tgz set, and put it on the Linux root partition mounted at
/altroot.# mount /altroot # cd /altroot/boot # mv vmlinux.gz vmlinux.gz.linux # cp /netbsd vmlinux # gzip -v9 vmlinux
Note that the kernel needs to be present (and in sync!) in the following places:
- /netbsd: tools like netstat want that
- /altroot/boot/vmlinux.gz: booted by the Cobalt firmware
- Using a boot loader as
/boot/vmlinux.gzHere we compress the boot loader from the base.tgz set, and put it on the Linux root partition.
# mount /altroot # cd /altroot/boot # mv vmlinux.gz vmlinux.gz.linux # cp /usr/mdec/boot vmlinux # gzip -v9 vmlinux
After these steps, the firmware should be able to find the kernel and boot it:
# reboot
What follows is that the system will boot and needs
to get configured. If you have trouble mounting the root
filesystem read/write, the command to get that is "
“mount -u /dev/wd0a /”.
Now setup /etc/rc.conf and enjoy!
Sorry, there's no all-singing, all-dancing install-routine (yet).
Serial Interface for the Qube2700 (top)
The Qube2700 is shipped without any serial interface. It is however possible to construct one by following these instructions. Should
This serial interface is however not a full I/O serial due to both hardware and software limitations. It can only be used while talking with the boot ROM or reading console about which can come in handy while debugging.
In your Qube2700 you should find a print on the PCB as (or similar):
Cobalt Microserver, Inc.
CPU Board 850-00101
You would then have a 18 or 20 pin header titled "SCC CON" adjacent to the AMD 28F040 chip. The pinout of the header is as follows:
memAD0 2 1 +5V
memAD1 4 3 Dadr0
memAD2 6 5 Dadr1
memAD3 8 7 serialInt_low
memAD4 10 9 serialClk
memAD5 12 11 serialCs_low
memAD6 14 13 tied to devWr_low
memAD7 16 15 no-connect
devRd_low 18 17 ground
devWr_low 20 19 ground
The pin 20 and pin13 tie is because there are some systems with 18-pin headers, and some with 20-pin.
The schematic is made with OrCAD and requires only an 85c30 serial chip, a DS14C239, and a few resistors and caps to build.
The system hangs at random times (top)
If you experience weird, random hangs when accessing the disk (e.g. via disklabel), when doing NFS writes etc., have a look at the order of memory modules in your machine! E.g. if you have a big and a small module, and you put them in the wrong order, the "BIOS" will complain about that:
5.Bank 0:.................................16M 6.Bank 1:.................................0M 7.Bank 2:.................................16M 8.Bank 3:...............................**Simm0 must be >= Simm1**
The above example is for a 16MB module in the slot near the case, and a 32MB module in the other slot. With such a config, you can experience all sort of weird problems. If you exchange them, all will be good. The boot message should be:
5.Bank 0:.................................16M 6.Bank 1:.................................16M 7.Bank 2:.................................16M 8.Bank 3:.................................0M
Where can I find the latest snapshot of NetBSD/cobalt? (top)
Check out ftp://ftp.NetBSD.org/pub/NetBSD/arch/cobalt/.
How do I get "make install" working for the kernel? (top)
The kernel Makefile shipped with the cobalt port can
be tuned to actually install a kernel into the right
location. For that to happen, put the following into your
/etc/mk.conf:
# Determine machine name. Could as well hardcore different
# install-kernel-machinename install targets for different machines.
MACHINE_NAME!= uname -n
# Place where the ext2fs partition is mounted, there should be a
# "boot" subdir where the kernel "vmlinux.gz" is located
BOOTDIR?= /altroot/boot
# Build name for new kernel - can do something more exciting with
# using date etc., override by setting in /etc/mk.conf.
.if !defined(NEWKERNEL)
NEWKERNEL!= echo vmlinux-`sed -n < vers.c '/osrelease/s/.*"\(.*\)".*/\1/p'`-`date +'%Y%m%d'`-`cat version`.gz
.endif
install-kernel-${MACHINE_NAME}:
gzip -c9 netbsd >${BOOTDIR}/${NEWKERNEL}
rm -f ${BOOTDIR}/ovmlinux.gz
ln ${BOOTDIR}/vmlinux.gz ${BOOTDIR}/ovmlinux.gz
ln -f ${BOOTDIR}/${NEWKERNEL} ${BOOTDIR}/vmlinux.gz
rm -f /netbsd
cp netbsd /netbsd # for vmstat and friends only
With that, 'make install' should put the kernel into the right location(s).
How do I install without a serial cable? (top)
Prepare netboot host:
- mkdir /nfsroot
- ftp ftp.NetBSD.org/.../{base.tgz, etc.tgz, e2fsprogs.tgz}
- tar xfzp base.tgz; etc.tgz; e2fsprogs.tgz
- cd dev; MAKEDEV all
-
cd etc
; edit
rc.confto enable multiuser boots, inetd, telnet. Add “secure” lines to/etc/ttys. Editfstabto:10.10.10.10:/nfsroot / nfs rw 0 0
- mkdir /nfsroot/boot
- copy a gzipped kernel that was compiled with
this patch:
-config netbsd root on ? type ? +config netbsd root on ? type nfs
- name the kernel properly. For qube2:
vmlinux_raq-2800.gz - edit
/etc/dhcpd.conf. You'll need at least the following:subnet 10.10.10.0 netmask 255.255.255.0 { range 10.10.10.125 10.10.10.135; option routers 10.10.10.10; } host qube { hardware ethernet 0:10:e0:0:f6:9b; fixed-address 10.10.10.130; filename "/vmlinux.gz"; option root-path "/nfsroot"; } - edit
/etc/exportsand add:/nfsroot -maproot=root 10.10.10.130
- enable nfs and dhcpd on host server. reboot or whatever.
Netboot the qube:
- hold down 2 left-right buttons .
- hopefully, all has gone well and you should be
able to bring it up and telnet in. Use tcpdump or
net/wiresharkto check.
Do the actual install:
- run fdisk -u wd0 . make a small linux partition. and a large netbsd one.
- run disklabel -i -I wd0 . configure to suit.
- mke2fs -r 0 -O none /dev/wd0e
- newfs /dev/wd0a and so on.
- mount /dev/wd0a /mnt
- cp or tar everything onto
/mnt -
cd /mnt/etc
and edit files so that it doesn't try to netboot anymore.
Change
fstab, setupifconfig.*files if needed. - umount /mnt; mount /dev/wd0e /mnt
-
mkdir boot
. Get another, normal, kernel. One from
ftp://ftp.NetBSD.org/
works fine. Install as
/boot/vmlinux.gzor whatever. - reboot
Everything should now come up. You have a netbsd system installed on your qube/raq.
Major gotchas:
/etc/ttys
must have secure added. Enable telnet. Check various names
of the kernels.
How do I create a Restore CD? (top)
Please see this document for detailed instructions on how to create your own Restore CD.
Other sources of information
Diskless NetBSD HOW-TO (top)
Homepage of the Official Cobalt users group (top)
The TeamRushmere TeraQube2 (top)
Step by Step instructions on turning the “Cobalt Qube2 into a really useful server” : http://www.teraqube.co.uk/ .
Resources from Sun Cobalt (top)
![[NetBSD Logo]](../../images/NetBSD-headerlogo.png)