Add a manpage for prep's mkbootimage(8).

This commit is contained in:
garbled 2006-03-23 18:13:34 +00:00
parent 33dca3ba88
commit adb4cd42dc
1 changed files with 141 additions and 0 deletions

View File

@ -0,0 +1,141 @@
.\" $NetBSD: mkbootimage.8,v 1.1 2006/03/23 18:13:34 garbled Exp $
.\" Copyright (c) 2006 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Tim Rightnour
.\"
.\" 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.
.\"
.Dd March 23, 2006
.Dt MKBOOTIMAGE 8
.Os
.Sh NAME
.Nm mkbootimage
.Nd create a prep boot image
.Sh SYNOPSIS
.Nm
.Op Fl ls
.Op Fl b Ar bootfile
.Op Fl k Ar kernel
.Op Fl r Ar rawdev
.Ar boot-image
.Sh DESCRIPTION
.Nm
is the utility used to create a bootable prep kernel image on
.Nx .
.Pp
The
.Nm
utility takes the boot-progam, and the optional kernel, and creates a boot
image from them. This image contains the boot code, kernel, and optionally
an i386 partition table. The image can be written directly to a floppy or
hard drive with the
.Xr dd 1
command, or it can be directly netbooted via
.Xr bootpd 8 .
.Pp
The following options are available:
.Bl -tag -width indent
.It Fl b
Specifies which bootloader to embed in the bootable image. Defaults to
.Pa /usr/mdec/boot .
.It Fl k
Specifies which kernel binary to embed in the bootable image. Defaults to
.Pa /netbsd .
.It Fl l
Creates a partition table for a 2.88MB floppy instead of a 1.44MB floppy. This
is primarily used for El-Torrito style CD images.
.It Fl r
Specifies the raw device to read to gather the current partition table. This
is generally
.Pa /dev/rsd0c .
.It Fl s
Generates a standalone image with no partition table embedded.
.El
.Pp
There are three primary ways to use
.Nm
to build a bootable image:
.Pp
The first method is to build an image suitable for a floppy or netboot. This
will create an image with an embedded partition table with a single PReP boot
partition of type 0x41(65). The image can be directly netbooted, or if it
is small enough, written directly to a floppy with
.Xr dd 1 .
.Nm
will warn you if the generated image is too large to be written to a floppy.
.Pp
The second method is to build a standalone image with no partition table. This
should be written to the PReP boot partition on your hard drive with
.Xr dd 1 .
.Pp
The third method is for use in upgrading older systems that have been built by
writing the floppy image directly to the head of the hard drive. This method
reads the existing partition table and embeds that in the image. This should
prevent loss of your current partition layout. This image should be written
directly to the head of the disk with
.Xr dd 1 .
.Pp
The reccomended setup for a PReP machine is to build a partition table with
.Xr fdisk 8
that contains a PReP boot partition (type 65) as partition 0, marked active,
and a second partition for
.Nx
encompasing the remainder of the disk. You should then create a disklabel on
that disk with a partition (such as e) pointing to the PReP boot partition.
Partition c should be the whole disk, and partition d can optionally be the
.Nx
portion of the disk. You may then use the other partitions for your normal
disk layout.
The PReP boot partition can be placed anywhere on the disk, but it is
reccomended that it be placed at the beginning of the disk.
.Sh Examples
Create a floppy or netboot image named
.Sq boot.fs :
.Dl Ic mkbootimage -b /usr/mdec/boot -k /netbsd boot.fs
Create a standalone image for booting from a hard disk:
.Dl Ic mkbootimage -s -b /usr/mdec/boot -k /netbsd boot.fs
Use the partition information on
.Sq sd0
to create a new bootable image with com0 as the console:
.Dl Ic mkbootimage -b /usr/mdec/boot_com0 -k /netbsd -r /dev/rsd0c boot.fs
.Sh SEE ALSO
.Xr fdisk 8 ,
.Xr boot 8 ,
.Xr disklabel 8 ,
.Xr bootpd 8 ,
.Xr dd 1
.Sh HISTORY
.Nm
first appeared in
.Nx 1.5 .
.Sh AUTHORS
.Nm
was written by NONAKA Kimihiro.