Subject: Booting NetBSD from a CD-ROM - OpenBOOT How-To (hint: good install
To: None <port-sparc@netbsd.org>
From: Brian A. Seklecki <lavalamp@burghcom.com>
List: port-sparc
Date: 08/08/2001 18:59:58
This isn't documented anywhere, aka:

http://www.netbsd.org/Documentation/bootcd.html#sparcimage

...or the Install DOC...yet the question is common, so for the sake of
mailing list archiving, here we go:


--

If you download a NetBSD/SPARC ISO image from one of the sources at the
website:

http://www.netbsd.org/Sites/cdroms.html#iso

...and burn it to media, the CD should be bootable under the following
OpenBOOT circumstances:


*) your 'boot-file' variable is set to 'netbsd'

- From the OpenBOOT # prompt, type: "setenv boot-file netbsd"

*) your 'boot-device' variable is set to 'cdrom' which...

- From the OpenBOOT # prompt type: "setenv boot-device cdrom"

*) ...is a proper devalias to the OpenBOOT device path of you CD-ROM and..

- OpenBOOT is quality software.  It provides no way to delete/change the
default device aliases, only override them (if someone knows how, please,
speak up - Sun claims that it's not possible in the OpenBOOT 3 reference).
Type "devalias" to see the default device aliases.

On a SparcStation LX with an ESPDMA SCSI controller running an older
OpenBOOT revision:

"cdrom" defaults to "/iommu/sbus/espdma@4,8400000/esp@4,8800000/sd@6,0:d"

If your CD-ROM is not on ID 6, you can do one of two things

"devalias cdrom [proper OpenBOOT device path]"

This will create a temporary device alias that will override the system
default.  This alias will be erased at power-off.

Or you can use the 'nvram' which is basically a buffer of commands to
execute when the OpenBOOT intializes:

"setenv use-nvramrc? true"

Then:

"nvalias cdrom [path to device]"

Assume your CD-ROM is at ID5:

"devalias cdrom /iommu/sbus/espdma@4,8400000/esp@4,8800000/sd@5,0:d"

*** NOTE: It's very important that you append the ":d" slice/partition
when booting from a CD-ROM device.  This applies for Solaris and NetBSD.

Then:

"nvstore"

...will put drop a "devalias cdrom [path to device]" into the nvram
buffer.  You can use the 'nvedit' command at a later date to change the
nvram buffer. Once in edit mode, do a "ctrl+u" to delete the line.  Then
"ctrl+k" several times to make sure the buffer is completly empty.

*) ...that CD-ROM supports 512 byte sectors (SUN standard)

- See your owners manual.  Some CD-ROMs have a jumper labeled "UNIX" on
the back.

At reboot, you will see

------------
# reset
Resetting ...
cdrom isn't unique
cdrom isn't unique

SPARCstation LX, No Keyboard
ROM Rev. 2.9, 32 MB memory installed, Serial #174481.
Ethernet address 8:0:20:5:24:91, Host ID: 8002a991.

Boot device: /iommu/sbus/espdma@4,8400000/esp@4,8800000/sd@5,0:d   File
and args: netbsd
>> NetBSD/sparc Secondary Boot, Revision 1.9

------------

Once your installation is complete, you will need to set your
"boot-device" back to "disk".

If you decide to ever install Solaris again, you will simply need to
change your boot-file variable back to "unix" or "vmunix":

------------

ok setenv boot-file vmunix
boot-file =           vmunix
ok boot cdrom
Resetting ...
cdrom isn't unique
cdrom isn't unique

SPARCstation LX, No Keyboard
ROM Rev. 2.9, 32 MB memory installed, Serial #174481.
Ethernet address 8:0:20:5:24:91, Host ID: 8002a991.

Rebooting with command: cdrom
Boot device: /iommu/sbus/espdma@4,8400000/esp@4,8800000/sd@5,0:d   File
and args: vmunix
SunOS Release 5.7 Version Generic_106541-08 [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1999, Sun Microsystems, Inc.

------------

--Brian

 ----

"GNU/Linux: About as stable as the elements at the bottom of the periodic
table"