1.\" $NetBSD: installboot.8,v 1.97 2019/05/07 08:14:59 wiz Exp $ 2.\" 3.\" Copyright (c) 2002-2019 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 May 5, 2019 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 135Some platforms, typically embedded system platforms, are umbrella platforms 136that support many different individual board types, each with their own 137boot loader binary and installation procedure requirements. 138On these platforms, it may be necessary to provide specific board type 139information to 140.Nm . 141Information about known boards and their requirements is loaded from a 142database at run-time. 143Sometimes these platforms also require the use of 3rd-party boot loader 144software, such as 145.Sy U-boot . 146To support these platforms, 147.Nm 148scans known locations for these 3rd-party boot loader packages for 149database overlays that contain additional board-specific boot loader 150installation information in a file called 151.Sq installboot.plist . 152.Pp 153The following platforms have this requirement and utilize this database 154overlay feature: 155.Sy evbarm . 156.Pp 157The options and arguments recognized by 158.Nm 159are as follows: 160. 161.Bl -tag -width "optionsxxx" 162. 163.It Fl B Ar s2bno 164When hard-coding the blocks of 165.Ar secondary 166into 167.Ar primary , 168start from block 169.Ar s2bno 170instead of trying to determine the block numbers occupied by 171.Ar secondary 172by examining 173.Ar filesystem . 174If this option is supplied, 175.Ar secondary 176should refer to an actual secondary bootstrap (rather than the 177file name of the one present in 178.Ar filesystem ) 179so that its size can be determined. 180. 181.It Fl b Ar s1bno 182Install 183.Ar primary 184at block number 185.Ar s1bno 186instead of the default location for the machine and file system type. 187.Sy [ alpha , 188.Sy i386/amd64 (bootxx_fat16 only) , 189.Sy pmax , 190.Sy vax ] 191. 192.It Fl c 193Clear (remove) any existing bootstrap instead of installing one. 194. 195.It Fl e 196Edit the options of an existing bootstrap. 197This can be used to change the options in bootxx_xxxfs files, 198raw disk partitions, and the 199.Pa pxeboot_ia32.bin 200file. 201With 202.Fl v 203and without 204.Fl o , 205show the current options. 206.Sy [ amd64 , i386 ] 207. 208.It Fl f 209Forces 210.Nm 211to ignore some errors. 212. 213.It Fl m Ar machine 214Use 215.Ar machine 216as the target machine type. 217The default machine is determined from 218.Xr uname 3 219and then 220.Ev MACHINE . 221The following machines are currently supported by 222.Nm : 223.Bd -ragged -offset indent 224.Sy alpha , 225.Sy amd64 , 226.Sy amiga , 227.Sy evbarm , 228.Sy ews4800mips , 229.Sy hp300 , 230.Sy hppa , 231.Sy i386 , 232.Sy landisk , 233.Sy macppc , 234.Sy news68k , 235.Sy newsmips , 236.Sy next68k , 237.Sy pmax , 238.Sy sparc , 239.Sy sparc64 , 240.Sy sun2 , 241.Sy sun3 , 242.Sy vax , 243.Sy x68k 244.Ed 245. 246. 247.It Fl n 248Do not write to 249.Ar filesystem . 250. 251.It Fl o Ar options 252Machine specific 253.Nm 254options, comma separated. 255.Pp 256Supported options are (with the machines for they are valid in brackets): 257. 258.Bl -tag -offset indent -width alphasum 259. 260.It Sy alphasum 261.Sy [ alpha ] 262Recalculate and restore the Alpha checksum. 263This is the default for 264.Nx Ns /alpha . 265. 266.It Sy append 267.Sy [ alpha , 268.Sy pmax , 269.Sy vax ] 270Append 271.Ar primary 272to the end of 273.Ar filesystem , 274which must be a regular file in this case. 275. 276.It Sy board=<board name> 277.Sy [ evbarm ] 278Specify the board type used to determine the correct boot loader image 279and installation procedure. 280If omitted, 281.Nm 282will attempt to guess the board type based on system information if run 283natively. 284. 285.It Sy bootconf 286.Sy [ amd64 , 287.Sy i386 ] 288(Don't) read a 289.Dq boot.cfg 290file. 291. 292.It Sy command=<boot command> 293.Sy [ amiga ] 294Modify the default boot command line. 295. 296.It Sy console=<console name> 297.Sy [ amd64 , 298.Sy i386 ] 299Set the console device, <console name> must be one of: 300pc, com0, com1, com2, com3, com0kbd, com1kbd, com2kbd, com3kbd or auto. 301. 302.It Sy dtb=/path/to/dtb/file 303.Sy [ evbarm ] 304Attempt to determine the board type from information in the device tree 305blob file at 306.Pa /path/to/dtb/file . 307If both 308.Sy board 309and 310.Sy dtb 311options are specified, 312.Sy board 313takes precendence. 314. 315.It Sy ioaddr=<ioaddr> 316.Sy [ amd64 , 317.Sy i386 ] 318Set the IO address to be used for the console serial port. 319Defaults to the IO address used by the system BIOS for the specified port. 320. 321.It Sy keymap=<keymap> 322.Sy [ amd64 , 323.Sy i386 ] 324Set a boot time keyboard translation map. 325Each character in <keymap> will be replaced by the one following it. 326For example, an argument of 327.Dq zyz 328would swap the lowercase letters 329.Sq y 330and 331.Sq z . 332. 333.It Sy media=<media type> 334.Sy [ evbarm ] 335Some boards require a different boot loader binary and/or installation 336procedure depending on what type of media will be used to boot the system. 337For such boards, this option is required, and omitting it will display a 338usage message that lists the valid media types for the board. 339For boards that do not require special media handling, this option is 340not allowed. 341Common values: sdmmc, emmc, usb. 342. 343.It Sy modules 344.Sy [ amd64 , 345.Sy i386 ] 346(Don't) load kernel modules. 347. 348.It Sy password=<password> 349.Sy [ amd64 , 350.Sy i386 ] 351Set the password which must be entered before the boot menu can be accessed. 352. 353.It Sy resetvideo 354.Sy [ amd64 , 355.Sy i386 ] 356Reset the video before booting. 357. 358.It Sy speed=<baud rate> 359.Sy [ amd64 , 360.Sy i386 ] 361Set the baud rate for the serial console. 362If a value of zero is specified, then the current baud rate (set by the 363BIOS) will be used. 364. 365.It Sy sunsum 366.Sy [ alpha , 367.Sy pmax , 368.Sy vax ] 369Recalculate and restore the Sun and 370.Nx Ns /sparc 371compatible checksum. 372.Em Note : 373The existing 374.Nx Ns /sparc 375disklabel should use no more than 4 partitions. 376. 377.It Sy timeout=<seconds> 378.Sy [ amd64 , 379.Sy i386 ] 380Set the timeout before the automatic boot begins to the given number of seconds. 381.El 382. 383.It Fl t Ar fstype 384Use 385.Ar fstype 386as the type of 387.Ar filesystem . 388The default operation is to attempt to auto-detect this setting. 389The following file system types are currently supported by 390.Nm : 391. 392.Bl -tag -offset indent -width raid 393. 394.It Sy ffs 395.Bx 396Fast File System. 397. 398.It Sy raid 399Mirrored RAIDframe File System. 400. 401.It Sy raw 402.Sq Raw 403image. 404Note: if a platform needs to hard-code the block offset of the secondary 405bootstrap, it cannot be searched for on this file system type, and must 406be provided with 407.Fl B Ar s2bno . 408.El 409. 410.It Fl v 411Verbose operation. 412. 413.It Ar filesystem 414The path name of the device or file system image that 415.Nm 416is to operate on. 417It is not necessary for 418.Ar filesystem 419to be a currently mounted file system. 420. 421.It Ar primary 422The path name of the 423.Dq primary 424boot block to install. 425The path name must refer to a file in a file system that is currently 426mounted. 427. 428.It Ar secondary 429The path name of the 430.Dq secondary 431boot block, relative to the root of 432the file system in the device or image specified by the 433.Ar filesystem 434argument. 435Note that this may refer to a file in a file system that is not mounted. 436Most systems require 437.Ar secondary 438to be in the 439.Dq root 440directory of the file system, so the leading 441.Dq Pa / 442is not necessary on 443.Ar secondary . 444.Pp 445Only certain combinations of 446platform 447.Pq Fl m Ar machine 448and file system type 449.Pq Fl t Ar fstype 450require that the name of the secondary bootstrap is 451supplied as 452.Ar secondary , 453so that information such as the disk block numbers occupied 454by the secondary bootstrap can be stored in the primary bootstrap. 455These are: 456.Bl -column "Platform" "File systems" -offset indent 457.It Sy "Platform" Ta Sy "File systems" 458.It macppc Ta ffs, raw 459.It news68k Ta ffs, raw 460.It newsmips Ta ffs, raw 461.It sparc Ta ffs, raid, raw 462.It sun2 Ta ffs, raw 463.It sun3 Ta ffs, raw 464.El 465.El 466.Pp 467.Nm 468exits 0 on success, and >0 if an error occurs. 469. 470.Sh ENVIRONMENT 471.Nm 472uses the following environment variables: 473. 474.Bl -tag -width "MACHINE" 475. 476.It Ev INSTALLBOOT_UBOOT_PATHS 477A colon-separated list of search paths to scan for 478.Sy U-boot 479packages with 480.Nm installboot 481installation overlays. 482If multiple overlays are found, overlays from paths closer to the front 483of the list take precedence. 484If not specified, the default path is 485.Pa /usr/pkg/share/u-boot . 486This environment variable is only used on platforms that support 487using 488.Sy U-boot : 489.Sy evbarm . 490. 491.It Ev MACHINE 492Default value for 493.Ar machine , 494overriding the result from 495.Xr uname 3 . 496. 497.El 498. 499.Sh FILES 500Most 501.Nx 502ports will contain variations of the following files: 503.Bl -tag -width /usr/mdec/bootxx_ustarfs 504. 505.It Pa /usr/mdec/bootxx_ Ns Sy FSTYPE 506Primary bootstrap for file system type 507.Sy FSTYPE . 508Installed into the bootstrap area of the file system by 509.Nm . 510. 511.It Pa /usr/mdec/bootxx_fat16 512Primary bootstrap for MS-DOS 513.Sy FAT16 514file systems. 515This differs from 516.Nm bootxx_msdos 517in that it doesn't require the filesystem to have been initialised with 518any 519.Ql reserved sectors . 520It also uses the information in the 521.Ql Boot Parameter Block 522to get the media and filesytem properties. 523The 524.Ql hidden sectors 525field of the BPB must be the offset of the partition in the disk. 526This can be set using the 527.Fl b Ar s1bno 528option. 529. 530.It Pa /usr/mdec/bootxx_ffsv1 531Primary bootstrap for 532.Sy FFSv1 533file systems 534(the 535.Ql traditional 536file system prior to 537.Nx 6.0 ) . 538Use 539.Xr dumpfs 8 540to confirm the file system format is 541.Sy FFSv1 . 542. 543.It Pa /usr/mdec/bootxx_ffsv2 544Primary bootstrap for 545.Sy FFSv2 546file systems (the default file system for some platforms as of 547.Nx 6.0 ) . 548Use 549.Xr dumpfs 8 550to confirm the file system format is 551.Sy FFSv2 . 552. 553.It Pa /usr/mdec/bootxx_lfsv1 554Primary bootstrap for 555.Sy LFSv1 556file systems. 557. 558.It Pa /usr/mdec/bootxx_lfsv2 559Primary bootstrap for 560.Sy LFSv2 561file systems 562(the default LFS version). 563. 564.It Pa /usr/mdec/bootxx_msdos 565Primary bootstrap for MS-DOS 566.Sy FAT 567file systems. 568. 569.It Pa /usr/mdec/bootxx_ustarfs 570Primary bootstrap for 571.Sy TARFS 572boot images. 573This is used by various install media. 574. 575.It Pa /usr/mdec/boot. Ns Sy MACHINE 576Secondary bootstrap for machine type 577.Sy MACHINE . 578This should be installed into the file system before 579.Nm 580is run. 581. 582.It Pa /usr/mdec/boot 583Synonym for 584.Pa /usr/mdec/boot. Ns Sy MACHINE 585. 586.It Pa /boot. Ns Sy MACHINE 587Installed copy of secondary bootstrap for machine type 588.Sy MACHINE . 589. 590.It Pa /boot 591Installed copy of secondary bootstrap. 592Searched for by the primary bootstrap if 593.Pa /boot. Ns Sy MACHINE 594is not found. 595. 596.El 597. 598.Ss Nx Ns /evbarm files 599The 600.Nx Ns /evbarm 601platform covers a wide variety of board types, many of which use 602.Sy U-boot . 603Running 604.Nm 605with no options will display a list of known boards. 606Using the verbose option will also display information about which 607.Sy U-boot 608package needs to be installed to support that board, and if the required 609.Sy U-boot 610package is installed, the path at which it is located. 611.Bl -tag -width /usr/pkg/share/u-boot 612.It Pa /usr/pkg/share/u-boot 613The default location scanned for 614.Sy U-boot 615packages with installation overlays. 616.It Pa /usr/share/installboot/evbarm/boards.plist 617Base board database, used to provide information about which 618.Sy U-boot 619package is required for a given board. 620.El 621. 622.Ss Nx Ns /evbmips files 623. 624The 625.Nx Ns /evbmips 626bootstrap files currently only apply to the SBMIPS kernels for the 627SiByte/Broadcom BCM1250 and BCM1480 CPUs. 628.Bl -tag -width /usr/mdec/sbmips/bootxx_cd9660 629. 630.It Pa /usr/mdec/sbmips/boot 631.Nx Ns /evbmips 632secondary bootstrap for 633.Sy FFSv1 , 634.Sy FFSv2 , 635.Sy LFSv1 , 636and 637.Sy LFSv2 . 638.It Pa /usr/mdec/sbmips/bootxx_cd9660 639SBMIPS primary bootstrap for ISO 9660 file system. 640.It Pa /usr/mdec/sbmips/bootxx_ffs 641SBMIPS primary bootstrap for FFSv1 and FFSv2 file system. 642.It Pa /usr/mdec/sbmips/bootxx_lfs 643SBMIPS primary bootstrap for LFSv1 and LFSv2 file system. 644.It Pa /usr/mdec/sbmips/netboot 645SBMIPS primary bootstrap for network root. 646.Pp 647Note that 648.Nm 649does not currently support evbmips directly. 650. 651.El 652. 653.Ss Nx Ns /hppa files 654. 655.Bl -tag -width /usr/mdec/bootxx_ustarfs 656. 657.It Pa /usr/mdec/xxboot 658.Nx Ns /hppa 659primary bootstrap for 660.Sy FFSv1 , 661.Sy FFSv2 , 662.Sy LFSv1 , 663and 664.Sy LFSv2 . 665.It Pa /usr/mdec/cdboot 666.Nx Ns /hppa 667primary bootstrap for ISO 9660 file system. 668.It Pa /usr/mdec/sdboot 669Synonym for 670.Pa /usr/mdec/xxboot 671. 672.El 673. 674.Ss Nx Ns /macppc files 675. 676.Bl -tag -width /usr/mdec/bootxx_ustarfs 677. 678.It Pa /usr/mdec/bootxx 679.Nx Ns /macppc 680primary bootstrap. 681. 682.It Pa /usr/mdec/ofwboot 683.Nx Ns /macppc 684secondary bootstrap. 685. 686.It Pa /ofwboot 687Installed copy of 688.Nx Ns /macppc 689secondary bootstrap. 690. 691.El 692. 693.Ss Nx Ns /next68k files 694. 695.Bl -tag -width /usr/mdec/bootxx_ustarfs 696. 697.It Pa /usr/mdec/boot 698.Nx Ns /next68k 699bootstrap. 700. 701.El 702. 703.Ss Nx Ns /sparc64 files 704. 705.Bl -tag -width /usr/mdec/bootxx_ustarfs 706. 707.It Pa /usr/mdec/bootblk 708.Nx Ns /sparc64 709primary bootstrap. 710. 711.It Pa /usr/mdec/ofwboot 712.Nx Ns /sparc64 713secondary bootstrap. 714. 715.It Pa /ofwboot 716Installed copy of 717.Nx Ns /sparc64 718secondary bootstrap. 719. 720.El 721. 722.Sh EXAMPLES 723. 724.Ss common 725Verbosely install the Berkeley Fast File System primary bootstrap on to disk 726.Sq sd0 : 727.Dl Ic installboot -v /dev/rsd0c /usr/mdec/bootxx_ffs 728Note: the 729.Dq whole disk 730partition (c on some ports, d on others) is used here, since the a partition 731probably is already opened (mounted as 732.Pa / ) , 733so 734.Nm 735would not be able to access it. 736.Pp 737Remove the primary bootstrap from disk 738.Sq sd1 : 739.Dl Ic installboot -c /dev/rsd1c 740. 741.Ss Nx Ns /amiga 742Modify the command line to change the default from "netbsd -ASn2" to 743"netbsd -S": 744.Dl Ic installboot -m amiga -o command="netbsd -S" /dev/rsd0a /usr/mdec/bootxx_ffs 745. 746.Ss Nx Ns /evbarm 747Install the 748.Sy U-boot 749boot loader for a Pinebook into an image that will be written to 750an SDMMC card: 751.Dl Ic installboot -m evbarm -o board=pine64,pinebook arm64.img 752.Pp 753Install / update the 754.Sy U-boot 755boot loader for the current running system on the eMMC device 756.Sq ld0 757and display verbose information about the procedure: 758.Dl Ic installboot -v /dev/rld0c 759.Pp 760Install a specific 761.Sy U-boot 762package for a BeagleBone Black into an image that will be written 763to an SDMMC card: 764.Dl Ic installboot -m evbarm -o board=ti,am335x-bone-black armv7.img \ 765 /path/to/experimental/u-boot/package 766. 767.Ss Nx Ns /ews4800mips 768Install the System V Boot File System primary bootstrap on to disk 769.Sq sd0 , 770with the secondary bootstrap 771.Sq Pa /boot 772already present in the SysVBFS partition on the disk: 773.Dl Ic installboot /dev/rsd0c /usr/mdec/bootxx_bfs 774. 775.Ss Nx Ns /i386 and Nx Ns /amd64 776Install new boot blocks on an existing 777.Sy FFSv2 778mounted root file system on 779.Sq wd0 , 780setting the timeout to five seconds, after copying a new secondary 781bootstrap: 782.Dl Ic cp /usr/mdec/boot /boot 783.Dl Ic installboot -v -o timeout=5 /dev/rwd0a /usr/mdec/bootxx_ffsv2 784.Bd -ragged -offset indent-two -compact 785.Em Note : 786Pre 787.Nx 6.0 788systems used 789.Sy FFSv1 790file systems on these platforms; double check with 791.Xr dumpfs 8 792to be sure to use the correct secondary bootstrap. 793.Ed 794.Pp 795Create a bootable CD-ROM with an ISO 9660 796file system for an i386 system with a serial console: 797.Dl Ic mkdir cdrom 798.Dl Ic cp sys/arch/i386/compile/mykernel/netbsd cdrom/netbsd 799.Dl Ic cp /usr/mdec/boot cdrom/boot 800.Dl Ic cp /usr/mdec/bootxx_cd9660 bootxx 801.Dl Ic installboot -o console=com0,speed=19200 -m i386 -e bootxx 802.Dl Ic makefs -t cd9660 -o 'bootimage=i386;bootxx,no-emul-boot' boot.iso \ 803 cdrom 804. 805.Pp 806Create a bootable floppy disk with an FFSv1 807file system for a small custom kernel (note: bigger kernels needing 808multiple disks are handled with the ustarfs file system): 809.Dl Ic newfs -s 1440k /dev/rfd0a 810.Bd -ragged -offset indent-two -compact 811.Em Note : 812Ignore the warnings that 813.Xr newfs 8 814displays; it can not write a disklabel, 815which is not a problem for a floppy disk. 816.Ed 817.Dl Ic mount /dev/fd0a /mnt 818.Dl Ic cp /usr/mdec/boot /mnt/boot 819.Dl Ic gzip -9 < sys/arch/i386/compile/mykernel/netbsd > /mnt/netbsd.gz 820.Dl Ic umount /mnt 821.Dl Ic installboot -v /dev/rfd0a /usr/mdec/bootxx_ffsv1 822. 823.Pp 824Create a bootable FAT file system on 825.Sq wd1a , 826which should have the same offset and size as a FAT primary partition 827in the Master Boot Record (MBR): 828.Dl Ic newfs_msdos -r 16 /dev/rwd1a 829.Bd -ragged -offset indent-two -compact 830.Em Notes : 831The 832.Fl r Ar 16 833is to reserve space for the primary bootstrap. 834.Xr newfs_msdos 8 835will display an 836.Dq MBR type 837such as 838.Ql 1 , 839.Ql 4 , 840or 841.Ql 6 ; 842the MBR partition type of the appropriate primary partition should be 843changed to this value. 844.Ed 845.Dl Ic mount -t msdos /dev/wd1a /mnt 846.Dl Ic cp /usr/mdec/boot /mnt/boot 847.Dl Ic cp path/to/kernel /mnt/netbsd 848.Dl Ic umount /mnt 849.Dl Ic installboot -t raw /dev/rwd1a /usr/mdec/bootxx_msdos 850.Pp 851Make the existing FAT16 filesystem on 852.Sq sd0e 853bootable. 854This can be used to make USB memory bootable provided it has 512 byte 855sectors and that the manufacturer correctly initialised the file system. 856.Dl Ic mount -t msdos /dev/sd0e /mnt 857.Dl Ic cp /usr/mdec/boot /mnt/boot 858.Dl Ic cp path/to/kernel /mnt/netbsd 859.Dl Ic umount /mnt 860.Dl Ic installboot /dev/rsd0e /usr/mdec/bootxx_fat16 861It may also be necessary to use 862.Nm fdisk 863to make the device itself bootable. 864. 865.Pp 866Switch the existing installed bootstrap to use a serial console without 867reinstalling or altering other options such as timeout. 868.Dl Ic installboot -e -o console=com0 /dev/rwd0a 869.Ss Nx Ns /macppc 870Note the 871.Nm 872utility is only required for macppc machines with OpenFirmware version 2 873to boot. 874OpenFirmware 3 cannot load bootblocks specified in the Apple partition 875map. 876.Pp 877Install the Berkeley Fast File System primary bootstrap on to disk 878.Sq wd0 : 879.Dl Ic installboot /dev/rwd0c /usr/mdec/bootxx /ofwboot 880.Pp 881The secondary 882.Nx Ns /macppc 883bootstrap is located in 884.Pa /usr/mdec/ofwboot . 885.Pp 886The primary bootstrap requires the raw 887.Pa ofwboot 888for the secondary bootstrap, not 889.Pa ofwboot.xcf , 890which is used for the OpenFirmware to load kernels. 891.Ss Nx Ns /next68k 892Install the bootstrap on to disk 893.Sq sd0 : 894.Dl Ic installboot /dev/rsd0c /usr/mdec/boot 895. 896.Ss Nx Ns /pmax 897Install the Berkeley Fast File System primary bootstrap on to disk 898.Sq sd0 : 899.Dl Ic installboot /dev/rsd0c /usr/mdec/bootxx_ffs 900.Pp 901.Nx Ns /pmax 902requires that this file system starts at block 0 of the disk. 903.Pp 904Install the ISO 9660 primary bootstrap in the file 905.Pa /tmp/cd-image : 906.Dl Ic installboot -m pmax /tmp/cd-image /usr/mdec/bootxx_cd9660 907.Pp 908Make an ISO 9660 filesystem in the file 909.Pa /tmp/cd-image 910and install the ISO 9660 primary bootstrap in the filesystem, where the 911source directory for the ISO 9660 filesystem contains a kernel, the 912primary bootstrap 913.Pa bootxx_cd9660 914and the secondary bootstrap 915.Pa boot.pmax : 916.Dl Ic mkisofs -o /tmp/cd-image -a -l -v iso-source-dir 917.Dl ... 918.Dl 48 51 iso-source-dir/bootxx_cd9660 919.Dl ... 920.Dl Ic installboot -b `expr 48 \e* 4` /tmp/cd-image /usr/mdec/bootxx_cd9660 921. 922.Ss Nx Ns /sparc 923Install the Berkeley Fast File System primary bootstrap on to disk 924.Sq sd0 , 925with the secondary bootstrap 926.Sq Pa /boot 927already present: 928.Dl Ic installboot /dev/rsd0c /usr/mdec/bootxx /boot 929. 930.Ss Nx Ns /sparc64 931Install the primary bootstrap on to disk 932.Sq sd0 : 933.Dl Ic installboot /dev/rsd0c /usr/mdec/bootblk 934.Pp 935The secondary 936.Nx Ns /sparc64 937bootstrap is located in 938.Pa /usr/mdec/ofwboot . 939. 940.Ss Nx Ns /sun2 and Nx Ns /sun3 941Install the Berkeley Fast File System primary bootstrap on to disk 942.Sq sd0 , 943with the secondary bootstrap 944.Sq Pa /boot 945already present: 946.Dl Ic installboot /dev/rsd0c /usr/mdec/bootxx /boot 947. 948.Sh SEE ALSO 949.Xr uname 3 , 950.Xr boot 8 , 951.Xr disklabel 8 , 952.Xr dumpfs 8 , 953.Xr fdisk 8 , 954.Xr x86/pxeboot 8 955. 956.Sh HISTORY 957This implementation of 958.Nm 959appeared in 960.Nx 1.6 . 961. 962.Sh AUTHORS 963.An -nosplit 964The machine independent portion of this implementation of 965.Nm 966was written by 967.An Luke Mewburn . 968The following people contributed to the various machine dependent 969back-ends: 970.An Simon Burge 971(pmax), 972.An Chris Demetriou 973(alpha), 974.An Matthew Fredette 975(sun2, sun3), 976.An Matthew Green 977(sparc64), 978.An Ross Harvey 979(alpha), 980.An Michael Hitch 981(amiga), 982.An Paul Kranenburg 983(sparc), 984.An David Laight 985(i386), 986.An Christian Limpach 987(next68k), 988.An Luke Mewburn 989(macppc), 990.An Matt Thomas 991(vax), 992.An Izumi Tsutsui 993(news68k, newsmips), 994and 995.An UCHIYAMA Yasushi 996(ews4800mips). 997. 998.Sh BUGS 999There are not currently primary bootstraps to support all file systems 1000types which are capable of being the root file system. 1001.Pp 1002If a disk has been converted from 1003.Sy FFS 1004to 1005.Sy RAID 1006without the contents of the disk erased, then the original 1007.Sy FFS 1008installation may be auto-detected instead of the 1009.Sy RAID 1010installation. 1011In this case, the 1012.Fl t Ar raid 1013option must be provided. 1014. 1015.Ss Nx Ns /alpha 1016The 1017.Nx Ns /alpha 1018primary bootstrap program can only load the secondary bootstrap program 1019from file systems starting at the beginning (block 0) of disks. 1020Similarly, the secondary bootstrap program can only load kernels from 1021file systems starting at the beginning of disks. 1022.Pp 1023The size of primary bootstrap programs is restricted to 7.5KB, even 1024though some file systems (e.g., ISO 9660) are able to accommodate larger 1025ones. 1026. 1027.Ss Nx Ns /hp300 1028The disk must have a boot partition large enough to hold the bootstrap code. 1029Currently the primary bootstrap must be a LIF format file. 1030. 1031.Ss Nx Ns /i386 and Nx Ns /amd64 1032The bootstrap must be installed in the 1033.Nx 1034partition that starts at the beginning of the mbr partition. 1035If that is a valid filesystem and contains the 1036.Pa /boot 1037program then it will be used as the root filesystem, otherwise the 1038.Sq a 1039partition will be booted. 1040.Pp 1041The size of primary bootstrap programs is restricted to 8KB, even 1042though some file systems (e.g., ISO 9660) are able to accommodate larger 1043ones. 1044. 1045.Ss Nx Ns /macppc 1046Due to restrictions in 1047.Nm 1048and the secondary bootstrap implementation, file systems where kernels exist 1049must start at the beginning of disks. 1050.Pp 1051Currently, 1052.Nm 1053doesn't recognize an existing Apple partition map on the disk 1054and always writes a faked map to make disks bootable. 1055.Pp 1056The 1057.Nx Ns /macppc 1058bootstrap program can't load kernels from 1059.Sy FFSv2 1060partitions. 1061.Ss Nx Ns /next68k 1062The size of bootstrap programs is restricted to the free space before 1063the file system at the beginning of the disk minus 8KB. 1064. 1065.Ss Nx Ns /pmax 1066The 1067.Nx Ns /pmax 1068secondary bootstrap program can only load kernels from file 1069systems starting at the beginning of disks. 1070.Pp 1071The size of primary bootstrap programs is restricted to 7.5KB, even 1072though some file systems (e.g., ISO 9660) are able to accommodate larger 1073ones. 1074. 1075.Ss Nx Ns /sun2 and Nx Ns /sun3 1076The 1077.Nx Ns /sun2 1078and 1079.Nx Ns /sun3 1080secondary bootstrap program can only load kernels from file 1081systems starting at the beginning of disks. 1082. 1083.Ss Nx Ns /vax 1084The 1085.Nx Ns /vax 1086secondary bootstrap program can only load kernels from file systems 1087starting at the beginning of disks. 1088.Pp 1089The size of primary bootstrap programs is restricted to 7.5KB, even 1090though some file systems (e.g., ISO 9660) are able to accommodate larger 1091ones. 1092