1.\" $NetBSD: installboot.8,v 1.95 2017/08/15 21:21:18 wiz Exp $ 2.\" 3.\" Copyright (c) 2002-2017 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to The NetBSD Foundation 7.\" by Luke Mewburn of Wasabi Systems. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28.\" POSSIBILITY OF SUCH DAMAGE. 29.\" 30.Dd March 14, 2017 31.Dt INSTALLBOOT 8 32.Os 33.Sh NAME 34.Nm installboot 35.Nd install disk bootstrap software 36. 37.Sh SYNOPSIS 38.Nm 39.Op Fl fnv 40.Op Fl B Ar s2bno 41.Op Fl b Ar s1bno 42.Op Fl m Ar machine 43.Op Fl o Ar options 44.Op Fl t Ar fstype 45.Ar filesystem 46.Ar primary 47.Op Ar secondary 48.Nm 49.Fl c 50.Op Fl fnv 51.Op Fl m Ar machine 52.Op Fl o Ar options 53.Op Fl t Ar fstype 54.Ar filesystem 55.Nm 56.Fl e 57.Op Fl fnv 58.Op Fl m Ar machine 59.Op Fl o Ar options 60.Ar bootstrap 61. 62.Sh DESCRIPTION 63The 64.Nm 65utility installs and removes 66.Nx 67disk bootstrap software into a file system. 68.Nm 69can install 70.Ar primary 71into 72.Ar filesystem , 73or disable an existing bootstrap in 74.Ar filesystem . 75.Pp 76On some architectures the options of an existing installed bootstrap, 77or those of a bootstrap file can be changed. 78Installing a new primary bootstrap will reset those options to default 79values. 80.Pp 81Generally, 82.Nx 83disk bootstrap software consists of two parts: a 84.Dq primary 85bootstrap program usually written into the disklabel area of the 86file system by 87.Nm , 88and a 89.Dq secondary 90bootstrap program that usually resides as an ordinary file in the file system. 91.Pp 92When booting, the primary bootstrap program is loaded and invoked by 93the machine's PROM or BIOS. 94After receiving control of the system it loads and runs the secondary 95bootstrap program, which in turn loads and runs the kernel. 96The secondary bootstrap may allow control over various boot parameters 97passed to the kernel. 98.Pp 99Perform the following steps to make a file system bootable: 100.Bl -enum 101.It 102Copy the secondary bootstrap (usually 103.Pa /usr/mdec/boot. Ns Sy MACHINE 104or 105.Pa /usr/mdec/boot ) 106to the root directory of the target file system. 107. 108.It 109Use 110.Nm 111to install the primary bootstrap program 112(usually 113.Pa /usr/mdec/bootxx_ Ns Sy FSTYPE ) 114into 115.Ar filesystem . 116.Pp 117The following platforms do not require this step if the primary bootstrap 118already exists and the secondary bootstrap file is just being updated: 119.Sy alpha , 120.Sy amd64 , 121.Sy amiga , 122.Sy i386 , 123.Sy pmax , 124.Sy sparc64 , 125and 126.Sy vax . 127.Pp 128The following platform does not require the first step since a 129single bootstrap file is used. 130The single bootstrap is installed like the primary bootstrap on 131other platforms: 132.Sy next68k . 133.El 134.Pp 135The options and arguments recognized by 136.Nm 137are as follows: 138. 139.Bl -tag -width "optionsxxx" 140. 141.It Fl B Ar s2bno 142When hard-coding the blocks of 143.Ar secondary 144into 145.Ar primary , 146start from block 147.Ar s2bno 148instead of trying to determine the block numbers occupied by 149.Ar secondary 150by examining 151.Ar filesystem . 152If this option is supplied, 153.Ar secondary 154should refer to an actual secondary bootstrap (rather than the 155file name of the one present in 156.Ar filesystem ) 157so that its size can be determined. 158. 159.It Fl b Ar s1bno 160Install 161.Ar primary 162at block number 163.Ar s1bno 164instead of the default location for the machine and file system type. 165.Sy [ alpha , 166.Sy i386/amd64 (bootxx_fat16 only) , 167.Sy pmax , 168.Sy vax ] 169. 170.It Fl c 171Clear (remove) any existing bootstrap instead of installing one. 172. 173.It Fl e 174Edit the options of an existing bootstrap. 175This can be used to change the options in bootxx_xxxfs files, 176raw disk partitions, and the 177.Pa pxeboot_ia32.bin 178file. 179With 180.Fl v 181and without 182.Fl o , 183show the current options. 184.Sy [ amd64 , i386 ] 185. 186.It Fl f 187Forces 188.Nm 189to ignore some errors. 190. 191.It Fl m Ar machine 192Use 193.Ar machine 194as the target machine type. 195The default machine is determined from 196.Xr uname 3 197and then 198.Ev MACHINE . 199The following machines are currently supported by 200.Nm : 201.Bd -ragged -offset indent 202.Sy alpha , 203.Sy amd64 , 204.Sy amiga , 205.Sy ews4800mips , 206.Sy hp300 , 207.Sy hppa , 208.Sy i386 , 209.Sy landisk , 210.Sy macppc , 211.Sy news68k , 212.Sy newsmips , 213.Sy next68k , 214.Sy pmax , 215.Sy sparc , 216.Sy sparc64 , 217.Sy sun2 , 218.Sy sun3 , 219.Sy vax , 220.Sy x68k 221.Ed 222. 223. 224.It Fl n 225Do not write to 226.Ar filesystem . 227. 228.It Fl o Ar options 229Machine specific 230.Nm 231options, comma separated. 232.Pp 233Supported options are (with the machines for they are valid in brackets): 234. 235.Bl -tag -offset indent -width alphasum 236. 237.It Sy alphasum 238.Sy [ alpha ] 239Recalculate and restore the Alpha checksum. 240This is the default for 241.Nx Ns /alpha . 242. 243.It Sy append 244.Sy [ alpha , 245.Sy pmax , 246.Sy vax ] 247Append 248.Ar primary 249to the end of 250.Ar filesystem , 251which must be a regular file in this case. 252. 253.It Sy bootconf 254.Sy [ amd64 , 255.Sy i386 ] 256(Don't) read a 257.Dq boot.cfg 258file. 259. 260.It Sy command=<boot command> 261.Sy [ amiga ] 262Modify the default boot command line. 263. 264.It Sy console=<console name> 265.Sy [ amd64 , 266.Sy i386 ] 267Set the console device, <console name> must be one of: 268pc, com0, com1, com2, com3, com0kbd, com1kbd, com2kbd, com3kbd or auto. 269. 270.It Sy ioaddr=<ioaddr> 271.Sy [ amd64 , 272.Sy i386 ] 273Set the IO address to be used for the console serial port. 274Defaults to the IO address used by the system BIOS for the specified port. 275. 276.It Sy keymap=<keymap> 277.Sy [ amd64 , 278.Sy i386 ] 279Set a boot time keyboard translation map. 280Each character in <keymap> will be replaced by the one following it. 281For example, an argument of 282.Dq zyz 283would swap the lowercase letters 284.Sq y 285and 286.Sq z . 287. 288.It Sy modules 289.Sy [ amd64 , 290.Sy i386 ] 291(Don't) load kernel modules. 292. 293.It Sy password=<password> 294.Sy [ amd64 , 295.Sy i386 ] 296Set the password which must be entered before the boot menu can be accessed. 297. 298.It Sy resetvideo 299.Sy [ amd64 , 300.Sy i386 ] 301Reset the video before booting. 302. 303.It Sy speed=<baud rate> 304.Sy [ amd64 , 305.Sy i386 ] 306Set the baud rate for the serial console. 307If a value of zero is specified, then the current baud rate (set by the 308BIOS) will be used. 309. 310.It Sy sunsum 311.Sy [ alpha , 312.Sy pmax , 313.Sy vax ] 314Recalculate and restore the Sun and 315.Nx Ns /sparc 316compatible checksum. 317.Em Note : 318The existing 319.Nx Ns /sparc 320disklabel should use no more than 4 partitions. 321. 322.It Sy timeout=<seconds> 323.Sy [ amd64 , 324.Sy i386 ] 325Set the timeout before the automatic boot begins to the given number of seconds. 326.El 327. 328.It Fl t Ar fstype 329Use 330.Ar fstype 331as the type of 332.Ar filesystem . 333The default operation is to attempt to auto-detect this setting. 334The following file system types are currently supported by 335.Nm : 336. 337.Bl -tag -offset indent -width raid 338. 339.It Sy ffs 340.Bx 341Fast File System. 342. 343.It Sy raid 344Mirrored RAIDframe File System. 345. 346.It Sy raw 347.Sq Raw 348image. 349Note: if a platform needs to hard-code the block offset of the secondary 350bootstrap, it cannot be searched for on this file system type, and must 351be provided with 352.Fl B Ar s2bno . 353.El 354. 355.It Fl v 356Verbose operation. 357. 358.It Ar filesystem 359The path name of the device or file system image that 360.Nm 361is to operate on. 362It is not necessary for 363.Ar filesystem 364to be a currently mounted file system. 365. 366.It Ar primary 367The path name of the 368.Dq primary 369boot block to install. 370The path name must refer to a file in a file system that is currently 371mounted. 372. 373.It Ar secondary 374The path name of the 375.Dq secondary 376boot block, relative to the root of 377the file system in the device or image specified by the 378.Ar filesystem 379argument. 380Note that this may refer to a file in a file system that is not mounted. 381Most systems require 382.Ar secondary 383to be in the 384.Dq root 385directory of the file system, so the leading 386.Dq Pa / 387is not necessary on 388.Ar secondary . 389.Pp 390Only certain combinations of 391platform 392.Pq Fl m Ar machine 393and file system type 394.Pq Fl t Ar fstype 395require that the name of the secondary bootstrap is 396supplied as 397.Ar secondary , 398so that information such as the disk block numbers occupied 399by the secondary bootstrap can be stored in the primary bootstrap. 400These are: 401.Bl -column "Platform" "File systems" -offset indent 402.It Sy "Platform" Ta Sy "File systems" 403.It macppc Ta ffs, raw 404.It news68k Ta ffs, raw 405.It newsmips Ta ffs, raw 406.It sparc Ta ffs, raid, raw 407.It sun2 Ta ffs, raw 408.It sun3 Ta ffs, raw 409.El 410.El 411.Pp 412.Nm 413exits 0 on success, and >0 if an error occurs. 414. 415.Sh ENVIRONMENT 416.Nm 417uses the following environment variables: 418. 419.Bl -tag -width "MACHINE" 420. 421.It Ev MACHINE 422Default value for 423.Ar machine , 424overriding the result from 425.Xr uname 3 . 426. 427.El 428. 429.Sh FILES 430Most 431.Nx 432ports will contain variations of the following files: 433.Bl -tag -width /usr/mdec/bootxx_ustarfs 434. 435.It Pa /usr/mdec/bootxx_ Ns Sy FSTYPE 436Primary bootstrap for file system type 437.Sy FSTYPE . 438Installed into the bootstrap area of the file system by 439.Nm . 440. 441.It Pa /usr/mdec/bootxx_fat16 442Primary bootstrap for MS-DOS 443.Sy FAT16 444file systems. 445This differs from 446.Nm bootxx_msdos 447in that it doesn't require the filesystem to have been initialised with 448any 449.Ql reserved sectors . 450It also uses the information in the 451.Ql Boot Parameter Block 452to get the media and filesytem properties. 453The 454.Ql hidden sectors 455field of the BPB must be the offset of the partition in the disk. 456This can be set using the 457.Fl b Ar s1bno 458option. 459. 460.It Pa /usr/mdec/bootxx_ffsv1 461Primary bootstrap for 462.Sy FFSv1 463file systems 464(the 465.Ql traditional 466file system prior to 467.Nx 6.0 ) . 468Use 469.Xr dumpfs 8 470to confirm the file system format is 471.Sy FFSv1 . 472. 473.It Pa /usr/mdec/bootxx_ffsv2 474Primary bootstrap for 475.Sy FFSv2 476file systems (the default file system for some platforms as of 477.Nx 6.0 ) . 478Use 479.Xr dumpfs 8 480to confirm the file system format is 481.Sy FFSv2 . 482. 483.It Pa /usr/mdec/bootxx_lfsv1 484Primary bootstrap for 485.Sy LFSv1 486file systems. 487. 488.It Pa /usr/mdec/bootxx_lfsv2 489Primary bootstrap for 490.Sy LFSv2 491file systems 492(the default LFS version). 493. 494.It Pa /usr/mdec/bootxx_msdos 495Primary bootstrap for MS-DOS 496.Sy FAT 497file systems. 498. 499.It Pa /usr/mdec/bootxx_ustarfs 500Primary bootstrap for 501.Sy TARFS 502boot images. 503This is used by various install media. 504. 505.It Pa /usr/mdec/boot. Ns Sy MACHINE 506Secondary bootstrap for machine type 507.Sy MACHINE . 508This should be installed into the file system before 509.Nm 510is run. 511. 512.It Pa /usr/mdec/boot 513Synonym for 514.Pa /usr/mdec/boot. Ns Sy MACHINE 515. 516.It Pa /boot. Ns Sy MACHINE 517Installed copy of secondary bootstrap for machine type 518.Sy MACHINE . 519. 520.It Pa /boot 521Installed copy of secondary bootstrap. 522Searched for by the primary bootstrap if 523.Pa /boot. Ns Sy MACHINE 524is not found. 525. 526.El 527. 528.Ss Nx Ns /evbmips files 529. 530The 531.Nx Ns /evbmips 532bootstrap files currently only apply to the SBMIPS kernels for the 533SiByte/Broadcom BCM1250 and BCM1480 CPUs. 534.Bl -tag -width /usr/mdec/sbmips/bootxx_cd9660 535. 536.It Pa /usr/mdec/sbmips/boot 537.Nx Ns /evbmips 538secondary bootstrap for 539.Sy FFSv1 , 540.Sy FFSv2 , 541.Sy LFSv1 , 542and 543.Sy LFSv2 . 544.It Pa /usr/mdec/sbmips/bootxx_cd9660 545SBMIPS primary bootstrap for ISO 9660 file system. 546.It Pa /usr/mdec/sbmips/bootxx_ffs 547SBMIPS primary bootstrap for FFSv1 and FFSv2 file system. 548.It Pa /usr/mdec/sbmips/bootxx_lfs 549SBMIPS primary bootstrap for LFSv1 and LFSv2 file system. 550.It Pa /usr/mdec/sbmips/netboot 551SBMIPS primary bootstrap for network root. 552.Pp 553Note that 554.Nm 555does not currently support evbmips directly. 556. 557.El 558. 559.Ss Nx Ns /hppa files 560. 561.Bl -tag -width /usr/mdec/bootxx_ustarfs 562. 563.It Pa /usr/mdec/xxboot 564.Nx Ns /hppa 565primary bootstrap for 566.Sy FFSv1 , 567.Sy FFSv2 , 568.Sy LFSv1 , 569and 570.Sy LFSv2 . 571.It Pa /usr/mdec/cdboot 572.Nx Ns /hppa 573primary bootstrap for ISO 9660 file system. 574.It Pa /usr/mdec/sdboot 575Synonym for 576.Pa /usr/mdec/xxboot 577. 578.El 579. 580.Ss Nx Ns /macppc files 581. 582.Bl -tag -width /usr/mdec/bootxx_ustarfs 583. 584.It Pa /usr/mdec/bootxx 585.Nx Ns /macppc 586primary bootstrap. 587. 588.It Pa /usr/mdec/ofwboot 589.Nx Ns /macppc 590secondary bootstrap. 591. 592.It Pa /ofwboot 593Installed copy of 594.Nx Ns /macppc 595secondary bootstrap. 596. 597.El 598. 599.Ss Nx Ns /next68k files 600. 601.Bl -tag -width /usr/mdec/bootxx_ustarfs 602. 603.It Pa /usr/mdec/boot 604.Nx Ns /next68k 605bootstrap. 606. 607.El 608. 609.Ss Nx Ns /sparc64 files 610. 611.Bl -tag -width /usr/mdec/bootxx_ustarfs 612. 613.It Pa /usr/mdec/bootblk 614.Nx Ns /sparc64 615primary bootstrap. 616. 617.It Pa /usr/mdec/ofwboot 618.Nx Ns /sparc64 619secondary bootstrap. 620. 621.It Pa /ofwboot 622Installed copy of 623.Nx Ns /sparc64 624secondary bootstrap. 625. 626.El 627. 628.Sh EXAMPLES 629. 630.Ss common 631Verbosely install the Berkeley Fast File System primary bootstrap on to disk 632.Sq sd0 : 633.Dl Ic installboot -v /dev/rsd0c /usr/mdec/bootxx_ffs 634Note: the 635.Dq whole disk 636partition (c on some ports, d on others) is used here, since the a partition 637probably is already opened (mounted as 638.Pa / ) , 639so 640.Nm 641would not be able to access it. 642.Pp 643Remove the primary bootstrap from disk 644.Sq sd1 : 645.Dl Ic installboot -c /dev/rsd1c 646. 647.Ss Nx Ns /amiga 648Modify the command line to change the default from "netbsd -ASn2" to 649"netbsd -S": 650.Dl Ic installboot -m amiga -o command="netbsd -S" /dev/rsd0a /usr/mdec/bootxx_ffs 651. 652.Ss Nx Ns /ews4800mips 653Install the System V Boot File System primary bootstrap on to disk 654.Sq sd0 , 655with the secondary bootstrap 656.Sq Pa /boot 657already present in the SysVBFS partition on the disk: 658.Dl Ic installboot /dev/rsd0c /usr/mdec/bootxx_bfs 659. 660.Ss Nx Ns /i386 and Nx Ns /amd64 661Install new boot blocks on an existing 662.Sy FFSv2 663mounted root file system on 664.Sq wd0 , 665setting the timeout to five seconds, after copying a new secondary 666bootstrap: 667.Dl Ic cp /usr/mdec/boot /boot 668.Dl Ic installboot -v -o timeout=5 /dev/rwd0a /usr/mdec/bootxx_ffsv2 669.Bd -ragged -offset indent-two -compact 670.Em Note : 671Pre 672.Nx 6.0 673systems used 674.Sy FFSv1 675file systems on these platforms; double check with 676.Xr dumpfs 8 677to be sure to use the correct secondary bootstrap. 678.Ed 679.Pp 680Create a bootable CD-ROM with an ISO 9660 681file system for an i386 system with a serial console: 682.Dl Ic mkdir cdrom 683.Dl Ic cp sys/arch/i386/compile/mykernel/netbsd cdrom/netbsd 684.Dl Ic cp /usr/mdec/boot cdrom/boot 685.Dl Ic cp /usr/mdec/bootxx_cd9660 bootxx 686.Dl Ic installboot -o console=com0,speed=19200 -m i386 -e bootxx 687.Dl Ic makefs -t cd9660 -o 'bootimage=i386;bootxx,no-emul-boot' boot.iso \ 688 cdrom 689. 690.Pp 691Create a bootable floppy disk with an FFSv1 692file system for a small custom kernel (note: bigger kernels needing 693multiple disks are handled with the ustarfs file system): 694.Dl Ic newfs -s 1440k /dev/rfd0a 695.Bd -ragged -offset indent-two -compact 696.Em Note : 697Ignore the warnings that 698.Xr newfs 8 699displays; it can not write a disklabel, 700which is not a problem for a floppy disk. 701.Ed 702.Dl Ic mount /dev/fd0a /mnt 703.Dl Ic cp /usr/mdec/boot /mnt/boot 704.Dl Ic gzip -9 < sys/arch/i386/compile/mykernel/netbsd > /mnt/netbsd.gz 705.Dl Ic umount /mnt 706.Dl Ic installboot -v /dev/rfd0a /usr/mdec/bootxx_ffsv1 707. 708.Pp 709Create a bootable FAT file system on 710.Sq wd1a , 711which should have the same offset and size as a FAT primary partition 712in the Master Boot Record (MBR): 713.Dl Ic newfs_msdos -r 16 /dev/rwd1a 714.Bd -ragged -offset indent-two -compact 715.Em Notes : 716The 717.Fl r Ar 16 718is to reserve space for the primary bootstrap. 719.Xr newfs_msdos 8 720will display an 721.Dq MBR type 722such as 723.Ql 1 , 724.Ql 4 , 725or 726.Ql 6 ; 727the MBR partition type of the appropriate primary partition should be 728changed to this value. 729.Ed 730.Dl Ic mount -t msdos /dev/wd1a /mnt 731.Dl Ic cp /usr/mdec/boot /mnt/boot 732.Dl Ic cp path/to/kernel /mnt/netbsd 733.Dl Ic umount /mnt 734.Dl Ic installboot -t raw /dev/rwd1a /usr/mdec/bootxx_msdos 735.Pp 736Make the existing FAT16 filesystem on 737.Sq sd0e 738bootable. 739This can be used to make USB memory bootable provided it has 512 byte 740sectors and that the manufacturer correctly initialised the file system. 741.Dl Ic mount -t msdos /dev/sd0e /mnt 742.Dl Ic cp /usr/mdec/boot /mnt/boot 743.Dl Ic cp path/to/kernel /mnt/netbsd 744.Dl Ic umount /mnt 745.Dl Ic installboot /dev/rsd0e /usr/mdec/bootxx_fat16 746It may also be necessary to use 747.Nm fdisk 748to make the device itself bootable. 749. 750.Pp 751Switch the existing installed bootstrap to use a serial console without 752reinstalling or altering other options such as timeout. 753.Dl Ic installboot -e -o console=com0 /dev/rwd0a 754.Ss Nx Ns /macppc 755Note the 756.Nm 757utility is only required for macppc machines with OpenFirmware version 2 758to boot. 759OpenFirmware 3 cannot load bootblocks specified in the Apple partition 760map. 761.Pp 762Install the Berkeley Fast File System primary bootstrap on to disk 763.Sq wd0 : 764.Dl Ic installboot /dev/rwd0c /usr/mdec/bootxx /ofwboot 765.Pp 766The secondary 767.Nx Ns /macppc 768bootstrap is located in 769.Pa /usr/mdec/ofwboot . 770.Pp 771The primary bootstrap requires the raw 772.Pa ofwboot 773for the secondary bootstrap, not 774.Pa ofwboot.xcf , 775which is used for the OpenFirmware to load kernels. 776.Ss Nx Ns /next68k 777Install the bootstrap on to disk 778.Sq sd0 : 779.Dl Ic installboot /dev/rsd0c /usr/mdec/boot 780. 781.Ss Nx Ns /pmax 782Install the Berkeley Fast File System primary bootstrap on to disk 783.Sq sd0 : 784.Dl Ic installboot /dev/rsd0c /usr/mdec/bootxx_ffs 785.Pp 786.Nx Ns /pmax 787requires that this file system starts at block 0 of the disk. 788.Pp 789Install the ISO 9660 primary bootstrap in the file 790.Pa /tmp/cd-image : 791.Dl Ic installboot -m pmax /tmp/cd-image /usr/mdec/bootxx_cd9660 792.Pp 793Make an ISO 9660 filesystem in the file 794.Pa /tmp/cd-image 795and install the ISO 9660 primary bootstrap in the filesystem, where the 796source directory for the ISO 9660 filesystem contains a kernel, the 797primary bootstrap 798.Pa bootxx_cd9660 799and the secondary bootstrap 800.Pa boot.pmax : 801.Dl Ic mkisofs -o /tmp/cd-image -a -l -v iso-source-dir 802.Dl ... 803.Dl 48 51 iso-source-dir/bootxx_cd9660 804.Dl ... 805.Dl Ic installboot -b `expr 48 \e* 4` /tmp/cd-image /usr/mdec/bootxx_cd9660 806. 807.Ss Nx Ns /sparc 808Install the Berkeley Fast File System primary bootstrap on to disk 809.Sq sd0 , 810with the secondary bootstrap 811.Sq Pa /boot 812already present: 813.Dl Ic installboot /dev/rsd0c /usr/mdec/bootxx /boot 814. 815.Ss Nx Ns /sparc64 816Install the primary bootstrap on to disk 817.Sq sd0 : 818.Dl Ic installboot /dev/rsd0c /usr/mdec/bootblk 819.Pp 820The secondary 821.Nx Ns /sparc64 822bootstrap is located in 823.Pa /usr/mdec/ofwboot . 824. 825.Ss Nx Ns /sun2 and Nx Ns /sun3 826Install the Berkeley Fast File System primary bootstrap on to disk 827.Sq sd0 , 828with the secondary bootstrap 829.Sq Pa /boot 830already present: 831.Dl Ic installboot /dev/rsd0c /usr/mdec/bootxx /boot 832. 833.Sh SEE ALSO 834.Xr uname 3 , 835.Xr boot 8 , 836.Xr disklabel 8 , 837.Xr dumpfs 8 , 838.Xr fdisk 8 , 839.Xr pxeboot 8 840. 841.Sh HISTORY 842This implementation of 843.Nm 844appeared in 845.Nx 1.6 . 846. 847.Sh AUTHORS 848.An -nosplit 849The machine independent portion of this implementation of 850.Nm 851was written by 852.An Luke Mewburn . 853The following people contributed to the various machine dependent 854back-ends: 855.An Simon Burge 856(pmax), 857.An Chris Demetriou 858(alpha), 859.An Matthew Fredette 860(sun2, sun3), 861.An Matthew Green 862(sparc64), 863.An Ross Harvey 864(alpha), 865.An Michael Hitch 866(amiga), 867.An Paul Kranenburg 868(sparc), 869.An David Laight 870(i386), 871.An Christian Limpach 872(next68k), 873.An Luke Mewburn 874(macppc), 875.An Matt Thomas 876(vax), 877.An Izumi Tsutsui 878(news68k, newsmips), 879and 880.An UCHIYAMA Yasushi 881(ews4800mips). 882. 883.Sh BUGS 884There are not currently primary bootstraps to support all file systems 885types which are capable of being the root file system. 886.Pp 887If a disk has been converted from 888.Sy FFS 889to 890.Sy RAID 891without the contents of the disk erased, then the original 892.Sy FFS 893installation may be auto-detected instead of the 894.Sy RAID 895installation. 896In this case, the 897.Fl t Ar raid 898option must be provided. 899. 900.Ss Nx Ns /alpha 901The 902.Nx Ns /alpha 903primary bootstrap program can only load the secondary bootstrap program 904from file systems starting at the beginning (block 0) of disks. 905Similarly, the secondary bootstrap program can only load kernels from 906file systems starting at the beginning of disks. 907.Pp 908The size of primary bootstrap programs is restricted to 7.5KB, even 909though some file systems (e.g., ISO 9660) are able to accommodate larger 910ones. 911. 912.Ss Nx Ns /hp300 913The disk must have a boot partition large enough to hold the bootstrap code. 914Currently the primary bootstrap must be a LIF format file. 915. 916.Ss Nx Ns /i386 and Nx Ns /amd64 917The bootstrap must be installed in the 918.Nx 919partition that starts at the beginning of the mbr partition. 920If that is a valid filesystem and contains the 921.Pa /boot 922program then it will be used as the root filesystem, otherwise the 923.Sq a 924partition will be booted. 925.Pp 926The size of primary bootstrap programs is restricted to 8KB, even 927though some file systems (e.g., ISO 9660) are able to accommodate larger 928ones. 929. 930.Ss Nx Ns /macppc 931Due to restrictions in 932.Nm 933and the secondary bootstrap implementation, file systems where kernels exist 934must start at the beginning of disks. 935.Pp 936Currently, 937.Nm 938doesn't recognize an existing Apple partition map on the disk 939and always writes a faked map to make disks bootable. 940.Pp 941The 942.Nx Ns /macppc 943bootstrap program can't load kernels from 944.Sy FFSv2 945partitions. 946.Ss Nx Ns /next68k 947The size of bootstrap programs is restricted to the free space before 948the file system at the beginning of the disk minus 8KB. 949. 950.Ss Nx Ns /pmax 951The 952.Nx Ns /pmax 953secondary bootstrap program can only load kernels from file 954systems starting at the beginning of disks. 955.Pp 956The size of primary bootstrap programs is restricted to 7.5KB, even 957though some file systems (e.g., ISO 9660) are able to accommodate larger 958ones. 959. 960.Ss Nx Ns /sun2 and Nx Ns /sun3 961The 962.Nx Ns /sun2 963and 964.Nx Ns /sun3 965secondary bootstrap program can only load kernels from file 966systems starting at the beginning of disks. 967. 968.Ss Nx Ns /vax 969The 970.Nx Ns /vax 971secondary bootstrap program can only load kernels from file systems 972starting at the beginning of disks. 973.Pp 974The size of primary bootstrap programs is restricted to 7.5KB, even 975though some file systems (e.g., ISO 9660) are able to accommodate larger 976ones. 977