Last Update: "2007/04/16 09:39:54 makoto"

20060527

初めて NetBSD/macppc を入れるという場合を以下に書いています。 20060527ts を使って、新しく NetBSD/macppc を入れて見ます。

以下に書いているのは、 2006/06/10 に作業した時のもので、次のような条件の場合です。

良く理解出来ない問題があって、ここの情報は未完です。

boot cd

boot cd を作っておきます。 ftp://ftp.ki.nu/pub/NetBSD/snapshot/20060527ts/ macppccd.iso は src 付のため大きいです。
sudo cdrecord -v speed=4 dev=15,1,0 -data macppccd.iso

OF

シリアル線をつないでおきます(Stealth G4 とか)。 なくても画面でも出来るのですが、記録を採るのに不便なので、 可能ならそちらを使います。

それで Commmand + Option + O + F で OF の入力待にして、次のようにして起動します。

ok
0 >  boot cd:,ofwboot.elf
   ...
Loading ELF

>> NetBSD/macppc OpenFirmware Boot, Revision 1.5
>> (root@mini, Tue Jun  6 02:36:59 JST 2006)
open /netbsd: No such file or directory
open /netbsd.gz: No such file or directory
6898980 ..
これで入力待になった時に端末の速度が 38.4k に変るので、文字が化けますが 速度の方を合せます。s と入力して Shell を選択します。
(I)nstall, (S)hell or (H)alt ? s
# 
何故か以下の緑の部分の方法はうまく行かなかったので、読むだけにして下さい。 ここで pdisk を使って手動で区画をします。

pdisk

最初は次のようになっているはずです。
# pdisk /dev/wd0c
Edit /dev/wd0c -
Command (? for help): P

Partition map (with 512 byte blocks) on '/dev/wd0c'
 #:                type name              length   base     ( size )
 1: Apple_partition_map Apple                 63 @ 1       
 2:    Apple_Driver_ATA*Macintosh             64 @ 64      
 3:    Apple_Driver_ATA*Macintosh             64 @ 128     
 4:       Apple_Patches Patch Partition      512 @ 192     
 5:           Apple_HFS MacOS           20028246 @ 704      (  9.6G)
 6:          Apple_Free Extra                 10 @ 20028950

Device block size=512, Number of Blocks=20028960 (9.6G)
DeviceType=0x0, DeviceId=0x0
Drivers-
1:  20 @ 64, type=0x701
2:  33 @ 128, type=0xf8ff

Command (? for help): 
ここで d 5 と入力して、5 番を消します。次に
Command (? for help): C 5p   16384 ofwboot Apple_HFS
と入力します。その後に続けて、結局次のように入力します。 (最後の かっこ内の文字は入力しません) 間に P と入力すれば、その時の状態を表示します。
Command (? for help): C 5p    16384 ofwboot Apple_HFS
Command (? for help): C 6p  1024000 Root    Apple_UNIX_SVR2   (a)
Command (? for help): C 7p  2048000 swap    Apple_UNIX_SVR2   (b)
Command (? for help): C 8p  4096000 User    Apple_UNIX_SVR2   (g)
Command (? for help): C 9p 12843872 Export  Apple_UNIX_SVR2   (g)
実際には、その毎に次のように聞いて来るので、( ) 内の a b g 等を入力します。 最後の 9p の後の数字は、P で表示した Free の大きさをそのまま使っています (つまり計算はしていません)。
Available partition slices for Apple_UNIX_SVR2:
  a   root partition
  b   swap partition
  c   do not set any bzb bits
  g   user partition
Other lettered values will create user partitions
Select a slice for default bzb values: a 
これで P と入力すると、次のようになります。
Partition map (with 512 byte blocks) on '/dev/wd0c'
 #:                type name              length   base     ( size )
 1: Apple_partition_map Apple                 63 @ 1       
 2:    Apple_Driver_ATA*Macintosh             64 @ 64      
 3:    Apple_Driver_ATA*Macintosh             64 @ 128     
 4:       Apple_Patches Patch Partition      512 @ 192     
 5:           Apple_HFS ofwboot            16384 @ 704      (  8.0M)
 6:     Apple_UNIX_SVR2 Root             1024000 @ 17088    (500.0M) S0 RUFS k0  /
 7:     Apple_UNIX_SVR2 swap             2048000 @ 1041088  (1000.0M) S1  SFS k0  (swap)
 8:     Apple_UNIX_SVR2 User             4096000 @ 3089088  (  2.0G) S2  UFS k0  /usr
 9:     Apple_UNIX_SVR2 Export          12843872 @ 7185088  (  6.1G) S2  UFS k0  /usr
pdisk の help は次のように表示されます。
Command (? for help): ?
Notes:
  Base and length fields are blocks, which vary in size between media.
  The base field can be p; i.e. use the base of the nth partition.
  The length field can be a length followed by k, m, g or t to indicate
  kilo, mega, giga, or tera bytes; also the length can be p; i.e. use
  the length of the nth partition.
  The name of a partition is descriptive text.

