2002-04-22 21:17:35 +04:00
|
|
|
.\" $NetBSD: installboot.8,v 1.10 2002/04/22 17:17:36 lukem Exp $
|
2002-04-03 09:21:16 +04:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
.\" by Luke Mewburn of Wasabi Systems.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by the NetBSD
|
|
|
|
.\" Foundation, Inc. and its contributors.
|
|
|
|
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
|
|
.\" contributors may be used to endorse or promote products derived
|
|
|
|
.\" from this software without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
2002-04-22 21:17:35 +04:00
|
|
|
.Dd April 23, 2002
|
2002-04-03 09:21:16 +04:00
|
|
|
.Dt INSTALLBOOT 8
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm installboot
|
|
|
|
.Nd install disk bootstrap software
|
|
|
|
.
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm ""
|
2002-04-04 11:27:44 +04:00
|
|
|
.Op Fl nv
|
2002-04-03 09:21:16 +04:00
|
|
|
.Bk -words
|
|
|
|
.Op Fl m Ar machine
|
|
|
|
.Ek
|
|
|
|
.Bk -words
|
|
|
|
.Op Fl o Ar options
|
|
|
|
.Ek
|
|
|
|
.Bk -words
|
|
|
|
.Op Fl t Ar fstype
|
|
|
|
.Ek
|
2002-04-04 11:24:55 +04:00
|
|
|
.Bk -words
|
|
|
|
.Op Fl b Ar bno
|
|
|
|
.Ek
|
2002-04-03 09:21:16 +04:00
|
|
|
.Ar filesystem
|
2002-04-12 10:50:41 +04:00
|
|
|
.Ar primary
|
|
|
|
.Op Ar secondary
|
2002-04-03 09:21:16 +04:00
|
|
|
.Nm ""
|
|
|
|
.Fl c
|
2002-04-04 11:27:44 +04:00
|
|
|
.Op Fl nv
|
2002-04-03 09:21:16 +04:00
|
|
|
.Bk -words
|
|
|
|
.Op Fl m Ar machine
|
|
|
|
.Ek
|
|
|
|
.Bk -words
|
|
|
|
.Op Fl o Ar options
|
|
|
|
.Ek
|
|
|
|
.Bk -words
|
|
|
|
.Op Fl t Ar fstype
|
|
|
|
.Ek
|
|
|
|
.Ar filesystem
|
|
|
|
.
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
2002-04-04 11:24:55 +04:00
|
|
|
utility installs and removes
|
|
|
|
.Nx
|
2002-04-04 17:45:25 +04:00
|
|
|
disk bootstrap software into a file system.
|
2002-04-03 09:21:16 +04:00
|
|
|
.Nm
|
|
|
|
can install
|
2002-04-12 10:50:41 +04:00
|
|
|
.Ar primary
|
2002-04-03 09:21:16 +04:00
|
|
|
into
|
|
|
|
.Ar filesystem ,
|
|
|
|
or disable an existing bootstrap in
|
|
|
|
.Ar filesystem .
|
|
|
|
.Pp
|
2002-04-04 11:24:55 +04:00
|
|
|
Generally,
|
|
|
|
.Nx
|
|
|
|
disk bootstrap software consists of two parts: a
|
|
|
|
.Dq primary
|
|
|
|
bootstrap program usually written into the disklabel area of the
|
2002-04-04 17:45:25 +04:00
|
|
|
file system by
|
2002-04-04 11:24:55 +04:00
|
|
|
.Nm "" ,
|
|
|
|
and a
|
|
|
|
.Dq secondary
|
2002-04-04 17:45:25 +04:00
|
|
|
bootstrap program that usually resides as an ordinary file in the file system.
|
2002-04-04 11:24:55 +04:00
|
|
|
.Pp
|
|
|
|
When booting, the primary bootstrap program is loaded and invoked by
|
|
|
|
the machine's PROM or BIOS.
|
|
|
|
After receiving control of the system it loads and runs the secondary
|
|
|
|
bootstrap program, which in turn loads and runs the kernel.
|
|
|
|
The secondary bootstrap may allow control over various boot parameters
|
|
|
|
passed to the kernel.
|
|
|
|
.Pp
|
2002-04-04 17:45:25 +04:00
|
|
|
Perform the following steps to make a file system bootable:
|
|
|
|
.Bl -enum
|
|
|
|
.It
|
|
|
|
Copy the secondary bootstrap (usually
|
2002-04-04 11:24:55 +04:00
|
|
|
.Pa /usr/mdec/boot. Ns Sy MACHINE )
|
2002-04-04 17:45:25 +04:00
|
|
|
to the root directory of the target file system.
|
|
|
|
.Pp
|
2002-04-04 11:24:55 +04:00
|
|
|
.Nx Ns Tn /pmax
|
2002-04-04 17:45:25 +04:00
|
|
|
requires that this file system starts at block 0 of the disk.
|
|
|
|
.Pp
|
|
|
|
The secondary
|
|
|
|
.Nx Ns Tn /sparc64
|
|
|
|
bootstrap is located in
|
|
|
|
.Pa /usr/mdec/ofwboot .
|
|
|
|
.
|
|
|
|
.It
|
|
|
|
Use
|
2002-04-04 11:24:55 +04:00
|
|
|
.Nm
|
|
|
|
to install the primary bootstrap program
|
|
|
|
(usually
|
|
|
|
.Pa /usr/mdec/bootxx. Ns Sy <fs> )
|
2002-04-04 17:45:25 +04:00
|
|
|
into
|
|
|
|
.Ar filesystem .
|
|
|
|
.Pp
|
|
|
|
.Nx Ns Tn /pmax
|
|
|
|
and
|
|
|
|
.Nx Ns Tn /sparc64
|
|
|
|
do not require this step if the primary bootstrap already exists
|
|
|
|
and the secondary bootstrap file is just being updated.
|
|
|
|
.Pp
|
|
|
|
The primary
|
|
|
|
.Nx Ns Tn /sparc64
|
|
|
|
bootstrap is located in
|
|
|
|
.Pa /usr/mdec/bootblk .
|
|
|
|
.El
|
2002-04-03 09:21:16 +04:00
|
|
|
.Pp
|
|
|
|
The options recognized by
|
|
|
|
.Nm
|
|
|
|
are as follows:
|
|
|
|
.
|
|
|
|
.Bl -tag -width "foobar"
|
|
|
|
.
|
|
|
|
.It Fl b Ar bno
|
|
|
|
Install
|
2002-04-12 10:50:41 +04:00
|
|
|
.Ar primary
|
2002-04-03 09:21:16 +04:00
|
|
|
at block number
|
|
|
|
.Ar bno
|
|
|
|
instead of the default location for the machine and file system type.
|
|
|
|
.
|
|
|
|
.It Fl c
|
|
|
|
Clear (remove) any existing bootstrap instead of installing one.
|
|
|
|
.
|
|
|
|
.It Fl m Ar machine
|
|
|
|
Use
|
|
|
|
.Ar machine
|
|
|
|
as the target machine type.
|
|
|
|
The default machine is determined from
|
|
|
|
.Xr uname 3
|
|
|
|
and then
|
|
|
|
.Ev MACHINE .
|
|
|
|
The following machines are currently supported by
|
|
|
|
.Nm "" :
|
|
|
|
.Bd -ragged -offset indent
|
2002-04-03 14:21:01 +04:00
|
|
|
.Sy alpha ,
|
2002-04-03 10:34:31 +04:00
|
|
|
.Sy pmax ,
|
2002-04-04 17:45:25 +04:00
|
|
|
.Sy sparc64 ,
|
2002-04-22 21:17:35 +04:00
|
|
|
.Sy sun2 ,
|
2002-04-03 09:21:16 +04:00
|
|
|
.Sy vax
|
|
|
|
.Ed
|
|
|
|
.
|
|
|
|
.
|
|
|
|
.It Fl n
|
|
|
|
Do not write to
|
|
|
|
.Ar filesystem .
|
|
|
|
.
|
|
|
|
.It Fl o Ar options
|
|
|
|
Machine specific
|
|
|
|
.Nm
|
|
|
|
options, comma separated.
|
|
|
|
.Pp
|
|
|
|
Supported options are (with the machines for they are valid in brackets):
|
|
|
|
.
|
2002-04-03 14:21:01 +04:00
|
|
|
.Bl -tag -offset indent -width alphasum
|
|
|
|
.
|
|
|
|
.It Sy alphasum
|
|
|
|
.Em [ alpha ]
|
|
|
|
Recalculate and restore the Alpha checksum.
|
|
|
|
This is the default for
|
|
|
|
.Nx Ns Tn /alpha .
|
2002-04-03 09:21:16 +04:00
|
|
|
.
|
|
|
|
.It Sy append
|
|
|
|
.Em [ pmax ,
|
|
|
|
.Em vax ]
|
|
|
|
Append
|
2002-04-12 10:50:41 +04:00
|
|
|
.Ar primary
|
2002-04-03 09:21:16 +04:00
|
|
|
to the end of
|
|
|
|
.Ar filesystem ,
|
2002-04-04 15:06:47 +04:00
|
|
|
which must be a regular file in this case.
|
2002-04-03 09:21:16 +04:00
|
|
|
.
|
|
|
|
.It Sy sunsum
|
|
|
|
.Em [ pmax ,
|
|
|
|
.Em vax ]
|
|
|
|
Recalculate and restore the Sun and
|
|
|
|
.Nx Ns Tn /sparc
|
|
|
|
compatible checksum.
|
2002-04-04 15:06:47 +04:00
|
|
|
.Em Note :
|
|
|
|
The existing
|
2002-04-03 09:21:16 +04:00
|
|
|
.Nx Ns Tn /sparc
|
|
|
|
disklabel should use no more than 4 partitions.
|
|
|
|
.El
|
|
|
|
.
|
|
|
|
.It Fl t Ar fstype
|
|
|
|
Use
|
|
|
|
.Ar fstype
|
|
|
|
as the type of
|
|
|
|
.Ar filesystem .
|
|
|
|
The default operation is to attempt to auto-detect this setting.
|
2002-04-19 11:08:51 +04:00
|
|
|
The following file system types are currently supported by
|
|
|
|
.Nm "" :
|
|
|
|
.Bd -ragged -offset indent
|
|
|
|
.Sy ffs
|
|
|
|
.Ed
|
2002-04-03 09:21:16 +04:00
|
|
|
.
|
|
|
|
.It Fl v
|
|
|
|
Verbose operation.
|
|
|
|
.El
|
2002-04-04 11:24:55 +04:00
|
|
|
.Pp
|
|
|
|
.Nm
|
|
|
|
exits 0 on success, and \*[Gt]0 if an error occurs.
|
2002-04-03 09:21:16 +04:00
|
|
|
.
|
|
|
|
.Sh ENVIRONMENT
|
|
|
|
.Nm
|
|
|
|
uses the following environment variables:
|
|
|
|
.
|
|
|
|
.Bl -tag -width "MACHINE"
|
|
|
|
.
|
|
|
|
.It Ev MACHINE
|
|
|
|
Default value for
|
|
|
|
.Ar machine ,
|
|
|
|
overriding the result from
|
|
|
|
.Xr uname 3 .
|
|
|
|
.
|
|
|
|
.El
|
|
|
|
.
|
|
|
|
.Sh FILES
|
2002-04-04 11:24:55 +04:00
|
|
|
Most NetBSD ports will contain variations of the following files:
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width /usr/mdec/boot.$MACHINE
|
|
|
|
.
|
|
|
|
.It Pa /usr/mdec/bootxx_ Ns Sy <fs>
|
2002-04-19 11:08:51 +04:00
|
|
|
Primary bootstrap for file system type
|
2002-04-04 11:24:55 +04:00
|
|
|
.Sy <fs> .
|
|
|
|
Installed into the bootstrap area of the file system by
|
|
|
|
.Nm "" .
|
|
|
|
.
|
|
|
|
.It Pa /usr/mdec/boot. Ns Sy MACHINE
|
|
|
|
Secondary bootstrap for machine type
|
|
|
|
.Sy MACHINE .
|
|
|
|
This should be installed into the file system before
|
|
|
|
.Nm
|
|
|
|
is run.
|
|
|
|
.
|
|
|
|
.It Pa /boot. Ns Sy MACHINE
|
|
|
|
Installed copy of secondary bootstrap for machine type
|
|
|
|
.Sy MACHINE .
|
|
|
|
.
|
|
|
|
.It Pa /boot
|
|
|
|
Installed copy of secondary bootstrap.
|
|
|
|
Searched for by the primary bootstrap if
|
|
|
|
.Pa /boot. Ns Sy MACHINE
|
|
|
|
is not found.
|
|
|
|
.
|
|
|
|
.El
|
2002-04-04 17:45:25 +04:00
|
|
|
.Pp
|
|
|
|
.Ss NetBSD/sparc64 files
|
|
|
|
.
|
|
|
|
.Bl -tag -width /usr/mdec/boot.$MACHINE
|
|
|
|
.
|
|
|
|
.It Pa /usr/mdec/bootblk
|
|
|
|
.Nx Ns Tn /sparc64
|
|
|
|
primary bootstrap.
|
2002-04-04 11:24:55 +04:00
|
|
|
.
|
2002-04-04 17:45:25 +04:00
|
|
|
.It Pa /usr/mdec/ofwboot
|
|
|
|
.Nx Ns Tn /sparc64
|
|
|
|
secondary bootstrap.
|
|
|
|
.
|
|
|
|
.It Pa /ofwboot
|
|
|
|
Installed copy of
|
|
|
|
.Nx Ns Tn /sparc64
|
|
|
|
secondary bootstrap.
|
|
|
|
.
|
|
|
|
.El
|
2002-04-04 11:24:55 +04:00
|
|
|
.
|
|
|
|
.Sh EXAMPLES
|
2002-04-04 17:45:25 +04:00
|
|
|
.Ss NetBSD/pmax examples
|
2002-04-04 11:24:55 +04:00
|
|
|
Install the Berkeley Fast File System primary bootstrap on to disk sd0:
|
|
|
|
.D1 Ic installboot /dev/rsd0c /usr/mdec/bootxx_ffs
|
|
|
|
.Pp
|
2002-04-04 17:45:25 +04:00
|
|
|
Remove the primary bootstrap from disk sd1:
|
|
|
|
.Dl Ic installboot -c /dev/swd1c
|
2002-04-04 11:24:55 +04:00
|
|
|
Install the ISO 9660 primary bootstrap in the file
|
|
|
|
.Pa /tmp/cd-image :
|
|
|
|
.Dl Ic installboot -m pmax /tmp/cd-image /usr/mdec/bootxx_cd9660
|
|
|
|
.Pp
|
|
|
|
Make an ISO 9660 filesystem in the file
|
|
|
|
.Pa /tmp/cd-image
|
|
|
|
and install the ISO 9660 primary bootstrap in the filesystem, where the
|
|
|
|
source directory for the ISO 9660 filesystem contains a kernel, the
|
|
|
|
primary bootstrap
|
|
|
|
.Pa bootxx_cd9660
|
|
|
|
and the secondary bootstrap
|
|
|
|
.Pa boot.pmax :
|
|
|
|
.Dl Ic mkisofs -o /tmp/cd-image -a -l -v iso-source-dir
|
|
|
|
.Dl ...
|
|
|
|
.Dl 48 51 iso-source-dir/bootxx_cd9660
|
|
|
|
.Dl ...
|
|
|
|
.Dl Ic installboot -b `expr 48 \e* 4` /tmp/cd-image /usr/mdec/bootxx_cd9660
|
2002-04-03 09:21:16 +04:00
|
|
|
.
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr uname 3 ,
|
|
|
|
.Xr boot 8 ,
|
|
|
|
.Xr disklabel 8 ,
|
|
|
|
.Xr init 8
|
|
|
|
.
|
|
|
|
.Sh HISTORY
|
2002-04-04 11:24:55 +04:00
|
|
|
This implementation of
|
2002-04-03 09:21:16 +04:00
|
|
|
.Nm
|
2002-04-04 11:24:55 +04:00
|
|
|
appeared in
|
2002-04-03 09:21:16 +04:00
|
|
|
.Nx 1.6 .
|
|
|
|
.
|
2002-04-04 11:24:55 +04:00
|
|
|
.Sh AUTHORS
|
2002-04-04 15:06:47 +04:00
|
|
|
The machine independent portion of this implementation of
|
2002-04-04 11:24:55 +04:00
|
|
|
.Nm
|
|
|
|
was written by Luke Mewburn.
|
|
|
|
The following people contributed to the various machine dependent
|
|
|
|
back-ends:
|
|
|
|
Simon Burge (pmax),
|
|
|
|
Chris Demetriou (alpha),
|
2002-04-22 21:17:35 +04:00
|
|
|
Matthew Fredette (sun2),
|
2002-04-04 17:45:25 +04:00
|
|
|
Matthew Green (sparc64),
|
2002-04-04 11:24:55 +04:00
|
|
|
Ross Harvey (alpha),
|
2002-04-04 17:45:25 +04:00
|
|
|
and
|
2002-04-04 15:06:47 +04:00
|
|
|
Matt Thomas (vax).
|
2002-04-04 11:24:55 +04:00
|
|
|
.
|
2002-04-03 09:21:16 +04:00
|
|
|
.Sh BUGS
|
2002-04-04 11:24:55 +04:00
|
|
|
There are not currently primary bootstraps to support all file systems
|
|
|
|
types which are capable of being the root file system.
|
|
|
|
.Ss NetBSD/pmax bugs
|
|
|
|
The
|
|
|
|
.Nx Ns Tn /pmax
|
|
|
|
secondary bootstrap program can only load kernels from file
|
|
|
|
systems starting at the beginning of disks.
|
|
|
|
.Pp
|
|
|
|
The size of primary bootstrap programs is restricted to 7.5KB, even
|
2002-04-04 15:06:47 +04:00
|
|
|
though some file systems (e.g. ISO 9660) are able to accommodate larger
|
2002-04-04 11:24:55 +04:00
|
|
|
ones.
|