xref: /netbsd-src/usr.sbin/installboot/installboot.8 (revision 41c8bfff294b632812bb999e419d8c19d630c5fb)
1*41c8bfffSchristos.\"	$NetBSD: installboot.8,v 1.113 2024/12/29 16:44:22 christos Exp $
207e46180Slukem.\"
3979e90aeSlukem.\" Copyright (c) 2002-2023 The NetBSD Foundation, Inc.
407e46180Slukem.\" All rights reserved.
507e46180Slukem.\"
607e46180Slukem.\" This code is derived from software contributed to The NetBSD Foundation
707e46180Slukem.\" by Luke Mewburn of Wasabi Systems.
807e46180Slukem.\"
907e46180Slukem.\" Redistribution and use in source and binary forms, with or without
1007e46180Slukem.\" modification, are permitted provided that the following conditions
1107e46180Slukem.\" are met:
1207e46180Slukem.\" 1. Redistributions of source code must retain the above copyright
1307e46180Slukem.\"    notice, this list of conditions and the following disclaimer.
1407e46180Slukem.\" 2. Redistributions in binary form must reproduce the above copyright
1507e46180Slukem.\"    notice, this list of conditions and the following disclaimer in the
1607e46180Slukem.\"    documentation and/or other materials provided with the distribution.
1707e46180Slukem.\"
1807e46180Slukem.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
1907e46180Slukem.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2007e46180Slukem.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2107e46180Slukem.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2207e46180Slukem.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2307e46180Slukem.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2407e46180Slukem.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2507e46180Slukem.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2607e46180Slukem.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2707e46180Slukem.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2807e46180Slukem.\" POSSIBILITY OF SUCH DAMAGE.
2907e46180Slukem.\"
30fb04e69cSuwe.
31fb04e69cSuwe.\" Prevent accidental hyphenation after the hyphen in "U-Boot"
32fb04e69cSuwe.\" Usage: \*(UB
33fb04e69cSuwe.ds UB U\(hyBoot
34fb04e69cSuwe.
35*41c8bfffSchristos.Dd December 29, 2024
3607e46180Slukem.Dt INSTALLBOOT 8
3707e46180Slukem.Os
3807e46180Slukem.Sh NAME
3907e46180Slukem.Nm installboot
4007e46180Slukem.Nd install disk bootstrap software
4107e46180Slukem.
4207e46180Slukem.Sh SYNOPSIS
43990562bfSwiz.Nm
44486d4119Sdsl.Op Fl fnv
451bdd92eeSlukem.Op Fl B Ar s2bno
46d1115a4cSwiz.Op Fl b Ar s1bno
47d1115a4cSwiz.Op Fl m Ar machine
48d1115a4cSwiz.Op Fl o Ar options
49d1115a4cSwiz.Op Fl t Ar fstype
50a2c7f8e9Sriastradh.Op Fl u Ar U-Boot-paths
5107e46180Slukem.Ar filesystem
52d2804426Slukem.Ar primary
53d2804426Slukem.Op Ar secondary
54990562bfSwiz.Nm
5507e46180Slukem.Fl c
56486d4119Sdsl.Op Fl fnv
5707e46180Slukem.Op Fl m Ar machine
5807e46180Slukem.Op Fl o Ar options
5907e46180Slukem.Op Fl t Ar fstype
6007e46180Slukem.Ar filesystem
618c893c96Sdsl.Nm
628c893c96Sdsl.Fl e
63486d4119Sdsl.Op Fl fnv
648c893c96Sdsl.Op Fl m Ar machine
658c893c96Sdsl.Op Fl o Ar options
668c893c96Sdsl.Ar bootstrap
6707e46180Slukem.
6807e46180Slukem.Sh DESCRIPTION
6907e46180SlukemThe
7007e46180Slukem.Nm
71c1455b1bSlukemutility installs and removes
72c1455b1bSlukem.Nx
7367c2e401Slukemdisk bootstrap software into a file system.
7407e46180Slukem.Nm
7507e46180Slukemcan install
76d2804426Slukem.Ar primary
7707e46180Slukeminto
7807e46180Slukem.Ar filesystem ,
7907e46180Slukemor disable an existing bootstrap in
8007e46180Slukem.Ar filesystem .
81fb04e69cSuwe.Ss Traditional NetBSD boot
82c1455b1bSlukemGenerally,
83c1455b1bSlukem.Nx
84c1455b1bSlukemdisk bootstrap software consists of two parts: a
85c1455b1bSlukem.Dq primary
86c1455b1bSlukembootstrap program usually written into the disklabel area of the
8767c2e401Slukemfile system by
88990562bfSwiz.Nm ,
89c1455b1bSlukemand a
90c1455b1bSlukem.Dq secondary
9167c2e401Slukembootstrap program that usually resides as an ordinary file in the file system.
92c1455b1bSlukem.Pp
93c1455b1bSlukemWhen booting, the primary bootstrap program is loaded and invoked by
94fb04e69cSuwethe machine's
95fb04e69cSuwe.Tn PROM
96fb04e69cSuweor
97fb04e69cSuwe.Tn BIOS .
98c1455b1bSlukemAfter receiving control of the system it loads and runs the secondary
99c1455b1bSlukembootstrap program, which in turn loads and runs the kernel.
100c1455b1bSlukemThe secondary bootstrap may allow control over various boot parameters
101c1455b1bSlukempassed to the kernel.
102c1455b1bSlukem.Pp
10367c2e401SlukemPerform the following steps to make a file system bootable:
10467c2e401Slukem.Bl -enum
10567c2e401Slukem.It
106fb04e69cSuweCopy the secondary bootstrap
107fb04e69cSuwe.Po
108fb04e69cSuweusually
109fb04e69cSuwe.Pa /usr/mdec/boot. Ns Aq Ar MACHINE\^
110724345d9Sgrantor
111fb04e69cSuwe.Pa /usr/mdec/boot
112fb04e69cSuwe.Pc
11367c2e401Slukemto the root directory of the target file system.
11467c2e401Slukem.
11567c2e401Slukem.It
11667c2e401SlukemUse
117c1455b1bSlukem.Nm
118c1455b1bSlukemto install the primary bootstrap program
119fb04e69cSuwe.Po
120fb04e69cSuweusually
121fb04e69cSuwe.Pa /usr/mdec/bootxx_ Ns Aq Ar FSTYPE\^
122fb04e69cSuwe.Pc
12367c2e401Slukeminto
12467c2e401Slukem.Ar filesystem .
12567c2e401Slukem.Pp
126b0dfae03SlukemThe following platforms do not require this step if the primary bootstrap
127b0dfae03Slukemalready exists and the secondary bootstrap file is just being updated:
1284ee46bcfSlukem.Sy alpha ,
1299eb2f516Swiz.Sy amd64 ,
130e7852b05Smhitch.Sy amiga ,
131ed45ba76Sdsl.Sy i386 ,
1324ee46bcfSlukem.Sy pmax ,
1334ee46bcfSlukem.Sy sparc64 ,
13467c2e401Slukemand
1354ee46bcfSlukem.Sy vax .
13667c2e401Slukem.Pp
1373122f2a2SwizThe following platform does not require the first step since a
1383122f2a2Swizsingle bootstrap file is used.
1393122f2a2SwizThe single bootstrap is installed like the primary bootstrap on
1403122f2a2Swizother platforms:
141e05d95b9Scl.Sy next68k .
14267c2e401Slukem.El
14307e46180Slukem.Pp
144eec34178SriastradhOn some architectures the options of an existing installed bootstrap,
145eec34178Sriastradhor those of a bootstrap file can be changed.
146eec34178SriastradhInstalling a new primary bootstrap will reset those options to default
147eec34178Sriastradhvalues.
148eec34178Sriastradh.Ss Embedded board types
14902d67d10SthorpejSome platforms, typically embedded system platforms, are umbrella platforms
15002d67d10Sthorpejthat support many different individual board types, each with their own
15102d67d10Sthorpejboot loader binary and installation procedure requirements.
15202d67d10SthorpejOn these platforms, it may be necessary to provide specific board type
15302d67d10Sthorpejinformation to
15402d67d10Sthorpej.Nm .
15502d67d10SthorpejInformation about known boards and their requirements is loaded from a
15602d67d10Sthorpejdatabase at run-time.
15702d67d10SthorpejSometimes these platforms also require the use of 3rd-party boot loader
158fb04e69cSuwesoftware, such as \*(UB.
15902d67d10SthorpejTo support these platforms,
16002d67d10Sthorpej.Nm
16102d67d10Sthorpejscans known locations for these 3rd-party boot loader packages for
16202d67d10Sthorpejdatabase overlays that contain additional board-specific boot loader
16302d67d10Sthorpejinstallation information in a file called
164fb04e69cSuwe.Pa installboot.plist .
16502d67d10Sthorpej.Pp
16602d67d10SthorpejThe following platforms have this requirement and utilize this database
16702d67d10Sthorpejoverlay feature:
16802d67d10Sthorpej.Sy evbarm .
169eec34178Sriastradh.Ss UEFI boot
170fb04e69cSuweOn platforms that boot with
171fb04e69cSuwe.Tn UEFI ,
172fb04e69cSuwethere is a single boot loader in the
173fb04e69cSuwe.Tn EFI
174fb04e69cSuwesystem partition at
175fb04e69cSuwe.Pa EFI/boot/boot Ns Ao Ar ARCH\^ Ac Ns Pa .efi
176eec34178Sriastradhwhere
177fb04e69cSuwe.Ar ARCH
178fb04e69cSuweis the
179fb04e69cSuwe.Tn UEFI
180fb04e69cSuwename for the architecture, such as
181fb04e69cSuwe.Li ia32
182fb04e69cSuwe.Pq Nx Ns /i386 ,
183fb04e69cSuwe.Li x64
184fb04e69cSuwe.Pq Nx Ns /amd64 ,
185eec34178Sriastradhor
186fb04e69cSuwe.Li aa64
187fb04e69cSuwe.Pq Nx Ns /aarch64 .
18802d67d10Sthorpej.Pp
189eec34178Sriastradh.Nm
190fb04e69cSuweis not needed for
191fb04e69cSuwe.Tn UEFI
192fb04e69cSuweboot.
193fb04e69cSuweHowever, it may be used on a platform that supports
194fb04e69cSuwe.Tn UEFI
195fb04e69cSuweboot to make a
196eec34178Sriastradhhybrid image that can be booted
197eec34178Sriastradh.Em either
198fb04e69cSuwewith
199fb04e69cSuwe.Tn UEFI
200fb04e69cSuweboot or with, e.g.,
201fb04e69cSuwe.Tn BIOS
202fb04e69cSuweor \*(UB.
203fb04e69cSuweHybrid images may also require a special
204fb04e69cSuwe.Tn GPT
205fb04e69cSuwefor
206fb04e69cSuwe.Tn BIOS
207fb04e69cSuweboot; see
208eec34178Sriastradh.Xr gpt 8 .
209eec34178Sriastradh.Ss Options
2102a820a18SlukemThe options and arguments recognized by
21107e46180Slukem.Nm
21207e46180Slukemare as follows:
21307e46180Slukem.
214fb04e69cSuwe.Bl -tag -width Fl
21507e46180Slukem.
2161bdd92eeSlukem.It Fl B Ar s2bno
2171bdd92eeSlukemWhen hard-coding the blocks of
2181bdd92eeSlukem.Ar secondary
2191bdd92eeSlukeminto
2201bdd92eeSlukem.Ar primary ,
2211bdd92eeSlukemstart from block
2221bdd92eeSlukem.Ar s2bno
2231bdd92eeSlukeminstead of trying to determine the block numbers occupied by
2241bdd92eeSlukem.Ar secondary
2251bdd92eeSlukemby examining
2261bdd92eeSlukem.Ar filesystem .
2271bdd92eeSlukemIf this option is supplied,
2281bdd92eeSlukem.Ar secondary
229fb04e69cSuweshould refer to an actual secondary bootstrap
230fb04e69cSuwe.Po
231fb04e69cSuwerather than the file name of the one present in
232fb04e69cSuwe.Ar filesystem
233fb04e69cSuwe.Pc
2341bdd92eeSlukemso that its size can be determined.
23507e46180Slukem.
236d1115a4cSwiz.It Fl b Ar s1bno
237d1115a4cSwizInstall
238d1115a4cSwiz.Ar primary
239d1115a4cSwizat block number
240d1115a4cSwiz.Ar s1bno
241d1115a4cSwizinstead of the default location for the machine and file system type.
242d1115a4cSwiz.Sy [ alpha ,
243fb04e69cSuwe.Sy i386/amd64
244fb04e69cSuwe.Po
245fb04e69cSuwe.Pa bootxx_fat16
246fb04e69cSuweonly
247fb04e69cSuwe.Pc ,
248d1115a4cSwiz.Sy pmax ,
249d1115a4cSwiz.Sy vax ]
250d1115a4cSwiz.
25107e46180Slukem.It Fl c
25207e46180SlukemClear (remove) any existing bootstrap instead of installing one.
25307e46180Slukem.
2548c893c96Sdsl.It Fl e
2558c893c96SdslEdit the options of an existing bootstrap.
256fb04e69cSuweThis can be used to change the options in
257fb04e69cSuwe.Pa bootxx_ Ns Aq Ar FSTYPE\^
258fb04e69cSuwefiles,
2590c7234efSdslraw disk partitions, and the
2600c7234efSdsl.Pa pxeboot_ia32.bin
2610c7234efSdslfile.
262c623d100SgdtWith
263c623d100Sgdt.Fl v
264c623d100Sgdtand without
265c623d100Sgdt.Fl o ,
266c623d100Sgdtshow the current options.
2678c893c96Sdsl.Sy [ amd64 , i386 ]
2688c893c96Sdsl.
269486d4119Sdsl.It Fl f
270486d4119SdslForces
271486d4119Sdsl.Nm
272486d4119Sdslto ignore some errors.
273486d4119Sdsl.
27407e46180Slukem.It Fl m Ar machine
27507e46180SlukemUse
27607e46180Slukem.Ar machine
27707e46180Slukemas the target machine type.
27807e46180SlukemThe default machine is determined from
27907e46180Slukem.Xr uname 3
28007e46180Slukemand then
281fb04e69cSuwe.Ev MACHINE
282fb04e69cSuweenvironment variable.
283fb04e69cSuweThe following machines are currently supported:
28407e46180Slukem.Bd -ragged -offset indent
285fb04e69cSuwe.Ic alpha ,
286fb04e69cSuwe.Ic amd64 ,
287fb04e69cSuwe.Ic amiga ,
288fb04e69cSuwe.Ic evbarm ,
289fb04e69cSuwe.Ic ews4800mips ,
290fb04e69cSuwe.Ic hp300 ,
291fb04e69cSuwe.Ic hppa ,
292fb04e69cSuwe.Ic i386 ,
293fb04e69cSuwe.Ic landisk ,
294fb04e69cSuwe.Ic macppc ,
295fb04e69cSuwe.Ic news68k ,
296fb04e69cSuwe.Ic newsmips ,
297fb04e69cSuwe.Ic next68k ,
298fb04e69cSuwe.Ic pmax ,
299fb04e69cSuwe.Ic sparc ,
300fb04e69cSuwe.Ic sparc64 ,
301fb04e69cSuwe.Ic sun2 ,
302fb04e69cSuwe.Ic sun3 ,
303fb04e69cSuwe.Ic vax ,
304fb04e69cSuwe.Ic x68k
30507e46180Slukem.Ed
30607e46180Slukem.
30707e46180Slukem.
30807e46180Slukem.It Fl n
30907e46180SlukemDo not write to
31007e46180Slukem.Ar filesystem .
31107e46180Slukem.
31207e46180Slukem.It Fl o Ar options
31307e46180SlukemMachine specific
31407e46180Slukem.Nm
31507e46180Slukemoptions, comma separated.
31607e46180Slukem.Pp
317fb04e69cSuweSupported options are
318fb04e69cSuwe.Pq with the machines for they are valid in brackets :
31907e46180Slukem.
320fb04e69cSuwe.Bl -tag -width Ic
32106d7c45cSlukem.
322fb04e69cSuwe.It Ic alphasum
3234ee46bcfSlukem.Sy [ alpha ]
32406d7c45cSlukemRecalculate and restore the Alpha checksum.
32506d7c45cSlukemThis is the default for
326e217b7d0Swiz.Nx Ns /alpha .
32707e46180Slukem.
328fb04e69cSuwe.It Ic append
329ba51c8dcSlukem.Sy [ alpha ,
330ba51c8dcSlukem.Sy pmax ,
3314ee46bcfSlukem.Sy vax ]
33207e46180SlukemAppend
333d2804426Slukem.Ar primary
33407e46180Slukemto the end of
33507e46180Slukem.Ar filesystem ,
3363b288fe0Swizwhich must be a regular file in this case.
33707e46180Slukem.
338fb04e69cSuwe.It Ic board Ns Op Ns Li = Ns Ar type
33902d67d10Sthorpej.Sy [ evbarm ]
34002d67d10SthorpejSpecify the board type used to determine the correct boot loader image
34102d67d10Sthorpejand installation procedure.
34202d67d10SthorpejIf omitted,
34302d67d10Sthorpej.Nm
34402d67d10Sthorpejwill attempt to guess the board type based on system information if run
34502d67d10Sthorpejnatively.
34602d67d10Sthorpej.
347fb04e69cSuwe.It Ic bootconf
348d0e5481aSjym.Sy [ amd64 ,
349d0e5481aSjym.Sy i386 ]
350d0e5481aSjym(Don't) read a
351fb04e69cSuwe.Pa boot.cfg
352d0e5481aSjymfile.
353d0e5481aSjym.
354fb04e69cSuwe.It Ic command Ns Li = Ns Ar commandline
355e7852b05Smhitch.Sy [ amiga ]
356e7852b05SmhitchModify the default boot command line.
357e7852b05Smhitch.
358fb04e69cSuwe.It Ic console Ns Li = Ns Ar name
3599eb2f516Swiz.Sy [ amd64 ,
3609eb2f516Swiz.Sy i386 ]
361979e90aeSlukemSet the console device.
362979e90aeSlukem.Ar name
363979e90aeSlukemmust be one of:
364fb04e69cSuwe.Ic pc ,
365fb04e69cSuwe.Ic com0 ,
366fb04e69cSuwe.Ic com1 ,
367fb04e69cSuwe.Ic com2 ,
368fb04e69cSuwe.Ic com3 ,
369fb04e69cSuwe.Ic com0kbd ,
370fb04e69cSuwe.Ic com1kbd ,
371fb04e69cSuwe.Ic com2kbd ,
372fb04e69cSuwe.Ic com3kbd ,
373979e90aeSlukemor
374fb04e69cSuwe.Ic auto .
375ed45ba76Sdsl.
376fb04e69cSuwe.It Ic dtb Ns Li = Ns Ar dtbfile
37702d67d10Sthorpej.Sy [ evbarm ]
37802d67d10SthorpejAttempt to determine the board type from information in the device tree
37943723405Swizblob file at
380fb04e69cSuwe.Ar dtbfile .
38102d67d10SthorpejIf both
382fb04e69cSuwe.Ic board
38302d67d10Sthorpejand
384fb04e69cSuwe.Ic dtb
38543723405Swizoptions are specified,
386fb04e69cSuwe.Ic board
38779f15f0bSjakllschtakes precedence.
38802d67d10Sthorpej.
389fb04e69cSuwe.It Ic ioaddr Ns Li = Ns Ar ioaddr
3900b10fdb3Sdsl.Sy [ amd64 ,
3910b10fdb3Sdsl.Sy i386 ]
3920b10fdb3SdslSet the IO address to be used for the console serial port.
393fb04e69cSuweDefaults to the IO address used by the system
394fb04e69cSuwe.Tn BIOS
395fb04e69cSuwefor the specified port.
3960b10fdb3Sdsl.
397fb04e69cSuwe.It Ic keymap Ns Li = Ns Ar keymap
3989eb2f516Swiz.Sy [ amd64 ,
3999eb2f516Swiz.Sy i386 ]
4007b024ef6SdslSet a boot time keyboard translation map.
401979e90aeSlukemEach character in
402979e90aeSlukem.Ar keymap
403979e90aeSlukemwill be replaced by the one following it.
40446d96075SwizFor example, an argument of
405fb04e69cSuwe.Li zyz
40646d96075Swizwould swap the lowercase letters
407fb04e69cSuwe.Aq y
40846d96075Swizand
409fb04e69cSuwe.Aq z .
4107b024ef6Sdsl.
411fb04e69cSuwe.It Ic media Ns Li = Ns Ar type
41202d67d10Sthorpej.Sy [ evbarm ]
41302d67d10SthorpejSome boards require a different boot loader binary and/or installation
41402d67d10Sthorpejprocedure depending on what type of media will be used to boot the system.
41502d67d10SthorpejFor such boards, this option is required, and omitting it will display a
41602d67d10Sthorpejusage message that lists the valid media types for the board.
41702d67d10SthorpejFor boards that do not require special media handling, this option is
41802d67d10Sthorpejnot allowed.
419979e90aeSlukemCommon values:
420fb04e69cSuwe.Ic sdmmc ,
421fb04e69cSuwe.Ic emmc ,
422fb04e69cSuwe.Ic usb .
42302d67d10Sthorpej.
424fb04e69cSuwe.It Ic modules
425d0e5481aSjym.Sy [ amd64 ,
426d0e5481aSjym.Sy i386 ]
427d0e5481aSjym(Don't) load kernel modules.
428d0e5481aSjym.
429fb04e69cSuwe.It Ic password Ns Li = Ns Ar password
4309eb2f516Swiz.Sy [ amd64 ,
4319eb2f516Swiz.Sy i386 ]
432ed45ba76SdslSet the password which must be entered before the boot menu can be accessed.
433ed45ba76Sdsl.
434fb04e69cSuwe.It Ic resetvideo
4359eb2f516Swiz.Sy [ amd64 ,
4369eb2f516Swiz.Sy i386 ]
437ed45ba76SdslReset the video before booting.
438ed45ba76Sdsl.
439fb04e69cSuwe.It Ic speed Ns Li = Ns Ar baud
4409eb2f516Swiz.Sy [ amd64 ,
4419eb2f516Swiz.Sy i386 ]
442ed45ba76SdslSet the baud rate for the serial console.
44343f9ef50SwizIf a value of zero is specified, then the current baud rate (set by the
444fb04e69cSuwe.Tn BIOS )
445fb04e69cSuwewill be used.
446ed45ba76Sdsl.
447fb04e69cSuwe.It Ic sunsum
448ba51c8dcSlukem.Sy [ alpha ,
449ba51c8dcSlukem.Sy pmax ,
4504ee46bcfSlukem.Sy vax ]
45107e46180SlukemRecalculate and restore the Sun and
452e217b7d0Swiz.Nx Ns /sparc
45307e46180Slukemcompatible checksum.
4543b288fe0Swiz.Em Note :
4553b288fe0SwizThe existing
456e217b7d0Swiz.Nx Ns /sparc
45707e46180Slukemdisklabel should use no more than 4 partitions.
458ed45ba76Sdsl.
459fb04e69cSuwe.It Ic timeout Ns Li = Ns Ar seconds
4609eb2f516Swiz.Sy [ amd64 ,
4619eb2f516Swiz.Sy i386 ]
462ed45ba76SdslSet the timeout before the automatic boot begins to the given number of seconds.
46307e46180Slukem.El
46407e46180Slukem.
46507e46180Slukem.It Fl t Ar fstype
46607e46180SlukemUse
46707e46180Slukem.Ar fstype
46807e46180Slukemas the type of
46907e46180Slukem.Ar filesystem .
47007e46180SlukemThe default operation is to attempt to auto-detect this setting.
4714ac338cbSdhollandThe following file system types are currently supported:
47280ae5fb6Slukem.
473fb04e69cSuwe.Bl -tag -width Ic
47480ae5fb6Slukem.
475fb04e69cSuwe.It Ic ffs
47680ae5fb6Slukem.Bx
47780ae5fb6SlukemFast File System.
47880ae5fb6Slukem.
479fb04e69cSuwe.It Ic raid
480373c7523SjdcMirrored RAIDframe File System.
481373c7523Sjdc.
4824882e3f0Stsutsui.It Ic cd9660
4834882e3f0StsutsuiISO 9660 File System.
4844882e3f0Stsutsui.
485fb04e69cSuwe.It Ic raw
486fb04e69cSuwe.Dq Raw
48780ae5fb6Slukemimage.
488fb04e69cSuwe.Em Note :
489fb04e69cSuweif a platform needs to hard-code the block offset of the secondary
4901bdd92eeSlukembootstrap, it cannot be searched for on this file system type, and must
4911bdd92eeSlukembe provided with
4921bdd92eeSlukem.Fl B Ar s2bno .
49380ae5fb6Slukem.El
49407e46180Slukem.
495a2c7f8e9Sriastradh.It Fl u Ar U-Boot-paths
496a2c7f8e9Sriastradh.Ar U-Boot-paths
497317b3a69Sbrookis a colon-separated list of search paths to scan for
498fb04e69cSuwe\*(UB packages with
499fb04e69cSuwe.Nm
500317b3a69Sbrookinstallation overlays.
501317b3a69SbrookIf multiple overlays are found, overlays from paths closer to the front
502317b3a69Sbrookof the list take precedence.
503317b3a69SbrookIf not specified, environment variable
504317b3a69Sbrook.Ev INSTALLBOOT_UBOOT_PATHS
505317b3a69Sbrookis used if defined; otherwise, the default path is
506317b3a69Sbrook.Pa /usr/pkg/share/u-boot .
507317b3a69SbrookThis option is only used on platforms that support
508fb04e69cSuweusing \*(UB.
509317b3a69Sbrook.
51007e46180Slukem.It Fl v
51107e46180SlukemVerbose operation.
5122a820a18Slukem.
5132a820a18Slukem.It Ar filesystem
5142a820a18SlukemThe path name of the device or file system image that
5152a820a18Slukem.Nm
5162a820a18Slukemis to operate on.
5172a820a18SlukemIt is not necessary for
5182a820a18Slukem.Ar filesystem
5192a820a18Slukemto be a currently mounted file system.
5202a820a18Slukem.
5212a820a18Slukem.It Ar primary
5222a820a18SlukemThe path name of the
5232a820a18Slukem.Dq primary
5242a820a18Slukemboot block to install.
525d8a2ffd5SapbThe path name must refer to a file in a file system that is currently
526d8a2ffd5Sapbmounted.
5272a820a18Slukem.
5282a820a18Slukem.It Ar secondary
5292a820a18SlukemThe path name of the
5302a820a18Slukem.Dq secondary
531d8a2ffd5Sapbboot block, relative to the root of
532d8a2ffd5Sapbthe file system in the device or image specified by the
533d8a2ffd5Sapb.Ar filesystem
534d8a2ffd5Sapbargument.
535d8a2ffd5SapbNote that this may refer to a file in a file system that is not mounted.
5362a820a18SlukemMost systems require
5372a820a18Slukem.Ar secondary
5382a820a18Slukemto be in the
5392a820a18Slukem.Dq root
5402a820a18Slukemdirectory of the file system, so the leading
541fb04e69cSuwe.Ql /
5422a820a18Slukemis not necessary on
5432a820a18Slukem.Ar secondary .
5442a820a18Slukem.Pp
5452a820a18SlukemOnly certain combinations of
5462a820a18Slukemplatform
5472a820a18Slukem.Pq Fl m Ar machine
5482a820a18Slukemand file system type
5492a820a18Slukem.Pq Fl t Ar fstype
5502a820a18Slukemrequire that the name of the secondary bootstrap is
5512a820a18Slukemsupplied as
5522a820a18Slukem.Ar secondary ,
5532a820a18Slukemso that information such as the disk block numbers occupied
5542a820a18Slukemby the secondary bootstrap can be stored in the primary bootstrap.
5552a820a18SlukemThese are:
5562a820a18Slukem.Bl -column "Platform" "File systems" -offset indent
5572a820a18Slukem.It Sy "Platform" Ta Sy "File systems"
5582a820a18Slukem.It macppc Ta ffs, raw
5592a820a18Slukem.It news68k Ta ffs, raw
5602a820a18Slukem.It newsmips Ta ffs, raw
561373c7523Sjdc.It sparc Ta ffs, raid, raw
5622a820a18Slukem.It sun2 Ta ffs, raw
5632a820a18Slukem.It sun3 Ta ffs, raw
5642a820a18Slukem.El
56507e46180Slukem.El
56607e46180Slukem.
56707e46180Slukem.Sh ENVIRONMENT
568fb04e69cSuwe.Bl -tag -width Ev
56907e46180Slukem.
57002d67d10Sthorpej.It Ev INSTALLBOOT_UBOOT_PATHS
57102d67d10SthorpejA colon-separated list of search paths to scan for
572fb04e69cSuwe\*(UB packages with
573fb04e69cSuwe.Nm
57402d67d10Sthorpejinstallation overlays.
57502d67d10SthorpejIf multiple overlays are found, overlays from paths closer to the front
57643723405Swizof the list take precedence.
57702d67d10SthorpejIf not specified, the default path is
57802d67d10Sthorpej.Pa /usr/pkg/share/u-boot .
57902d67d10SthorpejThis environment variable is only used on platforms that support
580fb04e69cSuweusing \*(UB.
58102d67d10Sthorpej.
58207e46180Slukem.It Ev MACHINE
58307e46180SlukemDefault value for
58407e46180Slukem.Ar machine ,
58507e46180Slukemoverriding the result from
58607e46180Slukem.Xr uname 3 .
58707e46180Slukem.
58807e46180Slukem.El
58907e46180Slukem.
59007e46180Slukem.Sh FILES
591f02ecb7dSwizMost
592f02ecb7dSwiz.Nx
593f02ecb7dSwizports will contain variations of the following files:
594fb04e69cSuwe.Bl -tag -width Pa
595c1455b1bSlukem.
596fb04e69cSuwe.It Pa /usr/mdec/bootxx_ Ns Aq Ar FSTYPE\^
5978eb8919eSlukemPrimary bootstrap for file system type
598fb04e69cSuwe.Ar FSTYPE .
599c1455b1bSlukemInstalled into the bootstrap area of the file system by
600990562bfSwiz.Nm .
601c1455b1bSlukem.
6022e4f7d30Sdsl.It Pa /usr/mdec/bootxx_fat16
603fb04e69cSuwePrimary bootstrap for
604fb04e69cSuwe.Tn MS-DOS
6052e4f7d30Sdsl.Sy FAT16
6062e4f7d30Sdslfile systems.
6072e4f7d30SdslThis differs from
608fb04e69cSuwe.Pa bootxx_msdos
6092e4f7d30Sdslin that it doesn't require the filesystem to have been initialised with
6102e4f7d30Sdslany
611fb04e69cSuwe.Dq reserved sectors .
6122e4f7d30SdslIt also uses the information in the
613fb04e69cSuwe.Dq Boot Parameter Block
61451f4f8beSmsaitohto get the media and filesystem properties.
615095ac4e7SdslThe
616fb04e69cSuwe.Dq hidden sectors
617fb04e69cSuwefield of the
618fb04e69cSuwe.Tn BPB
619fb04e69cSuwemust be the offset of the partition in the disk.
620095ac4e7SdslThis can be set using the
621095ac4e7Sdsl.Fl b Ar s1bno
622095ac4e7Sdsloption.
6232e4f7d30Sdsl.
6244ab35bdeSlukem.It Pa /usr/mdec/bootxx_ffsv1
6254ab35bdeSlukemPrimary bootstrap for
6264ab35bdeSlukem.Sy FFSv1
6274ab35bdeSlukemfile systems
628fb04e69cSuwe.Po
629fb04e69cSuwethe
630fb04e69cSuwe.Dq traditional
6317964aa29Sastfile system prior to
632fb04e69cSuwe.Nx 6.0
633fb04e69cSuwe.Pc .
634bb51419cSlukemUse
635bb51419cSlukem.Xr dumpfs 8
636fb04e69cSuweto confirm the file system format is FFSv1.
6374ab35bdeSlukem.
6384ab35bdeSlukem.It Pa /usr/mdec/bootxx_ffsv2
6394ab35bdeSlukemPrimary bootstrap for
6404ab35bdeSlukem.Sy FFSv2
641fb04e69cSuwefile systems
642fb04e69cSuwe.Po
643fb04e69cSuwethe default file system for some platforms as of
644fb04e69cSuwe.Nx 6.0
645fb04e69cSuwe.Pc .
646bb51419cSlukemUse
647bb51419cSlukem.Xr dumpfs 8
648fb04e69cSuweto confirm the file system format is FFSv2.
6494ab35bdeSlukem.
6504ab35bdeSlukem.It Pa /usr/mdec/bootxx_lfsv1
6514ab35bdeSlukemPrimary bootstrap for
6524ab35bdeSlukem.Sy LFSv1
6534ab35bdeSlukemfile systems.
6544ab35bdeSlukem.
6554ab35bdeSlukem.It Pa /usr/mdec/bootxx_lfsv2
6564ab35bdeSlukemPrimary bootstrap for
6574ab35bdeSlukem.Sy LFSv2
6584ab35bdeSlukemfile systems
659fb04e69cSuwe.Pq the default Tn LFS version .
6604ab35bdeSlukem.
6611c33b4e6Slukem.It Pa /usr/mdec/bootxx_msdos
662fb04e69cSuwePrimary bootstrap for
663fb04e69cSuwe.Tn MS-DOS
6641c33b4e6Slukem.Sy FAT
6651c33b4e6Slukemfile systems.
6664ab35bdeSlukem.
6674ab35bdeSlukem.It Pa /usr/mdec/bootxx_ustarfs
6684ab35bdeSlukemPrimary bootstrap for
6694ab35bdeSlukem.Sy TARFS
6704ab35bdeSlukemboot images.
6714ab35bdeSlukemThis is used by various install media.
6724ab35bdeSlukem.
673fb04e69cSuwe.It Pa /usr/mdec/boot. Ns Aq Ar MACHINE\^
674c1455b1bSlukemSecondary bootstrap for machine type
675fb04e69cSuwe.Ar MACHINE .
676c1455b1bSlukemThis should be installed into the file system before
677c1455b1bSlukem.Nm
678c1455b1bSlukemis run.
679c1455b1bSlukem.
6804ab35bdeSlukem.It Pa /usr/mdec/boot
6814ab35bdeSlukemSynonym for
682fb04e69cSuwe.Pa /usr/mdec/boot. Ns Aq Ar MACHINE\^
6834ab35bdeSlukem.
684fb04e69cSuwe.It Pa /boot. Ns Aq Ar MACHINE\^
685c1455b1bSlukemInstalled copy of secondary bootstrap for machine type
686fb04e69cSuwe.Ar MACHINE .
687c1455b1bSlukem.
688c1455b1bSlukem.It Pa /boot
689c1455b1bSlukemInstalled copy of secondary bootstrap.
690c1455b1bSlukemSearched for by the primary bootstrap if
691fb04e69cSuwe.Pa /boot. Ns Aq Ar MACHINE\^
692c1455b1bSlukemis not found.
693c1455b1bSlukem.
694c1455b1bSlukem.El
695f02ecb7dSwiz.
696fb04e69cSuwe.Ss NetBSD/evbarm files
69702d67d10SthorpejThe
69802d67d10Sthorpej.Nx Ns /evbarm
699fb04e69cSuweplatform covers a wide variety of board types, many of which use \*(UB.
70002d67d10SthorpejRunning
70102d67d10Sthorpej.Nm
70202d67d10Sthorpejwith no options will display a list of known boards.
70302d67d10SthorpejUsing the verbose option will also display information about which
704fb04e69cSuwe\*(UB package needs to be installed to support that board,
705fb04e69cSuweand if the required \*(UB package is installed,
706fb04e69cSuwethe path at which it is located.
707fb04e69cSuwe.Bl -tag -width Pa
70802d67d10Sthorpej.It Pa /usr/pkg/share/u-boot
70902d67d10SthorpejThe default location scanned for
710fb04e69cSuwe\*(UB packages with installation overlays.
71102d67d10Sthorpej.It Pa /usr/share/installboot/evbarm/boards.plist
71202d67d10SthorpejBase board database, used to provide information about which
713fb04e69cSuwe\*(UB package is required for a given board.
71402d67d10Sthorpej.El
71502d67d10Sthorpej.
716fb04e69cSuwe.Ss NetBSD/evbmips files
717c62a157eSmrg.
718c62a157eSmrgThe
719e217b7d0Swiz.Nx Ns /evbmips
720fb04e69cSuwebootstrap files currently only apply to the
721fb04e69cSuwe.Tn SBMIPS
722fb04e69cSuwekernels for the
723fb04e69cSuweSiByte/Broadcom
724fb04e69cSuwe.Tn BCM1250
725fb04e69cSuweand
726fb04e69cSuwe.Tn BCM1480
727fb04e69cSuweCPUs.
728791da06dSgutteridgeThere is also
729791da06dSgutteridge\*(UB support for the
730791da06dSgutteridge.Tn Creator CI20 .
731fb04e69cSuwe.Bl -tag -width Pa
732c62a157eSmrg.
733c62a157eSmrg.It Pa /usr/mdec/sbmips/boot
734e217b7d0Swiz.Nx Ns /evbmips
735fb04e69cSuwesecondary bootstrap for FFSv1, FFSv2, LFSv1, and LFSv2.
736c62a157eSmrg.It Pa /usr/mdec/sbmips/bootxx_cd9660
737fb04e69cSuwe.Tn SBMIPS
738fb04e69cSuweprimary bootstrap for ISO 9660 file system.
739c62a157eSmrg.It Pa /usr/mdec/sbmips/bootxx_ffs
740fb04e69cSuwe.Tn SBMIPS
741fb04e69cSuweprimary bootstrap for FFSv1 and FFSv2 file system.
742c62a157eSmrg.It Pa /usr/mdec/sbmips/bootxx_lfs
743fb04e69cSuwe.Tn SBMIPS
744fb04e69cSuweprimary bootstrap for LFSv1 and LFSv2 file system.
745c62a157eSmrg.It Pa /usr/mdec/sbmips/netboot
746fb04e69cSuwe.Tn SBMIPS
747fb04e69cSuweprimary bootstrap for network root.
748791da06dSgutteridge.It Pa /usr/share/installboot/evbmips/boards.plist
749791da06dSgutteridgeBase board database, used to provide information about which
750791da06dSgutteridge\*(UB package is required for a given board.
751c62a157eSmrg.
752c62a157eSmrg.El
753c62a157eSmrg.
754fb04e69cSuwe.Ss NetBSD/hppa files
75571f408f0Sskrll.
756fb04e69cSuwe.Bl -tag -width Pa
75771f408f0Sskrll.
75871f408f0Sskrll.It Pa /usr/mdec/xxboot
759e217b7d0Swiz.Nx Ns /hppa
760fb04e69cSuweprimary bootstrap for FFSv1, FFSv2, LFSv1, and LFSv2.
76171f408f0Sskrll.It Pa /usr/mdec/cdboot
762e217b7d0Swiz.Nx Ns /hppa
76371f408f0Sskrllprimary bootstrap for ISO 9660 file system.
76471f408f0Sskrll.It Pa /usr/mdec/sdboot
76571f408f0SskrllSynonym for
76671f408f0Sskrll.Pa /usr/mdec/xxboot
76771f408f0Sskrll.
76871f408f0Sskrll.El
76971f408f0Sskrll.
770fb04e69cSuwe.Ss NetBSD/macppc files
771a2617875Stsutsui.
772fb04e69cSuwe.Bl -tag -width Pa
773a2617875Stsutsui.
774a2617875Stsutsui.It Pa /usr/mdec/bootxx
775e217b7d0Swiz.Nx Ns /macppc
776a2617875Stsutsuiprimary bootstrap.
777a2617875Stsutsui.
778a2617875Stsutsui.It Pa /usr/mdec/ofwboot
779e217b7d0Swiz.Nx Ns /macppc
780a2617875Stsutsuisecondary bootstrap.
781a2617875Stsutsui.
782a2617875Stsutsui.It Pa /ofwboot
783a2617875StsutsuiInstalled copy of
784e217b7d0Swiz.Nx Ns /macppc
785a2617875Stsutsuisecondary bootstrap.
786a2617875Stsutsui.
787a2617875Stsutsui.El
788a2617875Stsutsui.
789fb04e69cSuwe.Ss NetBSD/next68k files
790e05d95b9Scl.
791fb04e69cSuwe.Bl -tag -width Pa
792e05d95b9Scl.
793e05d95b9Scl.It Pa /usr/mdec/boot
794e217b7d0Swiz.Nx Ns /next68k
795e05d95b9Sclbootstrap.
796e05d95b9Scl.
797e05d95b9Scl.El
798e05d95b9Scl.
799fb04e69cSuwe.Ss NetBSD/sparc64 files
800c1455b1bSlukem.
801fb04e69cSuwe.Bl -tag -width Pa
80267c2e401Slukem.
80367c2e401Slukem.It Pa /usr/mdec/bootblk
804e217b7d0Swiz.Nx Ns /sparc64
80567c2e401Slukemprimary bootstrap.
80667c2e401Slukem.
80767c2e401Slukem.It Pa /usr/mdec/ofwboot
808e217b7d0Swiz.Nx Ns /sparc64
80967c2e401Slukemsecondary bootstrap.
81067c2e401Slukem.
81167c2e401Slukem.It Pa /ofwboot
81267c2e401SlukemInstalled copy of
813e217b7d0Swiz.Nx Ns /sparc64
81467c2e401Slukemsecondary bootstrap.
81567c2e401Slukem.
81667c2e401Slukem.El
817c1455b1bSlukem.
818c1455b1bSlukem.Sh EXAMPLES
819a88aa33fSlukem.
820fb04e69cSuwe.Ss Common
821724345d9SgrantVerbosely install the Berkeley Fast File System primary bootstrap on to disk
822fb04e69cSuwe.Ql sd0 :
823fb04e69cSuwe.Pp
824fb04e69cSuwe.Dl installboot -v /dev/rsd0c /usr/mdec/bootxx_ffs
825fb04e69cSuwe.Pp
826f1dbb906SmartinNote: the
827f1dbb906Smartin.Dq whole disk
828fb04e69cSuwepartition
829fb04e69cSuwe.Po
830fb04e69cSuwe.Ql c
831fb04e69cSuweon some ports,
832fb04e69cSuwe.Ql d
833fb04e69cSuweon others
834fb04e69cSuwe.Pc
835fb04e69cSuweis used here, since the
836fb04e69cSuwe.Ql a
837fb04e69cSuwepartition
838fb04e69cSuweprobably is already opened
839fb04e69cSuwe.Po
840fb04e69cSuwemounted as
841fb04e69cSuwe.Pa /
842fb04e69cSuwe.Pc ,
8431192b414Swizso
844f1dbb906Smartin.Nm
845f1dbb906Smartinwould not be able to access it.
846c1455b1bSlukem.Pp
847b0dfae03SlukemRemove the primary bootstrap from disk
848fb04e69cSuwe.Ql sd1 :
849fb04e69cSuwe.Pp
850fb04e69cSuwe.Dl installboot -c /dev/rsd1c
851724345d9Sgrant.
852fb04e69cSuwe.Ss NetBSD/amiga
853fb04e69cSuweModify the command line to change the default from
854fb04e69cSuwe.Ql "netbsd -ASn2"
855fb04e69cSuweto
856fb04e69cSuwe.Ql "netbsd -S" :
857fb04e69cSuwe.Bd -literal -offset indent
858fb04e69cSuweinstallboot -m amiga -o command="netbsd -S" /dev/rsd0a \e
859fb04e69cSuwe    /usr/mdec/bootxx_ffsv1
860fb04e69cSuwe.Ed
8613122f2a2Swiz.
862fb04e69cSuwe.Ss NetBSD/evbarm
86302d67d10SthorpejInstall the
864fb04e69cSuwe\*(UB boot loader for a Pinebook into an image that will be written to
865fb04e69cSuwean
866fb04e69cSuwe.Tn SDMMC
867fb04e69cSuwecard:
868fb04e69cSuwe.Pp
869fb04e69cSuwe.Dl installboot -m evbarm -o board=pine64,pinebook arm64.img
87002d67d10Sthorpej.Pp
87102d67d10SthorpejInstall/update the
872fb04e69cSuwe\*(UB boot loader for the current running system on the
873fb04e69cSuwe.Tn eMMC
874fb04e69cSuwedevice
875fb04e69cSuwe.Ql ld0
87602d67d10Sthorpejand display verbose information about the procedure:
877fb04e69cSuwe.Pp
878fb04e69cSuwe.Dl installboot -v /dev/rld0c
87902d67d10Sthorpej.Pp
88002d67d10SthorpejInstall a specific
881fb04e69cSuwe\*(UB package for a BeagleBone Black into an image that will be written
882fb04e69cSuweto an
883fb04e69cSuwe.Tn SDMMC
884fb04e69cSuwecard:
885fb04e69cSuwe.Bd -literal -offset indent
886fb04e69cSuweinstallboot -m evbarm -o board=ti,am335x-bone-black armv7.img \e
88702d67d10Sthorpej    /path/to/experimental/u-boot/package
888fb04e69cSuwe.Ed
88902d67d10Sthorpej.
890fb04e69cSuwe.Ss NetBSD/ews4800mips
8914930ad54StsutsuiInstall the System V Boot File System primary bootstrap on to disk
892fb04e69cSuwe.Ql sd0 ,
8934930ad54Stsutsuiwith the secondary bootstrap
894fb04e69cSuwe.Pa /boot
8954930ad54Stsutsuialready present in the SysVBFS partition on the disk:
896fb04e69cSuwe.Pp
897fb04e69cSuwe.Dl installboot /dev/rsd0p /usr/mdec/bootxx_bfs
898fb04e69cSuwe.Pp
899c332e97eStsutsui.Bd -ragged -offset indent-two -compact
900c332e97eStsutsui.Em Note :
901c332e97eStsutsuiOn
902c65439feSwiz.Nx Ns /ews4800mips
903fb04e69cSuwethe
904fb04e69cSuwe.Ql p
905fb04e69cSuwepartition is the
906c332e97eStsutsui.Dq whole disk
907fb04e69cSuwe.Pq i.e., raw
908fb04e69cSuwepartition.
909c332e97eStsutsui.Ed
910fb04e69cSuwe.
911fb04e69cSuwe.Ss NetBSD/i386 and NetBSD/amd64
912fb04e69cSuweInstall new boot blocks on an existing FFSv2 mounted root file system on
913fb04e69cSuwe.Ql wd0 ,
914fb04e69cSuwesetting the timeout to five seconds, after installing an
915fb04e69cSuwe.Tn MBR
916fb04e69cSuwebootcode and copying a new secondary bootstrap:
917fb04e69cSuwe.Pp
918fb04e69cSuwe.Dl fdisk -c /usr/mdec/mbr /dev/rwd0d
919fb04e69cSuwe.Pp
9204cb98d1eSrin.Bd -ragged -offset indent-two -compact
9214cb98d1eSrin.Em Note :
9224cb98d1eSrinSee
9234cb98d1eSrin.Xr fdisk 8
9244cb98d1eSrinand
9254cb98d1eSrin.Xr x86/mbr 8
9264cb98d1eSrinfor more details.
9274cb98d1eSrin.Ed
928fb04e69cSuwe.Pp
929fb04e69cSuwe.Dl cp /usr/mdec/boot /boot
930fb04e69cSuwe.Dl installboot -v -o timeout=5 /dev/rwd0a /usr/mdec/bootxx_ffsv2
931fb04e69cSuwe.Pp
932bdf0a8daSast.Bd -ragged -offset indent-two -compact
933bdf0a8daSast.Em Note :
934bdf0a8daSastPre
935bdf0a8daSast.Nx 6.0
936fb04e69cSuwesystems used FFSv1 file systems on these platforms; double check with
937bdf0a8daSast.Xr dumpfs 8
938bdf0a8daSastto be sure to use the correct secondary bootstrap.
939bdf0a8daSast.Ed
9404d9c2f6dSperry.Pp
941fb04e69cSuweCreate a bootable
942fb04e69cSuwe.Tn CD-ROM
943fb04e69cSuwewith an ISO 9660 file system for an i386 system with a serial console:
944fb04e69cSuwe.Bd -literal -offset indent
945fb04e69cSuwemkdir cdrom
946fb04e69cSuwecp sys/arch/i386/compile/mykernel/netbsd cdrom/netbsd
947fb04e69cSuwecp /usr/mdec/boot cdrom/boot
948fb04e69cSuwecp /usr/mdec/bootxx_cd9660 bootxx
949fb04e69cSuweinstallboot -o console=com0,speed=19200 -m i386 -e bootxx
950fb04e69cSuwemakefs -t cd9660 -o 'bootimage=i386;bootxx,no-emul-boot' boot.iso \e
95192b3793dSdyoung    cdrom
952fb04e69cSuwe.Ed
95392b3793dSdyoung.
95492b3793dSdyoung.Pp
955f6d3e09dSlukemCreate a bootable floppy disk with an FFSv1
9564d9c2f6dSperryfile system for a small custom kernel (note: bigger kernels needing
9574d9c2f6dSperrymultiple disks are handled with the ustarfs file system):
958fb04e69cSuwe.Pp
959fb04e69cSuwe.Dl newfs -s 1440k /dev/rfd0a
960fb04e69cSuwe.Pp
961f6d3e09dSlukem.Bd -ragged -offset indent-two -compact
962f6d3e09dSlukem.Em Note :
963f6d3e09dSlukemIgnore the warnings that
9642f701eb7Swiz.Xr newfs 8
965f6d3e09dSlukemdisplays; it can not write a disklabel,
966f6d3e09dSlukemwhich is not a problem for a floppy disk.
967f6d3e09dSlukem.Ed
968fb04e69cSuwe.
969fb04e69cSuwe.Bd -literal -offset indent
970fb04e69cSuwemount /dev/fd0a /mnt
971fb04e69cSuwecp /usr/mdec/boot /mnt/boot
972fb04e69cSuwegzip -9 < sys/arch/i386/compile/mykernel/netbsd > /mnt/netbsd.gz
973fb04e69cSuweumount /mnt
974fb04e69cSuweinstallboot -v /dev/rfd0a /usr/mdec/bootxx_ffsv1
975fb04e69cSuwe.Ed
976e05d95b9Scl.
977f6d3e09dSlukem.Pp
978fb04e69cSuweCreate a bootable
979fb04e69cSuwe.Tn FAT
980fb04e69cSuwefile system on
981fb04e69cSuwe.Ql wd1a ,
982fb04e69cSuwewhich should have the same offset and size as a
983fb04e69cSuwe.Tn FAT
984fb04e69cSuweprimary partition
985fb04e69cSuwein the Master Boot Record
986fb04e69cSuwe.Tn ( MBR ) :
987fb04e69cSuwe.Pp
988fb04e69cSuwe.Dl newfs_msdos -r 16 /dev/rwd1a
989fb04e69cSuwe.Pp
990f6d3e09dSlukem.Bd -ragged -offset indent-two -compact
991f6d3e09dSlukem.Em Notes :
992f6d3e09dSlukemThe
993fb04e69cSuwe.Fl r Ic 16
994f6d3e09dSlukemis to reserve space for the primary bootstrap.
9952f701eb7Swiz.Xr newfs_msdos 8
9962f701eb7Swizwill display an
997fb04e69cSuwe.Dq Tn MBR type
9982f701eb7Swizsuch as
999f6d3e09dSlukem.Ql 1 ,
10002f701eb7Swiz.Ql 4 ,
1001f6d3e09dSlukemor
1002f6d3e09dSlukem.Ql 6 ;
1003fb04e69cSuwethe
1004fb04e69cSuwe.Tn MBR
1005fb04e69cSuwepartition type of the appropriate primary partition should be
1006f6d3e09dSlukemchanged to this value.
1007f6d3e09dSlukem.Ed
1008fb04e69cSuwe.
1009fb04e69cSuwe.Bd -literal -offset indent
1010fb04e69cSuwemount -t msdos /dev/wd1a /mnt
1011fb04e69cSuwecp /usr/mdec/boot /mnt/boot
1012fb04e69cSuwecp path/to/kernel /mnt/netbsd
1013fb04e69cSuweumount /mnt
1014fb04e69cSuweinstallboot -t raw /dev/rwd1a /usr/mdec/bootxx_msdos
1015fb04e69cSuwe.Ed
1016486d4119Sdsl.Pp
1017fb04e69cSuweMake the existing
1018fb04e69cSuwe.Tn FAT16
1019fb04e69cSuwefilesystem on
1020fb04e69cSuwe.Ql sd0e
1021486d4119Sdslbootable.
1022fb04e69cSuweThis can be used to make
1023fb04e69cSuwe.Tn USB
1024fb04e69cSuwememory bootable provided it has 512 byte
1025486d4119Sdslsectors and that the manufacturer correctly initialised the file system.
1026fb04e69cSuwe.Bd -literal -offset indent
1027fb04e69cSuwemount -t msdos /dev/sd0e /mnt
1028fb04e69cSuwecp /usr/mdec/boot /mnt/boot
1029fb04e69cSuwecp path/to/kernel /mnt/netbsd
1030fb04e69cSuweumount /mnt
1031fb04e69cSuweinstallboot /dev/rsd0e /usr/mdec/bootxx_fat16
1032fb04e69cSuwe.Ed
1033fb04e69cSuwe.Pp
1034486d4119SdslIt may also be necessary to use
1035fb04e69cSuwe.Xr fdisk 8
1036486d4119Sdslto make the device itself bootable.
1037f6d3e09dSlukem.
103838f52fbaSsborrill.Pp
103938f52fbaSsborrillSwitch the existing installed bootstrap to use a serial console without
104038f52fbaSsborrillreinstalling or altering other options such as timeout.
1041fb04e69cSuwe.Pp
1042fb04e69cSuwe.Dl installboot -e -o console=com0 /dev/rwd0a
1043fb04e69cSuwe.
1044fb04e69cSuwe.Ss NetBSD/macppc
1045a2617875StsutsuiNote the
1046a2617875Stsutsui.Nm
1047a2617875Stsutsuiutility is only required for macppc machines with OpenFirmware version 2
1048ace0a0e4Swizto boot.
10495c1e8d46SwizOpenFirmware 3 cannot load bootblocks specified in the Apple partition
10505c1e8d46Swizmap.
1051a2617875Stsutsui.Pp
1052a2617875StsutsuiInstall the Berkeley Fast File System primary bootstrap on to disk
1053fb04e69cSuwe.Ql wd0 :
1054fb04e69cSuwe.Pp
1055fb04e69cSuwe.Dl installboot /dev/rwd0c /usr/mdec/bootxx /ofwboot
1056a2617875Stsutsui.Pp
1057a2617875StsutsuiThe secondary
1058e217b7d0Swiz.Nx Ns /macppc
1059a2617875Stsutsuibootstrap is located in
1060a2617875Stsutsui.Pa /usr/mdec/ofwboot .
1061a2617875Stsutsui.Pp
1062ace0a0e4SwizThe primary bootstrap requires the raw
1063a2617875Stsutsui.Pa ofwboot
1064a2617875Stsutsuifor the secondary bootstrap, not
1065a2617875Stsutsui.Pa ofwboot.xcf ,
1066a2617875Stsutsuiwhich is used for the OpenFirmware to load kernels.
1067e05d95b9Scl.
1068fb04e69cSuwe.Ss NetBSD/next68k
1069fb04e69cSuweInstall the bootstrap on to disk
1070fb04e69cSuwe.Ql sd0 :
1071fb04e69cSuwe.Pp
1072fb04e69cSuwe.Dl installboot /dev/rsd0c /usr/mdec/boot
1073fb04e69cSuwe.
1074fb04e69cSuwe.Ss NetBSD/pmax
1075724345d9SgrantInstall the Berkeley Fast File System primary bootstrap on to disk
1076fb04e69cSuwe.Ql sd0 :
1077fb04e69cSuwe.Pp
1078fb04e69cSuwe.Dl installboot /dev/rsd0c /usr/mdec/bootxx_ffs
1079724345d9Sgrant.Pp
1080e217b7d0Swiz.Nx Ns /pmax
1081724345d9Sgrantrequires that this file system starts at block 0 of the disk.
108280ae5fb6Slukem.Pp
1083c1455b1bSlukemInstall the ISO 9660 primary bootstrap in the file
1084c1455b1bSlukem.Pa /tmp/cd-image :
1085fb04e69cSuwe.Pp
1086fb04e69cSuwe.Dl installboot -m pmax /tmp/cd-image /usr/mdec/bootxx_cd9660
1087c1455b1bSlukem.Pp
1088c1455b1bSlukemMake an ISO 9660 filesystem in the file
1089c1455b1bSlukem.Pa /tmp/cd-image
1090c1455b1bSlukemand install the ISO 9660 primary bootstrap in the filesystem, where the
1091c1455b1bSlukemsource directory for the ISO 9660 filesystem contains a kernel, the
1092c1455b1bSlukemprimary bootstrap
1093c1455b1bSlukem.Pa bootxx_cd9660
1094c1455b1bSlukemand the secondary bootstrap
1095c1455b1bSlukem.Pa boot.pmax :
1096fb04e69cSuwe.Bd -literal -offset indent
1097fb04e69cSuwemkisofs -o /tmp/cd-image -a -l -v iso-source-dir
1098fb04e69cSuwe\&...
1099fb04e69cSuwe48 51 iso-source-dir/bootxx_cd9660
1100fb04e69cSuwe\&...
1101fb04e69cSuweinstallboot -b $((48 * 4)) /tmp/cd-image /usr/mdec/bootxx_cd9660
1102fb04e69cSuwe.Ed
110307e46180Slukem.
1104fb04e69cSuwe.Ss NetBSD/sparc
1105724345d9SgrantInstall the Berkeley Fast File System primary bootstrap on to disk
1106fb04e69cSuwe.Ql sd0 ,
1107b0dfae03Slukemwith the secondary bootstrap
1108fb04e69cSuwe.Pa /boot
1109b0dfae03Slukemalready present:
1110fb04e69cSuwe.Pp
1111fb04e69cSuwe.Dl installboot /dev/rsd0c /usr/mdec/bootxx /boot
1112724345d9Sgrant.
1113fb04e69cSuwe.Ss NetBSD/sparc64
1114d1852e4eSmartinInstall the primary bootstrap on to disk
1115fb04e69cSuwe.Ql sd0 :
1116fb04e69cSuwe.Pp
1117fb04e69cSuwe.Dl installboot /dev/rsd0c /usr/mdec/bootblk
1118724345d9Sgrant.Pp
1119724345d9SgrantThe secondary
1120e217b7d0Swiz.Nx Ns /sparc64
1121724345d9Sgrantbootstrap is located in
1122724345d9Sgrant.Pa /usr/mdec/ofwboot .
1123724345d9Sgrant.
1124fb04e69cSuwe.Ss NetBSD/sun2 and NetBSD/sun3
1125724345d9SgrantInstall the Berkeley Fast File System primary bootstrap on to disk
1126fb04e69cSuwe.Ql sd0 ,
1127724345d9Sgrantwith the secondary bootstrap
1128fb04e69cSuwe.Pa /boot
1129724345d9Sgrantalready present:
1130fb04e69cSuwe.Pp
1131fb04e69cSuwe.Dl installboot /dev/rsd0c /usr/mdec/bootxx /boot
1132fb04e69cSuwe.
11337426efd6Smrg.Ss NetBSD/vax
11347426efd6SmrgInstall the Berkeley Fast File System primary bootstrap on to disk
11357426efd6Smrg.Ql ra0 :
11367426efd6Smrg.Pp
11377426efd6Smrg.Dl installboot /dev/rra0c /usr/mdec/raboot
11387426efd6Smrg.Pp
11397426efd6SmrgThe primary bootstrap works with FFSv1 and FFSv2 file systems.
11407426efd6SmrgThe secondary
11417426efd6Smrg.Nx Ns /vax
11427426efd6Smrgbootstrap is located in
11437426efd6Smrg.Pa /usr/mdec/boot .
11447426efd6Smrg.
1145fb04e69cSuwe.Sh DIAGNOSTIC
1146fb04e69cSuwe.Ex -std
1147a88aa33fSlukem.
114807e46180Slukem.Sh SEE ALSO
114907e46180Slukem.Xr uname 3 ,
115007e46180Slukem.Xr boot 8 ,
1151aa4aca15Swiz.Xr disklabel 8 ,
1152bb51419cSlukem.Xr dumpfs 8 ,
1153245b9b7aSreed.Xr fdisk 8 ,
1154eec34178Sriastradh.Xr gpt 8 ,
11554cb98d1eSrin.Xr x86/mbr 8 ,
115643723405Swiz.Xr x86/pxeboot 8
115707e46180Slukem.
115807e46180Slukem.Sh HISTORY
1159c1455b1bSlukemThis implementation of
116007e46180Slukem.Nm
1161c1455b1bSlukemappeared in
116207e46180Slukem.Nx 1.6 .
116307e46180Slukem.
1164c1455b1bSlukem.Sh AUTHORS
1165e74dc903Swiz.An -nosplit
11663b288fe0SwizThe machine independent portion of this implementation of
1167c1455b1bSlukem.Nm
1168e74dc903Swizwas written by
1169e74dc903Swiz.An Luke Mewburn .
1170c1455b1bSlukemThe following people contributed to the various machine dependent
1171c1455b1bSlukemback-ends:
1172e74dc903Swiz.An Simon Burge
1173e74dc903Swiz(pmax),
1174e74dc903Swiz.An Chris Demetriou
1175e74dc903Swiz(alpha),
1176e74dc903Swiz.An Matthew Fredette
1177e74dc903Swiz(sun2, sun3),
1178e74dc903Swiz.An Matthew Green
1179e74dc903Swiz(sparc64),
1180e74dc903Swiz.An Ross Harvey
1181e74dc903Swiz(alpha),
1182e74dc903Swiz.An Michael Hitch
1183e74dc903Swiz(amiga),
1184e74dc903Swiz.An Paul Kranenburg
1185e74dc903Swiz(sparc),
1186e74dc903Swiz.An David Laight
1187e74dc903Swiz(i386),
1188e74dc903Swiz.An Christian Limpach
1189e74dc903Swiz(next68k),
1190e74dc903Swiz.An Luke Mewburn
1191e74dc903Swiz(macppc),
1192e74dc903Swiz.An Matt Thomas
1193e74dc903Swiz(vax),
1194e74dc903Swiz.An Izumi Tsutsui
1195e74dc903Swiz(news68k, newsmips),
119667c2e401Slukemand
1197e74dc903Swiz.An UCHIYAMA Yasushi
1198e74dc903Swiz(ews4800mips).
1199c1455b1bSlukem.
120007e46180Slukem.Sh BUGS
1201c1455b1bSlukemThere are not currently primary bootstraps to support all file systems
1202c1455b1bSlukemtypes which are capable of being the root file system.
1203373c7523Sjdc.Pp
1204373c7523SjdcIf a disk has been converted from
1205fb04e69cSuwe.Tn FFS
1206373c7523Sjdcto
1207fb04e69cSuwe.Tn RAID
1208373c7523Sjdcwithout the contents of the disk erased, then the original
1209fb04e69cSuwe.Tn FFS
1210373c7523Sjdcinstallation may be auto-detected instead of the
1211fb04e69cSuwe.Tn RAID
1212ace0a0e4Swizinstallation.
1213ace0a0e4SwizIn this case, the
1214fb04e69cSuwe.Fl t Ic raid
1215373c7523Sjdcoption must be provided.
1216a88aa33fSlukem.
1217fb04e69cSuwe.Ss NetBSD/alpha
1218724345d9SgrantThe
1219e217b7d0Swiz.Nx Ns /alpha
1220724345d9Sgrantprimary bootstrap program can only load the secondary bootstrap program
1221fb04e69cSuwefrom file systems starting at the beginning
1222fb04e69cSuwe.Pq block 0
1223fb04e69cSuweof disks.
1224724345d9SgrantSimilarly, the secondary bootstrap program can only load kernels from
1225724345d9Sgrantfile systems starting at the beginning of disks.
1226724345d9Sgrant.Pp
1227724345d9SgrantThe size of primary bootstrap programs is restricted to 7.5KB, even
1228fb04e69cSuwethough some file systems
1229fb04e69cSuwe.Pq e.g., ISO 9660
1230fb04e69cSuweare able to accommodate larger ones.
1231a88aa33fSlukem.
1232fb04e69cSuwe.Ss NetBSD/hp300
1233d7d05c9eSdslThe disk must have a boot partition large enough to hold the bootstrap code.
1234d7d05c9eSdslCurrently the primary bootstrap must be a LIF format file.
1235d7d05c9eSdsl.
1236fb04e69cSuwe.Ss NetBSD/i386 and NetBSD/amd64
123746d96075SwizThe bootstrap must be installed in the
123846d96075Swiz.Nx
1239fb04e69cSuwepartition that starts at the beginning of the
1240fb04e69cSuwe.Tn MBR
1241fb04e69cSuwepartition.
124246d96075SwizIf that is a valid filesystem and contains the
124346d96075Swiz.Pa /boot
124446d96075Swizprogram then it will be used as the root filesystem, otherwise the
1245fb04e69cSuwe.Ql a
124646d96075Swizpartition will be booted.
12477b024ef6Sdsl.Pp
1248ed45ba76SdslThe size of primary bootstrap programs is restricted to 8KB, even
1249fb04e69cSuwethough some file systems
1250fb04e69cSuwe.Pq e.g., ISO 9660
1251fb04e69cSuweare able to accommodate larger ones.
1252ed45ba76Sdsl.
1253fb04e69cSuwe.Ss NetBSD/macppc
1254ace0a0e4SwizDue to restrictions in
1255a2617875Stsutsui.Nm
1256ace0a0e4Swizand the secondary bootstrap implementation, file systems where kernels exist
1257a2617875Stsutsuimust start at the beginning of disks.
1258a2617875Stsutsui.Pp
1259ace0a0e4SwizCurrently,
1260a2617875Stsutsui.Nm
1261ace0a0e4Swizdoesn't recognize an existing Apple partition map on the disk
1262ace0a0e4Swizand always writes a faked map to make disks bootable.
1263a2617875Stsutsui.Pp
1264a2617875StsutsuiThe
1265e217b7d0Swiz.Nx Ns /macppc
1266fb04e69cSuwebootstrap program can't load kernels from FFSv2 partitions.
1267fb04e69cSuwe.
1268fb04e69cSuwe.Ss NetBSD/next68k
1269e05d95b9SclThe size of bootstrap programs is restricted to the free space before
1270e05d95b9Sclthe file system at the beginning of the disk minus 8KB.
1271e05d95b9Scl.
1272fb04e69cSuwe.Ss NetBSD/pmax
1273c1455b1bSlukemThe
1274e217b7d0Swiz.Nx Ns /pmax
1275c1455b1bSlukemsecondary bootstrap program can only load kernels from file
1276c1455b1bSlukemsystems starting at the beginning of disks.
1277c1455b1bSlukem.Pp
1278c1455b1bSlukemThe size of primary bootstrap programs is restricted to 7.5KB, even
1279fb04e69cSuwethough some file systems
1280fb04e69cSuwe.Pq e.g., ISO 9660
1281fb04e69cSuweare able to accommodate larger ones.
1282a88aa33fSlukem.
1283fb04e69cSuwe.Ss NetBSD/sun2 and NetBSD/sun3
1284724345d9SgrantThe
1285e217b7d0Swiz.Nx Ns /sun2
1286a88aa33fSlukemand
1287e217b7d0Swiz.Nx Ns /sun3
1288724345d9Sgrantsecondary bootstrap program can only load kernels from file
1289724345d9Sgrantsystems starting at the beginning of disks.
1290a88aa33fSlukem.
1291fb04e69cSuwe.Ss NetBSD/vax
1292724345d9SgrantThe
1293e217b7d0Swiz.Nx Ns /vax
1294724345d9Sgrantsecondary bootstrap program can only load kernels from file systems
1295724345d9Sgrantstarting at the beginning of disks.
1296724345d9Sgrant.Pp
1297724345d9SgrantThe size of primary bootstrap programs is restricted to 7.5KB, even
1298fb04e69cSuwethough some file systems
1299fb04e69cSuwe.Pq e.g., ISO 9660
1300fb04e69cSuweare able to accommodate larger ones.
1301