1*433d6423SLionel Sambuc.\" $NetBSD: boot.cfg.5,v 1.24 2011/11/28 09:38:45 wiz Exp $ 2*433d6423SLionel Sambuc.\" 3*433d6423SLionel Sambuc.\" Copyright (c) 2007 Stephen Borrill 4*433d6423SLionel Sambuc.\" All rights reserved. 5*433d6423SLionel Sambuc.\" 6*433d6423SLionel Sambuc.\" Redistribution and use in source and binary forms, with or without 7*433d6423SLionel Sambuc.\" modification, are permitted provided that the following conditions 8*433d6423SLionel Sambuc.\" are met: 9*433d6423SLionel Sambuc.\" 1. Redistributions of source code must retain the above copyright 10*433d6423SLionel Sambuc.\" notice, this list of conditions and the following disclaimer. 11*433d6423SLionel Sambuc.\" 2. Redistributions in binary form must reproduce the above copyright 12*433d6423SLionel Sambuc.\" notice, this list of conditions and the following disclaimer in the 13*433d6423SLionel Sambuc.\" documentation and/or other materials provided with the distribution. 14*433d6423SLionel Sambuc.\" 3. The name of the author may not be used to endorse or promote products 15*433d6423SLionel Sambuc.\" derived from this software without specific prior written permission 16*433d6423SLionel Sambuc.\" 17*433d6423SLionel Sambuc.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18*433d6423SLionel Sambuc.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19*433d6423SLionel Sambuc.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20*433d6423SLionel Sambuc.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21*433d6423SLionel Sambuc.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22*433d6423SLionel Sambuc.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23*433d6423SLionel Sambuc.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24*433d6423SLionel Sambuc.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25*433d6423SLionel Sambuc.\" INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26*433d6423SLionel Sambuc.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27*433d6423SLionel Sambuc.\" 28*433d6423SLionel Sambuc.Dd November 28, 2011 29*433d6423SLionel Sambuc.Dt BOOT.CFG 5 30*433d6423SLionel Sambuc.Os 31*433d6423SLionel Sambuc.Sh NAME 32*433d6423SLionel Sambuc.Nm boot.cfg 33*433d6423SLionel Sambuc.Nd configuration file for /boot 34*433d6423SLionel Sambuc.Sh DESCRIPTION 35*433d6423SLionel SambucThe file 36*433d6423SLionel Sambuc.Pa /boot.cfg 37*433d6423SLionel Sambucis used to alter the behaviour of the standard boot loader described in 38*433d6423SLionel Sambuc.Xr boot 8 . 39*433d6423SLionel SambucConfiguration changes include setting the timeout, choosing a console device, 40*433d6423SLionel Sambucaltering the banner text and displaying a menu allowing boot commands to be 41*433d6423SLionel Sambuceasily chosen. 42*433d6423SLionel SambucIf a 43*433d6423SLionel Sambuc.Nm 44*433d6423SLionel Sambucfile is not present, the system will boot as normal. 45*433d6423SLionel Sambuc.Ss FILE FORMAT 46*433d6423SLionel SambucThe format of the file is a series of lines containing keyword/value pairs 47*433d6423SLionel Sambucseparated by an equals sign 48*433d6423SLionel Sambuc.Pq Sq = . 49*433d6423SLionel SambucThere should be no whitespace surrounding the equals sign. 50*433d6423SLionel SambucLines beginning with a hash 51*433d6423SLionel Sambuc.Pq Sq # 52*433d6423SLionel Sambucare comments and will be ignored. 53*433d6423SLionel Sambuc.Pp 54*433d6423SLionel SambucSome keywords can be present multiple times in the file to define additional 55*433d6423SLionel Sambucitems. 56*433d6423SLionel SambucSuch keywords are noted below. 57*433d6423SLionel Sambuc.Pp 58*433d6423SLionel Sambuc.Bl -tag -width timeout 59*433d6423SLionel Sambuc.It Sy banner 60*433d6423SLionel Sambuc(may be present multiple times) 61*433d6423SLionel SambucThe text from banner lines is displayed instead of the standard welcome text 62*433d6423SLionel Sambucby the boot loader. 63*433d6423SLionel SambucUp to 10 lines can be defined. 64*433d6423SLionel SambucNo special character sequences are recognised, so to specify a blank line, a 65*433d6423SLionel Sambucbanner line with no value should be given. 66*433d6423SLionel Sambuc.It Sy clear 67*433d6423SLionel SambucIf nonzero, clear the screen before printing the banner. 68*433d6423SLionel SambucIf zero, do not clear the screen (the default). 69*433d6423SLionel Sambuc.It Sy consdev 70*433d6423SLionel SambucChanges the console device to that specified in the value. 71*433d6423SLionel SambucValid values are any of those that could be specified at the normal boot 72*433d6423SLionel Sambucprompt with the consdev command. 73*433d6423SLionel Sambuc.It Sy default 74*433d6423SLionel SambucUsed to specify the default menu item which will be chosen in the case of 75*433d6423SLionel SambucReturn being pressed or the timeout timer reaching zero. 76*433d6423SLionel SambucThe value is the number of the menu item as displayed. 77*433d6423SLionel SambucAs described above, the menu items are counted from 1 in the order listed in 78*433d6423SLionel Sambuc.Nm . 79*433d6423SLionel SambucIf not specified, the default value will be option 1, i.e. the first item. 80*433d6423SLionel Sambuc.It Sy format 81*433d6423SLionel SambucChanges how the menu options are displayed. 82*433d6423SLionel SambucShould be set to one of 83*433d6423SLionel Sambuc.Sq a 84*433d6423SLionel Sambucfor automatic, 85*433d6423SLionel Sambuc.Sq l 86*433d6423SLionel Sambucfor letters and 87*433d6423SLionel Sambuc.Sq n 88*433d6423SLionel Sambucfor numbers. 89*433d6423SLionel SambucIf set to automatic (the default), menu options will be displayed numerically 90*433d6423SLionel Sambucunless there are more than 9 options and the timeout is greater than zero. 91*433d6423SLionel SambucIf there are more than 9 options with a timeout greater than zero and 92*433d6423SLionel Sambucthe format is set to number, only the first 9 options will be available. 93*433d6423SLionel Sambuc.It Sy load 94*433d6423SLionel SambucUsed to load kernel modules, which will be passed on to the kernel for 95*433d6423SLionel Sambucinitialization during early boot. 96*433d6423SLionel SambucThe argument is either the complete path and file name of the module to be 97*433d6423SLionel Sambucloaded, or a symbolic module name. 98*433d6423SLionel SambucWhen the argument is not an absolute path, the boot loader will first 99*433d6423SLionel Sambucattempt to load 100*433d6423SLionel Sambuc.Pa /stand/\*[Lt]machine\*[Gt]/\*[Lt]kernel_version\*[Gt]/modules/\*[Lt]name\*[Gt]/\*[Lt]name\*[Gt].kmod . 101*433d6423SLionel SambucIf that file does not exist, it will then attempt to load 102*433d6423SLionel Sambuc.Pa /\*[Lt]name\*[Gt] . 103*433d6423SLionel SambucMay be used as many times as needed. 104*433d6423SLionel Sambuc.It Sy menu 105*433d6423SLionel Sambuc(may be present multiple times) 106*433d6423SLionel SambucUsed to define a menu item to be displayed to the end-user at boot time 107*433d6423SLionel Sambucwhich allows a series of boot commands to be run without further typing. 108*433d6423SLionel SambucThe value consists of the required menu text, followed by a colon 109*433d6423SLionel Sambuc.Pq Sq \&: 110*433d6423SLionel Sambucand then the desired command(s). 111*433d6423SLionel SambucMultiple commands can be specified separated by a semi-colon. 112*433d6423SLionel SambucIf the specified menu text is empty 113*433d6423SLionel Sambuc(the colon appears immediately after the equals sign), 114*433d6423SLionel Sambucthen the displayed menu text is the same as the command. 115*433d6423SLionel SambucFor example: 116*433d6423SLionel Sambuc.Bd -literal 117*433d6423SLionel Sambucmenu=Boot normally:boot 118*433d6423SLionel Sambucmenu=Boot single-user:boot -s 119*433d6423SLionel Sambucmenu=Boot with module foo:load /foo.kmod;boot 120*433d6423SLionel Sambucmenu=Boot with serial console:consdev com0;boot 121*433d6423SLionel Sambucmenu=:boot hd1a:netbsd -as 122*433d6423SLionel Sambuc.Ed 123*433d6423SLionel Sambuc.Pp 124*433d6423SLionel SambucEach menu item will be prefixed by an ascending number when displayed, 125*433d6423SLionel Sambuci.e. the order in the 126*433d6423SLionel Sambuc.Nm 127*433d6423SLionel Sambucfile is important. 128*433d6423SLionel Sambuc.Pp 129*433d6423SLionel SambucEach command is executed just as though the user had typed it in 130*433d6423SLionel Sambucand so can be any valid command that would be accepted at the 131*433d6423SLionel Sambucnormal boot prompt. 132*433d6423SLionel SambucIn addition, 133*433d6423SLionel Sambuc.Dq Ic edit 134*433d6423SLionel Sambuccan be used to put the menu in editing mode, allowing the user to modify the 135*433d6423SLionel Sambucnext selected option before executing it, and 136*433d6423SLionel Sambuc.Dq Ic prompt 137*433d6423SLionel Sambuccan be used to drop to the normal boot prompt. 138*433d6423SLionel Sambuc.It Sy timeout 139*433d6423SLionel SambucIf the value is greater than zero, this specifies the time in seconds 140*433d6423SLionel Sambucthat the boot loader will wait for the end-user to choose a menu item. 141*433d6423SLionel SambucDuring the countdown period, they may press Return to choose the default 142*433d6423SLionel Sambucoption or press a number key corresponding to a menu option. 143*433d6423SLionel SambucIf any other key is pressed, the countdown will stop and the user will be 144*433d6423SLionel Sambucprompted to choose a menu option with no further time limit. 145*433d6423SLionel SambucIf the timeout value is set to zero, the default option will be booted 146*433d6423SLionel Sambucimmediately. 147*433d6423SLionel SambucIf the timeout value is negative or is not a number, there will be no 148*433d6423SLionel Sambuctime limit for the user to choose an option. 149*433d6423SLionel Sambuc.It Sy userconf 150*433d6423SLionel SambucPasses a 151*433d6423SLionel Sambuc.Xr userconf 4 152*433d6423SLionel Sambuccommand to the kernel at boot time . 153*433d6423SLionel Sambuc.It Sy rndseed 154*433d6423SLionel SambucTakes the path to a random-seed file as written by the 155*433d6423SLionel Sambuc.Fl S 156*433d6423SLionel Sambucflag to 157*433d6423SLionel Sambuc.Xr rndctl 8 158*433d6423SLionel Sambucas an argument. 159*433d6423SLionel SambucThis file is used to seed the kernel entropy pool 160*433d6423SLionel Sambuc.Xr rnd 9 161*433d6423SLionel Sambucvery early in kernel startup, so that high quality randomness is 162*433d6423SLionel Sambucavailable to all kernel modules. 163*433d6423SLionel SambucThis argument should be supplied 164*433d6423SLionel Sambucbefore any 165*433d6423SLionel Sambuc.Dq Ic load 166*433d6423SLionel Sambuccommands that may load executable modules. 167*433d6423SLionel Sambuc.El 168*433d6423SLionel Sambuc.Sh EXAMPLES 169*433d6423SLionel SambucHere is an example 170*433d6423SLionel Sambuc.Nm 171*433d6423SLionel Sambucfile: 172*433d6423SLionel Sambuc.Bd -literal -offset indent 173*433d6423SLionel Sambucbanner=Welcome to NetBSD 174*433d6423SLionel Sambucbanner================== 175*433d6423SLionel Sambucbanner= 176*433d6423SLionel Sambucbanner=Please choose an option from the following menu: 177*433d6423SLionel Sambucmenu=Boot normally:boot 178*433d6423SLionel Sambucmenu=Boot single-user:boot -s 179*433d6423SLionel Sambucmenu=Boot from second disk:boot hd1a: 180*433d6423SLionel Sambucmenu=Boot with module foo:load /foo.kmod;boot 181*433d6423SLionel Sambucmenu=Boot with modules foo and bar:load /foo.kmod;load /bar.kmod;boot 182*433d6423SLionel Sambucmenu=Boot Xen with 256MB for dom0:load /netbsd-XEN3_DOM0 console=pc;multiboot /usr/pkg/xen3-kernel/xen.gz dom0_mem=256M 183*433d6423SLionel Sambucmenu=Boot Xen with 256MB for dom0 (serial):load /netbsd-XEN3_DOM0 console=com0;multiboot /usr/pkg/xen3-kernel/xen.gz dom0_mem=256M console=com1 com1=115200,8n1 184*433d6423SLionel Sambucmenu=Boot Xen with dom0 in single-user mode:load /netbsd-XEN3_DOM0 -s;multiboot /usr/pkg/xen3-kernel/xen.gz dom0_mem=256M 185*433d6423SLionel Sambucmenu=Go to command line (advanced users only):prompt 186*433d6423SLionel Sambucclear=1 187*433d6423SLionel Sambuctimeout=-1 188*433d6423SLionel Sambucdefault=1 189*433d6423SLionel Sambucuserconf disable ehci* 190*433d6423SLionel Sambuc# Always load ramdisk module 191*433d6423SLionel Sambucload=/miniroot.kmod 192*433d6423SLionel Sambuc.Ed 193*433d6423SLionel Sambuc.Pp 194*433d6423SLionel SambucN.B. Xen counts serial ports from com1 upwards, but 195*433d6423SLionel Sambuc.Nx 196*433d6423SLionel Sambuccounts from com0, so the appropriate device name must be used. 197*433d6423SLionel SambucPlease see the Xen with serial console example above. 198*433d6423SLionel Sambuc.Pp 199*433d6423SLionel SambucThis will clear the screen and display: 200*433d6423SLionel Sambuc.Bd -literal -offset indent 201*433d6423SLionel SambucWelcome to NetBSD 202*433d6423SLionel Sambuc================= 203*433d6423SLionel Sambuc 204*433d6423SLionel SambucPlease choose an option from the following menu: 205*433d6423SLionel Sambuc 206*433d6423SLionel Sambuc 1. Boot normally 207*433d6423SLionel Sambuc 2. Boot single-user 208*433d6423SLionel Sambuc 3. Boot from second disk 209*433d6423SLionel Sambuc 4. Boot with module foo 210*433d6423SLionel Sambuc 5. Boot with modules foo and bar 211*433d6423SLionel Sambuc 6. Boot Xen with 256 MB for dom0 212*433d6423SLionel Sambuc 7. Boot Xen with 256 MB for dom0 (serial) 213*433d6423SLionel Sambuc 8. Boot Xen with dom0 in single-user mode 214*433d6423SLionel Sambuc 9. Go to command line (advanced users only) 215*433d6423SLionel Sambuc 216*433d6423SLionel SambucOption [1]: 217*433d6423SLionel Sambuc.Ed 218*433d6423SLionel Sambuc.Pp 219*433d6423SLionel SambucIt will then wait for the user to type 1, 2, 3, 4, 5, 6, 7, 8 or 9 followed by 220*433d6423SLionel SambucReturn. 221*433d6423SLionel SambucPressing Return by itself will run option 1. 222*433d6423SLionel SambucThere will be no timeout. 223*433d6423SLionel Sambuc.Sh SEE ALSO 224*433d6423SLionel Sambuc.Xr boot 8 , 225*433d6423SLionel Sambuc.Xr boothowto 9 226*433d6423SLionel Sambuc.Sh HISTORY 227*433d6423SLionel SambucThe 228*433d6423SLionel Sambuc.Nm 229*433d6423SLionel Sambucfile appeared in 230*433d6423SLionel Sambuc.Nx 5.0 . 231*433d6423SLionel Sambuc.Sh AUTHORS 232*433d6423SLionel SambucThe 233*433d6423SLionel Sambuc.Nm 234*433d6423SLionel Sambucextensions to 235*433d6423SLionel Sambuc.Xr boot 8 236*433d6423SLionel Sambucwere written by 237*433d6423SLionel Sambuc.An Stephen Borrill 238*433d6423SLionel Sambuc.Aq sborrill@NetBSD.org . 239*433d6423SLionel Sambuc.Sh BUGS 240*433d6423SLionel SambucSupport for 241*433d6423SLionel Sambuc.Nm 242*433d6423SLionel Sambucis currently for 243*433d6423SLionel Sambuc.Nx Ns /i386 244*433d6423SLionel Sambucand 245*433d6423SLionel Sambuc.Nx Ns /amd64 246*433d6423SLionel Sambuconly. 247*433d6423SLionel SambucIt is hoped that its use will be extended to other appropriate ports that 248*433d6423SLionel Sambucuse the 249*433d6423SLionel Sambuc.Xr boot 8 250*433d6423SLionel Sambucinterface. 251