unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (NetBSD-2.0)
Page:
Section:
Apropos / Subsearch:
optional field

INSTALLBOOT(8)            BSD System Manager's Manual           INSTALLBOOT(8)

NAME
     installboot -- install disk bootstrap software

SYNOPSIS
     installboot [-nv] [-m machine] [-o options] [-t fstype] [-b s1bno]
                 [-B s2bno] filesystem primary [secondary]
     installboot -c [-nv] [-m machine] [-o options] [-t fstype] filesystem

DESCRIPTION
     The installboot utility installs and removes NetBSD disk bootstrap soft-
     ware into a file system.  installboot can install primary into
     filesystem, or disable an existing bootstrap in filesystem.

     Generally, NetBSD disk bootstrap software consists of two parts: a
     ``primary'' bootstrap program usually written into the disklabel area of
     the file system by installboot, and a ``secondary'' bootstrap program
     that usually resides as an ordinary file in the file system.

     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.

     Perform the following steps to make a file system bootable:

     1.   Copy the secondary bootstrap (usually /usr/mdec/boot.MACHINE or
          /usr/mdec/boot) to the root directory of the target file system.

     2.   Use installboot to install the primary bootstrap program (usually
          /usr/mdec/bootxx_FSTYPE) into filesystem.

          The following platforms do not require this step if the primary
          bootstrap already exists and the secondary bootstrap file is just
          being updated: alpha, amiga, i386, pmax, sparc64, and vax.

          The following platform does not require the first step since a sin-
          gle bootstrap file is used.  The single bootstrap is installed like
          the primary bootstrap on other platforms: next68k.

     The options and arguments recognized by installboot are as follows:

     -b s1bno    Install primary at block number s1bno instead of the default
                 location for the machine and file system type.  [alpha, pmax,
                 vax]

     -B s2bno    When hard-coding the blocks of secondary into primary, start
                 from block s2bno instead of trying to determine the block
                 numbers occupied by secondary by examining filesystem.  If
                 this option is supplied, secondary should refer to an actual
                 secondary bootstrap (rather than the file name of the one
                 present in filesystem) so that its size can be determined.

     -c          Clear (remove) any existing bootstrap instead of installing
                 one.

     -m machine  Use machine as the target machine type.  The default machine
                 is determined from uname(3) and then MACHINE.  The following
                 machines are currently supported by installboot:

                       alpha, amd64, amiga, hp300, i386, macppc, news68k,
                       newsmips, next68k, pmax, sparc, sparc64, sun2, sun3,
                       vax, x68k

     -n          Do not write to filesystem.

     -o options  Machine specific installboot options, comma separated.

                 Supported options are (with the machines for they are valid
                 in brackets):

                       alphasum  [alpha] Recalculate and restore the Alpha
                                 checksum.  This is the default for
                                 NetBSD/alpha.

                       append    [alpha, pmax, vax] Append primary to the end
                                 of filesystem, which must be a regular file
                                 in this case.

                       command=<&lt;boot command>&gt;
                                 [amiga] Modify the default boot command line.

                       console=<&lt;console name>&gt;
                                 [i386] Set the console device, <console name>
                                 must be one of: pc, com0, com1, com2, com3,
                                 com0kbd, com1kbd, com2kbd or com3kbd.

                       keymap=<&lt;keymap>&gt;
                                 [i386] Set a boot time keyboard translation
                                 map.  Each character in <keymap> will be
                                 replaced by the one following it.  For exam-
                                 ple, an argument of ``zyz'' would swap the
                                 lowercase letters 'y' and 'z'.

                       password=<&lt;password>&gt;
                                 [i386] Set the password which must be entered
                                 before the boot menu can be accessed.

                       resetvideo
                                 [i386] Reset the video before booting.

                       speed=<&lt;baud rate>&gt;
                                 [i386] Set the baud rate for the serial con-
                                 sole.

                       sunsum    [alpha, pmax, vax] Recalculate and restore
                                 the Sun and NetBSD/sparc compatible checksum.
                                 Note: The existing NetBSD/sparc disklabel
                                 should use no more than 4 partitions.

                       timeout=<&lt;seconds>&gt;
                                 [i386] Set the timeout before the automatic
                                 boot begins to the given number of seconds.

     -t fstype   Use fstype as the type of filesystem.  The default operation
                 is to attempt to auto-detect this setting.  The following
                 file system types are currently supported by installboot:

                       ffs  BSD Fast File System.

                       raw  'Raw' image.  Note: if a platform needs to hard-
                            code the block offset of the secondary bootstrap,
                            it cannot be searched for on this file system
                            type, and must be provided with -B s2bno.

     -v          Verbose operation.

     filesystem  The path name of the device or file system image that
                 installboot is to operate on.  It is not necessary for
                 filesystem to be a currently mounted file system.

     primary     The path name of the ``primary'' boot block to install.

     secondary   The path name of the ``secondary'' boot block, relative to
                 the top of filesystem.  Most systems require secondary to be
                 in the ``root'' directory of the file system, so the leading
                 ``/'' is not necessary on secondary.

                 Only certain combinations of platform (-m machine) and file
                 system type (-t fstype) require that the name of the sec-
                 ondary bootstrap is supplied as secondary, so that informa-
                 tion such as the disk block numbers occupied by the secondary
                 bootstrap can be stored in the primary bootstrap.  These are:

                       Platform    File systems
                       macppc      ffs, raw
                       news68k     ffs, raw
                       newsmips    ffs, raw
                       sparc       ffs, raw
                       sun2        ffs, raw
                       sun3        ffs, raw

     installboot exits 0 on success, and >0 if an error occurs.

