Subject: Re: upgrading bootblocks
To: None <port-macppc@NetBSD.org>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: port-macppc
Date: 12/13/2004 19:56:43
In article <041213192413.M0129774@mirage.ceres.dti.ne.jp>
I wrote:

> "cp /usr/mdec/ofwboot / && installboot /dev/rwd0c /usr/mdec/bootxx /ofwboot"
> works fine if sync'ed bootxx and ofwboot are installed in /usr/mdec.

Hmm, it should be:
"cp /usr/mdec/ofwboot / && sync && \
 installboot -v /dev/rwd0c /usr/mdec/bootxx /ofwboot"
---
Izumi Tsutsui
tsutsui@ceres.dti.ne.jp


# cd /usr/src/sys/arch/macppc/compile/stand
# make cleandir
 :
# make dependall
dependall ===> bootxx
#    create  bootxx/bootxx.d
CC=/usr/tools/powerpc/bin/powerpc--netbsd-gcc \
/usr/tools/powerpc/bin/nbmkdep -f bootxx.d --      \
-D_STANDALONE -DPPC_OEA  -nostdinc -isystem /usr/include   \
/usr/src/sys/arch/macppc/stand/bootxx/bootxx.c
 :
#      link  ofwboot/ofwboot
/usr/tools/powerpc/bin/powerpc--netbsd-ld -s -N -Ttext E00000\
 -Bstatic -o ofwboot.el1  Locore.o boot.o ofdev.o hfs.o net.o \
netif_of.o alloc.o vers.o ofwmagic.o byteorder.o \
/usr/src/sys/arch/macppc/stand/ofwboot/obj.macppc/lib/sa/libsa.a \
/usr/src/sys/arch/macppc/stand/ofwboot/obj.macppc/lib/z/libz.a \
/usr/src/sys/arch/macppc/stand/ofwboot/obj.macppc/lib/kern/libkern.a
/usr/tools/powerpc/bin/powerpc--netbsd-objcopy -O binary ofwboot.el1 ofwboot
 :
# make install
install ===> bootxx
#   install  /usr/mdec/bootxx
STRIP=/usr/tools/powerpc/bin/powerpc--netbsd-strip \
/usr/tools/powerpc/bin/nbinstall  -N /usr/src/etc -c  \
-r -o root -g wheel -m 444    bootxx /usr/mdec/bootxx
install ===> ofwboot
#   install  /usr/mdec/ofwboot
STRIP=/usr/tools/powerpc/bin/powerpc--netbsd-strip \
/usr/tools/powerpc/bin/nbinstall  -N /usr/src/etc -c  \
-r -o root -g wheel -m 444    ofwboot /usr/mdec/ofwboot
#   install  /usr/mdec/ofwboot.elf
STRIP=/usr/tools/powerpc/bin/powerpc--netbsd-strip \
/usr/tools/powerpc/bin/nbinstall  -N /usr/src/etc -c  \
-r  -o root  -g wheel  -m 444   ofwboot.elf /usr/mdec/ofwboot.elf
#   install  /usr/mdec/ofwboot.xcf
STRIP=/usr/tools/powerpc/bin/powerpc--netbsd-strip \
/usr/tools/powerpc/bin/nbinstall  -N /usr/src/etc -c  \
-r  -o root  -g wheel  -m 444   ofwboot.xcf /usr/mdec/ofwboot.xcf
# cd /
# cp /usr/mdec/ofwboot / && installboot -v /dev/rwd0c /usr/mdec/bootxx /ofwboot
File system:         /dev/rwd0c
File system type:    ffs (blocksize 8192, needswap 0)
Primary bootstrap:   /usr/mdec/bootxx
Secondary bootstrap: /ofwboot
installboot: Secondary bootstrap `ofwboot' is empty
installboot: Set bootstrap operation failed
# sync
# cp /usr/mdec/ofwboot / && sync && installboot -v /dev/rwd0c /usr/mdec/bootxx /ofwboot
File system:         /dev/rwd0c
File system type:    ffs (blocksize 8192, needswap 0)
Primary bootstrap:   /usr/mdec/bootxx
Secondary bootstrap: /ofwboot
Bootstrap start sector: 4
Bootstrap byte count:   1732
Bootstrap block table:  118 entries of 8192 bytes available, 7 used: 15696 15712 15728 15744 15760 15776 546
Writing bootstrap
# reboot
Dec 13 19:36:17 reboot: rebooted by root
syncing disks... done
unmounting file systems... done
rebooting


Open Firmware, 2.0
To continue booting the MacOS type:
BYE<return>
To continue booting from the default boot device type:
BOOT<return>
 ok
0 > boot 
OF_open bootpath=ata/ATA-Disk@0
read stage 2 blocks: 0123456. done!
starting stage 2...

>> NetBSD/macppc OpenFirmware Boot, Revision 1.10
>> (root@, Mon Dec 13 18:35:08 JST 2004)
Cannot use bootpath
Using boot-device instead
3493300+280956 [183152+167127]=0x3ef2cc
 start=0x100000
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 2.99.11 (LANCER) #1128: Sun Dec 12 18:01:48 JST 2004
	tsutsui@mirage:/usr/src/sys/arch/macppc/compile/LANCER
total memory = 65536 KB
avail memory = 58224 KB
 :