Saturday, September 09, 2006

Cobalt RAQ2 Netboot config

Netbooting a Cobalt RAQ2 (this should become a tech note)
This covers up through 1.6.2. Later versions may work, but a custom, very stripped down kernel must be used due to hardware limitations.

This setup was done on a Soekris running 3.1_RC2. The Raq2 was connected to the 3rd ethernet (sip2).

Most of this information is scattered amongst half a dozen man pages.

Containing directory where .tgz's were unpacked. Make sure that .../netbsd.gz is the compressed version of .../netbsd. You can do as much setup as you'd like. IP address information will get configured automatically.
/net/cobalt/root

MAC Address of Raq2:
00:10:e0:00:70:88

NFS configuration
/etc/exports:
/net/cobalt/root -maproot=0 -network 192.168.251.0/24

rarp configuration
/etc/ethers
00:10:e0:00:70:88 192.168.251.10

/etc/hosts
192.168.251.10 raq2

DHCPD configuration
ddns-update-style none;
subnet 192.168.251.0 netmask 255.255.255.0 {
}

host raq {

hardware ethernet 00:10:e0:00:70:88; # raq MAC
fixed-address 192.168.251.10; # raq address
filename "/netbsd.gz"; # kernel name in root-path
option root-path "/net/cobalt/root"; # absolute dir on nfs server

server-name="192.168.251.2"; # IP of nfs server
}


Addition to /etc/rc.conf:
ifconfig_sip2="192.168.251.2/24"
nfs_server=YES
rpcbind=YES

mountd=YES
rarpd=YES
rarpd_flags="sip2"
dhcpd=YES
dhcpd_flags="sip2"


Boot command on the raq2, to be entered at the prom prompt (space during hardware inventory drops to prom, gotta be fast!):
bfd /netbsd.gz root=/dev/nfs nfsroot=/net/cobalt/root


TODO: get rid of the "ask" after the kernel autoconfs, before it continues startup.

Soekris CF image creation

Getting NetBSD on a Soekris, the quick way. (This should become a tech-note at some point.)

*Note: this assumes you don't care about wear and tear on the CF card
*Note: it also assumes you've got another NetBSD (unix) host.

Build an image of the proper size. You'll get the size in sectors from dmesg when inserting the card.

In my case, it was 500736 (a "256 Meg" card).
dd if=/dev/zero of=CF bs=512 count=500736
500736+0 records in
500736+0 records out
256376832 bytes transferred in 4.316 secs (59401490 bytes/sec)

Then do it up on a VND:
vnconfig -v -c vnd0 CF
/dev/rvnd0d: 256376832 bytes on CF

Disklabel: remove the extra partition, change the label
disklabel -e -I vnd0

Newfs:
newfs -B le -m 0 -o space /dev/rvnd0a
/dev/rvnd0a: 244.5MB (500736 sectors) block size 8192, fragment size 1024
using 6 cylinder groups of 40.75MB, 5216 blks, 10112 inodes.
super-block backups (for fsck_ffs -b #) at:
32, 83488, 166944, 250400, 333856, 417312,

Install boot:
/usr/sbin/installboot -v -m i386 -o timeout=3,console=com0,speed=19200 -t ffs /dev/rvnd0a /usr/mdec/bootxx_ffsv1
File system: /dev/rvnd0a
File system type: ffs (blocksize 8192, needswap 0)
Primary bootstrap: /usr/mdec/bootxx_ffsv1
Ignoring MBR with invalid magic in sector 0 of `/dev/rvnd0a'
Preserving 51 (0x33) bytes of the BPB
Boot options: timeout 3, flags 0, speed 19200, ioaddr 0, console com0

(the default on the soekris is 19200)

mount /dev/vnd0a /mnt
cp /usr/mdec/boot /mnt
tar -C /mnt -xpzf base.tgz
tar -C /mnt -xpzf etc.tgz
tar -C /mnt -xpzf misc.tgz
tar -C /mnt -xpzf text.tgz

mkdir /mnt/kern /mnt/proc

You might also want to make device entries, its saves several seconds of boot time to not have to run that in an mfs.

fstab:
/dev/wd0a / ffs rw,noatime,nodevmtime 1 1
kernfs /kern kernfs rw
procfs /proc procfs rw,noauto
tmpfs /tmp tmpfs rw

rc.conf:
sshd=YES
hostname=soekris.local
dhclient=YES
dhclient_flags="-q sip0"
savecore=NO
no_swap=YES

Added to gettytab:
Pc.19200|Pc 19200 console:\
:np:sp#19200:ig:ht:

changed in ttys:
console "/usr/libexec/getty Pc.19200" vt100 on secure

Once done configuring, unmount.
umount /mnt
vnconfig -u vnd0

Write it out to the card:
dd if=CF of=/dev/rsd0d


I think I got everything.

mDNS and Zero Conf

Started playing around with multicast DNS on NetBSD to get ZeroConf up and running for local LAN name resolution. This is already happening with my OS X systems. It will just be nice to get the other couple of hosts on this as well.

Supposively there is a Windows version. I'll worry about that after I get the NetBSD stuff up and running.

I'm tackling it with Avahi. Currently it got added to pkgsrc-wip about 3.5 hours before I started to go look for it.


I finally bothered to hook up a ps2 style keyboard to my amd64 system. Maybe I'll be able to capture a traceback on the next panic. (And maybe even a hit as to why the USB keyboard isn't working in ddb.)