ENVIRONMENT
     installboot uses the following environment variables:

     MACHINE  Default value for machine, overriding the result from uname(3).

FILES
     Most NetBSD ports will contain variations of the following files:

     /usr/mdec/bootxx_FSTYPE   Primary bootstrap for file system type FSTYPE.
                               Installed into the bootstrap area of the file
                               system by installboot.

     /usr/mdec/bootxx_ffsv1    Primary bootstrap for FFSv1 file systems (the
                               "traditional" NetBSD file system).

     /usr/mdec/bootxx_ffsv2    Primary bootstrap for FFSv2 file systems.

     /usr/mdec/bootxx_lfsv1    Primary bootstrap for LFSv1 file systems.

     /usr/mdec/bootxx_lfsv2    Primary bootstrap for LFSv2 file systems (the
                               default LFS version).

     /usr/mdec/bootxx_msdos    Primary bootstrap for MS-DOS FAT file systems.

     /usr/mdec/bootxx_ustarfs  Primary bootstrap for TARFS boot images.  This
                               is used by various install media.

     /usr/mdec/boot.MACHINE    Secondary bootstrap for machine type MACHINE.
                               This should be installed into the file system
                               before installboot is run.

     /usr/mdec/boot            Synonym for /usr/mdec/boot.MACHINE

     /boot.MACHINE             Installed copy of secondary bootstrap for
                               machine type MACHINE.

     /boot                     Installed copy of secondary bootstrap.
                               Searched for by the primary bootstrap if
                               /boot.MACHINE is not found.

   NetBSD/next68k files
     /usr/mdec/boot            NetBSD/next68k bootstrap.

   NetBSD/sparc64 files
     /usr/mdec/bootblk         NetBSD/sparc64 primary bootstrap.

     /usr/mdec/ofwboot         NetBSD/sparc64 secondary bootstrap.

     /ofwboot                  Installed copy of NetBSD/sparc64 secondary
                               bootstrap.

