1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
|
Installing OpenBSD is a relatively complex process, but if you have
this document in hand it shouldn't be too much trouble.
There are several ways to install OpenBSD onto a disk. The easiest way
in terms of preliminary setup is to use the OpenBSD miniroot that can
be booted off your local disk's swap partition. Alternatively, if your
Sparcstation is hooked up in a network you can find a server and arrange
for a diskless setup which is a convenient way to install on a machine
whose disk does not currently hold a usable operating system (see the
section `Installing using a diskless setup' below).
Installing using the OpenBSD miniroot.
The miniroot is a self-contained OpenBSD filesystem holding all utilities
necessary to install OpenBSD on a local disk. It is distributed as a plain
file designed to be transferred to a raw disk partition from which it can
be booted using the appropriate PROM command. Usually, the miniroot will
be loaded into the swap partition of a disk. If needed, you can use any
other unused partition, but remember that the partition will then not
available during the installation process.
Loading the miniroot onto your raw partition is simple. On OpenBSD as well
as SunOS you use a command like:
# dd if=miniroot20.fs of=/dev/rsd0b bs=20b conv=sync
(here `/dev/rsd0b' is assumed to be your swap partition). There's a
potential problem here if /dev/rsd0b is actually in use as a swap
partition by your currently running system. If you don't have another
disk or partition to spare, you can usually get away with running this
command anyway after first booting into single-user mode to ensure a
quiet system.
After transferring the miniroot to disk, bring the system down by:
# halt
Then boot the miniroot by typing the appropriate command at the PROM:
> b sd(,,1)bsd -s # for sun4 monitors
ok boot sd(,,1)bsd -s # for version 1 OpenBOOT ROMs
ok boot disk:b bsd -s # for version 2 OpenBOOT ROMs
If you've loaded the miniroot onto some other disk than `sd0' adapt
the boot specifier accordingly, e.g.:
ok boot disk1:b bsd -s
to boot from SCSI disk target 1 from a version 2 OpenBOOT ROM.
This will cause the kernel contained in the miniroot to be booted.
After the initial probe messages you'll asked to start the install
or upgrade procedure. Proceed to the section `Running the installation
scripts' below.
Installing using a diskless setup.
First, you must setup a diskless client configuration on a server. If
you are using a OpenBSD system as the boot-server, have a look at the
diskless(8) manual page for guidelines on how to proceed with this.
If the server runs another operating system, you'll have to consult
documentation that came with it (on SunOS systems, add_client(8) is a
good start).
Your Sparcstation expects to be able to download a second stage bootstrap
program via TFTP after having acquired its IP address through RevARP when
instructed to boot "over the net". It will look for a filename composed of
the machine's IP address followed by the machine's architecture, separated
by a period. For example, a sun4c machine which has been assigned IP
address 130.115.144.11, will make an TFTP request for `8273900B.SUN4C'.
Normally, this file is a symbolic link to an appropriate second-stage
boot program, which should be located in a place where the TFTP daemon
can find it (remember, many TFTP daemons run in a chroot'ed environment).
You can find the boot program in `/usr/mdec/boot' in the OpenBSD/sparc
distribution. Unfortunately, it is necessary to install this file
differently for sun4 and sun4c clients: the sun4 version needs to have its
`a.out' header stripped off (otherwise the machine will crash), while the
sun4c version must retain it (otherwise the PROM will complain).
Here's an example to illustrate this whole mess:
server# cd /<client-root-dir>/usr/mdec
if client is a sun4:
server# set SKIP=1
server# set KARCH=SUN4
else
server# set SKIP=0
server# set KARCH=SUN4C
server# dd if=boot of=/tftpboot/boot.sparc.OpenBSD.$KARCH skip=$SKIP bs=32
server# cd /tftpboot
server# ln -s boot.sparc.OpenBSD.$KARCH 8273900B.$KARCH
Note: some versions of Openboot ROMs (sun4c/sun4m) seem to require that the
boot program size is nicely rounded. Therefore it may be necessary to
strip(8) off the symbol table.
After the boot program has been loaded into memory and given control by
the PROM, it starts locating the machine's remote root directory through
the BOOTPARAM protocol. First a BOOTPARAM WHOAMI request is broadcast
on the local net. The answer to this request (if it comes in) contains
the client's name. This name is used in next step, a BOOTPARAM GETFILE
request -- sent to the server that responded to the WHOAMI request --
requesting the name and address of the machine that will serve the client's
root directory, as well as the path of the client's root on that server.
Finally, this information (if it comes in) is used to issue a REMOTE MOUNT
request to the client's root filesystem server, asking for an NFS file
handle corresponding to the root filesystem. If successful, the boot
rogram starts reading from the remote root filesystem in search of the
kernel which is then read into memory.
As noted above in the section `Preparing your System for OpenBSD Installation',
you have several options when choosing a location to store the installation
filesets. However, the easiest way is to put the *.tar.gz files you want
to install into the root directory for your client on the server.
Next, unpack `base.tar.gz' and `etc.tar.gz' on the server in the root
directory for your machine. If you elect to use a separately NFS-mounted
filesystem for `/usr' with your diskless setup, make sure the "./usr" base
files in base.tar.gz end up in the correct location. One way to do this is
to temporarily use a loopback mount on the server, re-routing <root>/usr to
your server's exported OpenBSD "/usr" directory. Also put the kernel and the
install/upgrade scripts into the root directory.
A few configuration files need to be edited:
<root>/etc/hosts
Add the IP addresses of both server and client.
<root>/etc/myname
This files contains the client's hostname; use the same
name as in <root>/etc/hosts.
<root>/etc/fstab
Enter the entries for the remotely mounted filesystems.
For example:
server:/export/root/client / nfs rw 0 0
server:/export/exec/sun4.OpenBSD /usr nfs rw 0 0
Now you must populate the the `/dev' directory for your client. If you server
runs SunOS 4.x, you can simply change your working directory to `<root>/dev'
and run the MAKEDEV script: `sh MAKEDEV all'.
On SunOS 5.x systems, MAKEDEV can also be used, but there'll be error
messages about unknown user and groups. These errors are inconsequential
for the purpose of installing OpenBSD. However, you may want to correct them
if you plan to the diskless setup regularly. In that case, you may re-run
MAKEDEV on your OpenBSD machine once it has booted.
Boot your workstation from the server by entering the appropriate `boot'
command at the monitor prompt. Depending on the PROM version in your machine,
this command takes one of the following forms:
> b le()bsd -s # for sun4 monitors
ok boot le()bsd -s # for version 1 OpenBOOT ROMs
ok boot net bsd -s # for version 2 OpenBOOT ROMs
This will boot the OpenBSD kernel in single-user mode.
[[
NOTE: the latter two examples assume you operate the OpenBOOT ROM in
"new command mode". If your machine comes up and gives you a `>' prompt
instead of `ok', type:
>n # enter native OpenBOOT mode
ok setenv sunmon-compat? false # make it permanent
ok
]]
If you use a diskless setup with a separately NFS-mounted /usr filesystem,
mount /usr by hand now:
OpenBSD# mount /usr
At this point, it's worth checking the disk label and partition sizes on
the disk you want to install OpenBSD onto. OpenBSD understands SunOS-style
disklabels, so if your disk was previously used by SunOS there will be
a usable label on it. Use `disklabel -e <disk>' (where <disk> is the
device name assigned by the OpenBSD kernel, e.g. `sd0') to view and
modify the partition sizes. See the section `Preparing your System for
OpenBSD Installation' above for suggestions about disk partition sizes.
Make sure all your partitions start and end on cylinder boundaries.
NOTE: if you are installing on a SCSI disk that does *not* have a SunOS
or OpenBSD label on it, you may still be able to use disklabel(8) but you'll
have to create all partitions from scratch. If your disk is listed in
`/etc/disktab', you may use the entry (which in most cases only defines
a `c' partition to describe the whole disk) to put an initial label on
the disk. DO NOT USE `disklabel -r ...' TO INITIALIZE YOUR DISK LABEL;
THIS WILL LEAD TO UNPREDICTABLE RESULTS. This deficiency will be fixed
in a next release.
Here follows an example of what you'll see while in the dislabel editor.
Do not touch any of the parameters except for the `label: ' entry and
the actual partition size information at the bottom (the lines starting
with `a:', `b:', ...).
The size and offset fields are given in sector units. Be sure to make
these numbers multiples of the of the number of sectors per cylinder:
the kernel might be picky about these things, but aside from this you'll
have the least chance of wasting disk space.
Partitions on which you intend to have a mountable filesystem, should
be given fstype `4.2BSD'. Remember, the `c' partition should describe
the whole disk.
The `(Cyl. x - y)' info that appears after the hash (`#') character is
treated as a comment and need not be filled in when altering partitions.
Special note: the line containing `16 partitions:' is best left alone,
even if you define less then eight partitions. If this line displays
a different number and the program complains about it (after you leave
the editor), then try setting it to `16 partitions:'.
<BEGIN SAMPLE DISKLABEL SCREEN>
OpenBSD# disklabel sd2
# /dev/rsd2c:
type: SCSI
disk: SCSI disk
label: Hold Your Breath
flags:
bytes/sector: 512
sectors/track: 64
tracks/cylinder: 7
sectors/cylinder: 448
cylinders: 1429
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0 # milliseconds
track-to-track seek: 0 # milliseconds
drivedata: 0
16 partitions:
# size offset fstype [fsize bsize cpg]
a: 50176 0 4.2BSD 0 0 0 # (Cyl. 0 - 111)
b: 64512 50176 swap # (Cyl. 112 - 255)
c: 640192 0 unknown # (Cyl. 0 - 1428)
d: 525504 114688 4.2BSD 0 0 0 # (Cyl. 256 - 1428)
<END SAMPLE DISKLABEL SCREEN>
If you are upgrading a OpenBSD installation, start the upgrade script:
OpenBSD# sh upgrade.sh
else, start the installation script:
OpenBSD# sh install.sh
These scripts will do most of the work of transferring the system from the
tar files onto your disk. You will frequently be asked for confirmation
before the script proceeds with each phase of the installation process.
Occasionally, you'll have to provide a piece of information such as the
name of the disk you want to install on or IP addresses and domain names
you want to assign. If your system has more than one disk, you may want
to look at the output of the dmesg(8) command to see how your disks
have been identified by the kernel.
The installation script goes through the following phases:
- determination of the disk to install OpenBSD on
- checking of the partition information on the disk
- creating and mounting the OpenBSD filesystems
- setup of IP configuration
- extraction of the distribution tar files
- installation of boot programs
Now try a reboot. (If needed, swap your scsi id's first). Initially
I'd suggest you "boot sd()bsd -bs", then try multiuser after that.
if you boot single-user the OpenBSD incantation to make the root
filesystem writable is
OpenBSD# mount -u /dev/sd0a /
The Sun monitor normally tries to load a file called "vmunix". On
OpenBOOT ROM systems you can change it to load OpenBSD instead using
the following commands:
On version 1 OpenBOOT ROMs:
>n
ok setenv boot-from sd(0,0,0)bsd
ok
On version 2 OpenBOOT ROMs:
ok setenv boot-file bsd
ok setenv boot-device /sbus/esp/sd@0,0
Congratulations, you have successfully installed OpenBSD 2.0. When you
reboot into OpenBSD, you should log in as "root" at the login prompt.
There is no initial password, but if you're using the machine in a
networked environment, you should create yourself an account and
protect it and the "root" account with good passwords.
Some of the files in the OpenBSD 2.0 distribution might need to be
tailored for your site. In particular, the /etc/sendmail.cf file will
almost definitely need to be adjusted, and other files in /etc will
probably need to be modified. If you are unfamiliar with UN*X-like
system administration, it's recommended that you buy a book that
discusses it.
Installing from SunOS.
You need a SunOS machine to install OpenBSD. You also need at
least the following pieces:
the *.tar.gz files you want to install (as a minimum, base.tar.gz)
gzip (GNU gzip) SunOS binary
gtar (GNU tar) SunOS binary
the "install.sh" script
a "/boot" file from a SunOS machine that matches your machine type
(e.g. sun or sun4c)
a kernel, most likely "/bsd"
All these pieces, except "/boot", are supplied in the OpenBSD/sparc
distribution.
You need to format and partition the disk using SunOS (since
OpenBSD/sparc uses SunOS disk labels.) Give yourself adequate
partition sizes. Here is an example layout:
partition size offset will be..
sd2a 28140 0 /
sd2b 16170 28140 swap
sd2c 204540 0 `whole disk'
sd2g 160230 44310 /usr
BTW, These are not recommended sizes. They simply match the first
(tiny) disk that OpenBSD/sparc ran on.
Use SunOS to newfs the partitions which will have filesystems on them.
(OpenBSD's filesystem format is identical to SunOS).
sunos# newfs /dev/rsd2a
[... lots of output]
sunos# newfs /dev/rsd2g
[... lots of output]
NOTE: If you are able to, there is a performance benefit from
newfs'ing using OpenBSD. If you newfs using the OpenBSD newfs command,
be sure to use the -O flag for your / partition, so that newfs will
use the 4.3BSD filesystem format, rather than the new 4.4BSD filesystem
format. If you forget, you will not be able to boot -- the SunOS boot
blocks do not understand the extended 4.4BSD filesystem format.
Mount those partitions in a tree formation, under /mnt; ie:
sunos# df
Filesystem kbytes used avail capacity Mounted on
[...]
/dev/sd2a 11501 0 11501 0% /mnt
/dev/sd2g 179529 0 179529 0% /mnt/usr
Place a standard SunOS "/boot" program in /mnt (your new root
partition), and use the SunOS command "installboot" to make it work.
The installboot man page says to do something like this:
sunos# cp /boot /mnt/boot
sunos# /usr/mdec/installboot -vlt /mnt/boot /usr/mdec/bootsd /dev/rsd2a
You can now extract the provided "*.tar.gz files onto your disk. The
provided script, "install_from_sunos.sh" will help you:
sunos# ls -FC
base.tar.gz etc.tar.gz man.tar.gz secr.tar.gz
comp.tar.gz games.tar.gz misc.tar.gz text.tar.gz
install.sh bsd.id3_scsi
sunos# ./install_from_sunos.sh
[...]
This script NEEDS gzip and gtar (GNU gzip and GNU tar) on your
execution path! The tar files are in a "new format" that includes
directory information, and SunOS tar will not read them. Statically
linked versions of these programs for SunOS are supplied in the
distribution.
After the files have been extracted, repair /mnt/etc/fstab to match
your actual disk layout. (Minus the "/mnt" component of each path, of
course :-)
Now proceed to reboot the machine as described above in "Installing
using a diskless setup".
|