Subject: OF < 3 bootblock issue
To: None <port-macppc@netbsd.org>
From: John Klos <john@ziaspace.com>
List: port-macppc
Date: 10/11/2007 17:47:43
Hi,

I have a number of OF 1.0.5 and 2.something machines running with 
partition 0 boot drives. While trying to install another one from scratch, 
I first installed 1.6.2 (since that's the last bootable CD I know about), 
but after using that drive to boot a netbsd-4 installation kernel and 
doing a fresh install of everything, the system (which loaded 1.6.2 and 
the install kernel fine) won't boot:

0 > boot
OF_open bootpath=ata/ATA-Disk@0
read stage 2 blocks: 0123. done!
starting stage 2...
(hangs)

I also tried manually installing the bootblocks:

installboot -v /dev/wd0a /usr/mdec/bootxx /boot (copied from ofwboot)

This was from the netbsd-4 install kernel. An interesting side note is 
that I can neither run installboot from the install kernel properly:

      Status: Command failed
     Command: /usr/sbin/installboot /dev/rwd0a /usr/mdec/bootxx /boot
      Hit enter to continue
--------------------------------------------------------------------------------
installboot: Can't write sector 0 of `/dev/rwd0a': Read-only file system
installboot: Set bootstrap operation failed

Nor can I run installboot from the command line even though nothing is 
mounted:

# installboot -v /dev/rwd0a bootxx /boot
File system:         /dev/rwd0a
File system type:    ffs (blocksize 16384, needswap 0)
Primary bootstrap:   bootxx
Secondary bootstrap: /boot
installboot: Can't write sector 0 of `/dev/rwd0a': Read-only file system
installboot: Set bootstrap operation failed

But I can run installboot if I use wd0a instead of rwd0a:

# installboot -v /dev/wd0a bootxx /boot
File system:         /dev/wd0a
File system type:    ffs (blocksize 16384, needswap 0)
Primary bootstrap:   bootxx
Secondary bootstrap: /boot
Bootstrap start sector: 4
Bootstrap byte count:   1756
Bootstrap block table:  118 entries of 16384 bytes available, 4 used: 13888 13920 13952 5228
Writing bootstrap

Strange, huh?

So if /usr/mdec/ofwboot from netbsd-4 doesn't work as the second stage 
bootloader on macppc for OF < 3, what do I use?

John Klos