INSTALLBOOT(8) | System Manager's Manual | INSTALLBOOT(8) |
installboot | [-fnv] [-B s2bno] [-b s1bno] [-m machine] [-o options] [-t fstype] filesystem primary [secondary] |
installboot | -c [-fnv] [-m machine] [-o options] [-t fstype] filesystem |
installboot | -e [-fnv] [-m machine] [-o options] bootstrap |
On some architectures the options of an existing installed bootstrap, or those of a bootstrap file can be changed. Installing a new primary bootstrap will reset those options to default values.
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:
The following platforms do not require this step if the primary bootstrap already exists and the secondary bootstrap file is just being updated: alpha, amd64, amiga, i386, pmax, sparc64, and vax.
The following platform does not require the first step since a single 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:
Supported options are (with the machines for they are valid in brackets):
Only certain combinations of platform (-m machine) and file system type (-t fstype) require that the name of the secondary bootstrap is supplied as secondary, so that information 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, raid, raw |
sun2 | ffs, raw |
sun3 | ffs, raw |
installboot exits 0 on success, and >0 if an error occurs.
reserved sectors
'. It also uses the information in the ‘Boot Parameter Block
' to get the media and filesytem properties.traditional
' file system prior to NetBSD 6.0). Use dumpfs(8) to confirm the file system format is FFSv1.Note: the “whole disk” partition (c on some ports, d on others) is used here, since the a partition probably is already opened (mounted as /), so installboot would not be able to access it.installboot -v /dev/rsd0c /usr/mdec/bootxx_ffs
Remove the primary bootstrap from disk ‘sd1':
installboot -c /dev/rsd1c
installboot -m amiga -o command="netbsd -S" /dev/rsd0a /usr/mdec/bootxx_ffs
installboot /dev/rsd0c /usr/mdec/bootxx_bfs
cp /usr/mdec/boot /boot
installboot -v -o timeout=5 /dev/rwd0a /usr/mdec/bootxx_ffsv2
Create a bootable CD-ROM with an ISO 9660 file system for an i386 system with a serial console:
mkdir cdrom
cp sys/arch/i386/compile/mykernel/netbsd cdrom/netbsd
cp /usr/mdec/boot cdrom/boot
cp /usr/mdec/bootxx_cd9660 bootxx
installboot -o console=com0,speed=19200 -m i386 -e bootxx
makefs -t cd9660 -o 'bootimage=i386;bootxx,no-emul-boot' boot.iso cdrom
Create a bootable floppy disk with an FFSv1 file system for a small custom kernel (note: bigger kernels needing multiple disks are handled with the ustarfs file system):
newfs -s 1440k /dev/rfd0a
mount /dev/fd0a /mnt
cp /usr/mdec/boot /mnt/boot
gzip -9 < sys/arch/i386/compile/mykernel/netbsd > /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
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
Make the existing FAT16 filesystem on ‘sd0e' bootable. This can be used to make USB memory bootable provided it has 512 byte sectors and that the manufacturer correctly initialised the file system.
mount -t msdos /dev/sd0e /mnt
cp /usr/mdec/boot /mnt/boot
cp path/to/kernel /mnt/netbsd
umount /mnt
It may also be necessary to use fdisk to make the device itself bootable.installboot /dev/rsd0e /usr/mdec/bootxx_fat16
Switch the existing installed bootstrap to use a serial console without reinstalling or altering other options such as timeout.
installboot -e -o console=com0 /dev/rwd0a
Install the Berkeley Fast File System primary bootstrap on to disk ‘wd0':
installboot /dev/rwd0c /usr/mdec/bootxx /ofwboot
The secondary NetBSD/macppc bootstrap is located in /usr/mdec/ofwboot.
The primary bootstrap requires the raw ofwboot for the secondary bootstrap, not ofwboot.xcf, which is used for the OpenFirmware to load kernels.
installboot /dev/rsd0c /usr/mdec/boot
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
installboot /dev/rsd0c /usr/mdec/bootxx /boot
installboot /dev/rsd0c /usr/mdec/bootblk
The secondary NetBSD/sparc64 bootstrap is located in /usr/mdec/ofwboot.
installboot /dev/rsd0c /usr/mdec/bootxx /boot
If a disk has been converted from FFS to RAID without the contents of the disk erased, then the original FFS installation may be auto-detected instead of the RAID installation. In this case, the -t raid option must be provided.
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.
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.
Currently, installboot doesn't recognize an existing Apple partition map on the disk and always writes a faked map to make disks bootable.
The NetBSD/macppc bootstrap program can't load kernels from FFSv2 partitions.
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.
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.
February 11, 2012 | NetBSD 6.1 |