Commands are:
  C    (create with type also specified)
  c    create new partition (standard unix root)
  d    delete a partition
  h    help
  i    initialize partition map
  n    (re)name a partition
  P    (print ordered by base address)
  p    print the partition table
  q    quit editing
  r    reorder partition entry in map
  s    change size of partition map
  t    change a partition's type
  w    write the partition table
最後に w で書いて q で終了します。
Command (? for help): w
Writing the map destroys what was there before. Is that okay? [n/y]: y
Command (? for help): q
ここで再起動して区画表を読み直します。また速度が一度 57,600 に戻ります。
# reboot
rebooted by root
syncing disks... done
unmounting file systems... done
rebooting
ここから sysinst を起動して通常作業をします。
  1. a: Installation messages in English
 We now have your BSD-disklabel partitions as:
 This is your last chance to change them.
    
    Start  MB   End  MB  Size  MB FS type    Newfs Mount Mount point
    --------- --------- --------- ---------- ----- ----- -----------
>a:         4       515       512 FFSv1            
 b:       516      1539      1024 swap
 c:         0      9778      9779 Whole disk
 d:         0         3         4 HFS
 e:      1540      4099      2560 FFSv1            
 f:      4100      9778      5679 FFSv1            
 g:         0         0         0 unused
 h: Show all unused partitions
 i: Change input units (sectors/cylinders/MB)
 x: Partition sizes ok
mount point を / /usr 等に変更します。 Newfs の行を Yes に変更します。
 We now have your BSD-disklabel partitions as:
 This is your last chance to change them.
    
    Start  MB   End  MB  Size  MB FS type    Newfs Mount Mount point
    --------- --------- --------- ---------- ----- ----- -----------
 a:         4       515       512 FFSv1      Yes   Yes   /
 b:       516      1539      1024 swap
 c:         0      9778      9779 Whole disk
 d:         0         3         4 HFS
 e:      1540      4099      2560 FFSv1      Yes   Yes   /usr
>f:      4100      9778      5679 FFSv1      Yes   Yes   /export
 g:         0         0         0 unused
 h: Show all unused partitions
 i: Change input units (sectors/cylinders/MB)
 x: Partition sizes ok
X11 は CDROM に入っていないので、外しておきます。
 Please enter a name for your NetBSD disk [WDC-WD102BA]: 
次のように言われるのは問題ないので無視します。
    Status: Command failed
    Command: /usr/sbin/installboot /dev/rwd0a /usr/mdec/bootxx /boot
     Hit enter to continue
--------------------------------------------------------------------------------
installboot: `/usr/mdec/bootxx' cannot be larger than 2048 bytes
installboot: Set bootstrap operation failed
     Status: Finished
    Command: /bin/sh MAKEDEV all
     Hit enter to continue
--------------------------------------------------------------------------------
MAKEDEV: openfirm: unknown device
MAKEDEV: pci0: unknown device
MAKEDEV: pci1: unknown device
MAKEDEV: pci2: unknown device
MAKEDEV: pci3: unknown device
MAKEDEV: pci4: unknown device
MAKEDEV: pci5: unknown device
MAKEDEV: pci6: unknown device
MAKEDEV: pci7: unknown device
MAKEDEV: bktr0: unknown device
MAKEDEV: bktr1: unknown device
MAKEDEV: radio0: unknown device
MAKEDEV: radio1: unknown device
MAKEDEV: kttcp: unknown device
MAKEDEV: clockctl: unknown device
# reboot
rebooted by root
syncing disks... done
unmounting file systems... done
rebooting


Apple PowerMac3,1 2.2f1 BootROM built on 01/28/00 at 17:54:48
Copyright 1994-2000 Apple Computer, Inc.
All Rights Reserved.

Welcome to Open Firmware.
To continue booting, type "mac-boot" and press return.
To shut down, type "shut-down" and press return.

 ok
0 > boot cd:,ofwboot hd:6/netbsd
ところが、次のようになってしまって起動しない
0 > boot cd:,ofwboot.elf load-size=d440 adler32=5274b9f9 

Loading ELF

>> NetBSD/macppc OpenFirmware Boot, Revision 1.5
>> (root@mini, Tue Jun  6 02:36:59 JST 2006)
open /pci@f2000000/pci-bridge@d/mac-io@7/ata-4@1f000/@0:6/netbsd: No such file or directory
Boot: exit
EXIT called ok
0 > 
netbsd ありますよ..
# df 
Filesystem  512-blocks      Used     Avail Capacity  Mounted on
/dev/md0a         3887      3454       433    88%    /
# mount /dev/wd0a /mnt
# ls -l /mnt/netbsd
-rwxr-xr-x  1 root  wheel  5365130 Jun  5  2006 /mnt/netbsd
# 
hd:6 netbsd と指定すると間がなく open hd:6: No such file or directory
しかし
hd:6/netbsd と指定するとしばらく考えて、open hd:6/netbsd: No such file or directory と言う。