Subject: Extra section for Sparc64 INSTALL document
To: None <port-sparc64@netbsd.org, netbsd-docs@netbsd.org>
From: Murray Stokely <murray@osd.bsdi.com>
List: port-sparc64
Date: 11/10/2000 19:04:07
  I wanted to supply a mdocified patch for this but I was unable to
complete it in time (leaving for Comdex tommorow morning).  Anyway,
can someone mdocify this and commit it to the INSTALL document for
sparc64?  The method described here was the ONLY way I was able to
install the 1.5_BETA on my Ultra 5.

Installing NetBSD from Solaris

  If you were unable to install NetBSD with the supplied ramdisk then
it may be possible to complete the installation through Solaris.

* Preparing the disk

The first step is to format and label the disk that you would like to
use with NetBSD. This can be accomplished with the format command in
Solaris. The format command should allow you to create disk slices and
write a disklabel. You will probably at least want to create a root
partition, a swap partition, and a usr partition, but of course you
can layout the disk however you see fit.

partition> pr    
 Current partition table (original):
 Total disk cylinders available: 8186 + 2 (reserved cylinders)

 Part      Tag    Flag     Cylinders        Size            Blocks
   0       root    wm       0 - 1923        1.00GB    (1924/0/0) 2097160
   1       swap    wu    1924 - 2863      500.29MB    (940/0/0)  1024600
   2     backup    wu       0 - 8185        4.25GB    (8186/0/0) 8922740
   3 unassigned    wm       0               0         (0/0/0)          0
   4        usr    wm    2864 - 8184        2.77GB    (5321/0/0) 5799890
   5 unassigned    wm       0               0         (0/0/0)          0
   6     backup    wm       0 - 8185        4.25GB    (8186/0/0) 8922740
   7 unassigned    wm       0               0         (0/0/0)          0

After your disk has been labelled you need to create filesystems on
your slices. The Solaris newfs command will create ffs filesystems
that can be used by NetBSD. You should create filesystems for all of
your slices except for root with a command similar to :

 # newfs /dev/dsk/c1t2d0s0
 # newfs /dev/dsk/c1t2d0s4

* Installing NetBSD Software

You should now mount your NetBSD root and /usr partitions under
Solaris so that you can populate the filesystems with NetBSD binaries.

 # mount /dev/dsk/c1t2d0s0 /mnt
 # mount /dev/dsk/c1t2d0s4 /mnt2

First, you should uncompress all of the binary distribution sets for
sparc64 into a temporary directory and then copy the files into the
filesystems you just mounted.

 $ cd ~/netbsd/binary/sets
 $ gunzip *.tar.gz
 $ mkdir ~/netbsd/temp
 $ cd ~/netbsd/temp
 $ echo ~/netbsd/binary/sets/*.tar | xargs -n1 tar xf
 # cp -rp usr/* /mnt2
 # cp -rp . /mnt
 # mkdir /mnt/usr

Now you should copy the NetBSD kernel and second stage bootloader into
your new NetBSD root partition and install the bootblocks using
Solaris's installboot command.

 # cp ~/netbsd/binary/kernel/netbsd.GENERIC /mnt
 # cp /mnt/netbsd.GENERIC /mnt/netbsd
 # cp ~/netbsd/installation/misc/ofwboot /mnt
 # installboot ~/netbsd/installation/misc/bootblk /dev/c1t2d0s0

* Creating NetBSD Device Nodes under Solaris

Now you will need to create a minimum set of device nodes so that
NetBSD can boot correctly. You should create all of the devices listed
in the 'std' section of NetBSD's /dev/MAKEDEV. You can use the Solaris
version of mknod to create device nodes but you must be careful to use
numeric group id's since the groups are numbered differently between
the two systems.

 # mknod console           c 0 0
 # mknod tty               c 2 0   ; chmod 666 tty
 # mknod kmem              c 3 1   ; chmod 640 kmem ; chgrp 2 kmem
 # mknod mem               c 3 0   ; chmod 640 mem ; chgrp 2 mem
 # mknod null              c 3 2   ; chmod 666 null
 # mknod zero              c 3 12  ; chmod 666 zero
 # mknod eeprom            c 3 11  ; chmod 640 eeprom ; chgrp 2 eeprom
 # mknod openprom          c 70 0  ; chmod 640 openprom;chgrp 2 openprom
 # mknod drum              c 7 0   ; chmod 640 drum ; chgrp 2 drum
 # mknod klog              c 16 0  ; chmod 600 klog
 # mknod stdin             c 24 0  ; chmod 666 stdin
 # mknod stdout            c 24 1  ; chmod 666 stdout
 # mknod stderr            c 24 2  ; chmod 666 stderr
 # mknod fb                c 22 0  ; chmod 666 fb
 # mknod mouse             c 13 0  ; chmod 666 mouse
 # mknod kbd               c 29 0  ; chmod 666 kbd

You also must create device nodes for the disk devices that you are installing NetBSD onto, again you can use NetBSD's
/dev/MAKEDEV as a reference.

 # mknod sd0a              b 7 0
 # mknod sd0b              b 7 1
 # mknod sd0c              b 7 2
 # mknod sd0d              b 7 3
 # mknod sd0e              b 7 4
 # mknod sd0f              b 7 5
 # mknod sd0g              b 7 6
 # mknod sd0h              b 7 7
 # mknod sd1a              b 7 8
 # mknod sd1b              b 7 9
 # mknod sd1c              b 7 10
 # mknod sd1d              b 7 11
 # mknod sd1e              b 7 12
 # mknod sd1f              b 7 13
 # mknod sd1g              b 7 14
 # mknod sd1h              b 7 15
 # mknod rsd0a             c 17 0
 # mknod rsd0b             c 17 1
 # mknod rsd0c             c 17 2
 # mknod rsd0d             c 17 3
 # mknod rsd0e             c 17 4
 # mknod rsd0f             c 17 5
 # mknod rsd0g             c 17 6
 # mknod rsd0h             c 17 7
 # mknod rsd1a             c 17 8
 # mknod rsd1b             c 17 9
 # mknod rsd1c             c 17 10
 # mknod rsd1d             c 17 11
 # mknod rsd1e             c 17 12
 # mknod rsd1f             c 17 13
 # mknod rsd1g             c 17 14
 # mknod rsd1h             c 17 15
 # chgrp 5 *sd[0-1][a-h]
 # chmod 640 *sd[0-1][a-h]

* Configuring the NetBSD system (still under Solaris)

You will now need to configure some of the files in /mnt/etc to allow
the system to work properly. In particular, you will need to modify
/etc/rc.conf or else you will only get to single user mode. Read
through the examples in /etc/defaults/rc.conf and override any
settings in /etc/rc.conf. You will also need to create a /etc/fstab
file to tell the system which slice to mount as /usr, etc. You should
follow the examples in /etc/fstab.wd or /etc/fstab.sd depending on
whether you are using IDE or SCSI disks. You may also want to setup
your /etc/resolv.conf file for name services and your /etc/hosts file
if you are confident that you will get networking setup on your first
try.

* Booting into NetBSD

You should now be able to reboot. When you are prompted for a root
device, specify sd1a or whichever disk/slice you used up to this
point. Hit enter for the remaining two choices and you should
eventually find yourself at a login prompt. The login name is of
course 'root' and there is no passwd yet.


	- Murray