EXAMPLES
   common
     Verbosely install the Berkeley Fast File System primary bootstrap on to
     disk 'sd0':
           installboot -v /dev/rsd0c /usr/mdec/bootxx_ffs

     Remove the primary bootstrap from disk 'sd1':
           installboot -c /dev/rsd1c

   NetBSD/amiga
     Modify the command line to change the default from "netbsd -ASn2" to
     "netbsd -S":
           installboot -m amiga -o command="netbsd -S" /dev/rsd0a
           /usr/mdec/bootxx_ffs

   NetBSD/i386
     Install new boot blocks on an existing mounted root file system on 'wd0',
     setting the timeout to five seconds, after copying a new secondary boot-
     strap:
           cp /usr/mdec/boot /boot
           installboot -v -o timeout=5 /dev/rwd0a /usr/mdec/bootxx_ffsv1

     Create a bootable floppy disk with an FFSv1 file system for a small cus-
     tom kernel (note: bigger kernels needing multiple disks are handled with
     the ustarfs file system):
           newfs -s 1440k /dev/rfd0a
                 Note: Ignore the warnings that newfs(8) displays; it can not
                 write a disklabel, which is not a problem for a floppy disk.
           mount /dev/fd0a /mnt
           cp /usr/mdec/boot /mnt/boot
           gzip -9 <&lt; sys/arch/i386/compile/mykernel/netbsd >&gt; /mnt/netbsd.gz
           umount /mnt
           installboot -v /dev/rfd0a /usr/mdec/bootxx_ffsv1

     Create a bootable FAT file system on 'wd1a', which should have the same
     offset and size as a FAT primary partition in the Master Boot Record
     (MBR):
           newfs_msdos -r 16 /dev/rwd1a
                 Notes: The -r 16 is to reserve space for the primary boot-
                 strap.  newfs_msdos(8) will display an ``MBR type'' such as
                 '1', '4', or '6'; the MBR partition type of the appropriate
                 primary partition should be changed to this value.
           mount -t msdos /dev/wd1a /mnt
           cp /usr/mdec/boot /mnt/boot
           cp path/to/kernel /mnt/netbsd
           umount /mnt
           installboot -t raw /dev/rwd1a /usr/mdec/bootxx_msdos
                 Note: It may be necessary to ensure that there is a valid
                 NetBSD disklabel on 'wd1' for the primary bootstrap to func-
                 tion correctly.

   NetBSD/next68k
     Install the bootstrap on to disk 'sd0':
           installboot /dev/rsd0c /usr/mdec/boot

   NetBSD/pmax
     Install the Berkeley Fast File System primary bootstrap on to disk 'sd0':
           installboot /dev/rsd0c /usr/mdec/bootxx_ffs

     NetBSD/pmax requires that this file system starts at block 0 of the disk.

     Install the ISO 9660 primary bootstrap in the file /tmp/cd-image:
           installboot -m pmax /tmp/cd-image /usr/mdec/bootxx_cd9660

     Make an ISO 9660 filesystem in the file /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
     bootxx_cd9660 and the secondary bootstrap boot.pmax:
           mkisofs -o /tmp/cd-image -a -l -v iso-source-dir
           ...
           48 51 iso-source-dir/bootxx_cd9660
           ...
           installboot -b `expr 48 \* 4` /tmp/cd-image /usr/mdec/bootxx_cd9660

   NetBSD/sparc
     Install the Berkeley Fast File System primary bootstrap on to disk 'sd0',
     with the secondary bootstrap '/boot' already present:
           installboot /dev/rsd0c /usr/mdec/bootxx /boot

   NetBSD/sparc64
     Install the Berkeley Fast File System primary bootstrap on to disk 'wd0':
           installboot /dev/rwd0c /usr/mdec/bootblk

     The secondary NetBSD/sparc64 bootstrap is located in /usr/mdec/ofwboot.

   NetBSD/sun2 and NetBSD/sun3
     Install the Berkeley Fast File System primary bootstrap on to disk 'sd0',
     with the secondary bootstrap '/boot' already present:
           installboot /dev/rsd0c /usr/mdec/bootxx /boot

SEE ALSO
     uname(3), boot(8), disklabel(8)

HISTORY
     This implementation of installboot appeared in NetBSD 1.6.

AUTHORS
     The machine independent portion of this implementation of installboot was
     written by Luke Mewburn.  The following people contributed to the various
     machine dependent back-ends: Simon Burge (pmax), Chris Demetriou (alpha),
     Matthew Fredette (sun2, sun3), Matthew Green (sparc64), Ross Harvey
     (alpha), Michael Hitch (amiga), Paul Kranenburg (sparc), David Laight
     (i386), Christian Limpach (next68k), Luke Mewburn (macppc), Matt Thomas
     (vax), and Izumi Tsutsui (news68k, newsmips).

BUGS
     There are not currently primary bootstraps to support all file systems
     types which are capable of being the root file system.

   NetBSD/alpha
     The NetBSD/alpha primary bootstrap program can only load the secondary
     bootstrap program from file systems starting at the beginning (block 0)
     of disks.  Similarly, the secondary bootstrap program can only load ker-
     nels from file systems starting at the beginning of disks.

     The size of primary bootstrap programs is restricted to 7.5KB, even
     though some file systems (e.g., ISO 9660) are able to accommodate larger
     ones.

   NetBSD/hp300
     The disk must have a boot partition large enough to hold the bootstrap
     code.  Currently the primary bootstrap must be a LIF format file.

   NetBSD/i386 and NetBSD/amd64
     The bootstrap must be installed in the NetBSD partition that starts at
     the beginning of the mbr partition.  If that is a valid filesystem and
     contains the /boot program then it will be used as the root filesystem,
     otherwise the 'a' partition will be booted.

     The size of primary bootstrap programs is restricted to 8KB, even though
     some file systems (e.g., ISO 9660) are able to accommodate larger ones.

   NetBSD/next68k
     The size of bootstrap programs is restricted to the free space before the
     file system at the beginning of the disk minus 8KB.

   NetBSD/pmax
     The NetBSD/pmax secondary bootstrap program can only load kernels from
     file systems starting at the beginning of disks.

     The size of primary bootstrap programs is restricted to 7.5KB, even
     though some file systems (e.g., ISO 9660) are able to accommodate larger
     ones.

   NetBSD/sun2 and NetBSD/sun3
     The NetBSD/sun2 and NetBSD/sun3 secondary bootstrap program can only load
     kernels from file systems starting at the beginning of disks.

   NetBSD/vax
     The NetBSD/vax secondary bootstrap program can only load kernels from
     file systems starting at the beginning of disks.

     The size of primary bootstrap programs is restricted to 7.5KB, even
     though some file systems (e.g., ISO 9660) are able to accommodate larger
     ones.

BSD                             March 14, 2004                             BSD