xref: /freebsd/stand/forth/loader.4th.8 (revision 02e9120893770924227138ba49df1edb3896112a)
1.\" Copyright (c) 1999 Daniel C. Sobral
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.Dd November 13, 2013
26.Dt LOADER.4TH 8
27.Os
28.Sh NAME
29.Nm loader.4th
30.Nd loader.conf processing tools
31.Sh DESCRIPTION
32The file that goes by the name of
33.Nm
34is a set of commands designed to manipulate
35.Xr loader.conf 5
36files.
37The default
38.Pa /boot/loader.rc
39includes
40.Nm
41and uses one of its commands to automatically read and process
42the standard
43.Xr loader.conf 5
44files.
45Other commands exists to help the user specify alternate
46configurations.
47.Pp
48The commands of
49.Nm
50by themselves are not enough for most uses.
51Please refer to the
52examples below for the most common situations, and to
53.Xr loader 8
54for additional commands.
55.Pp
56Before using any of the commands provided in
57.Nm ,
58it must be included
59through the command:
60.Pp
61.Dl include loader.4th
62.Pp
63This line is present in the default
64.Pa /boot/loader.rc
65file, so it is not needed (and should not be re-issued) in a normal setup.
66.Pp
67The commands provided by it are:
68.Bl -tag -width disable-module_module -compact -offset indent
69.It Ic boot
70.It Ic boot Ar kernelname Op Cm ...
71.It Ic boot Ar directory Op Cm ...
72.It Ic boot Fl flag Cm ...
73Boot as specified by the
74.Xr loader.conf 5
75files read.
76.Pp
77Depending on the arguments passed, it can override boot flags and
78either the kernel name or the search path for kernel and modules.
79.Pp
80.It Ic boot-conf
81.It Ic boot-conf Ar kernelname Op Cm ...
82.It Ic boot-conf Ar directory Op Cm ...
83.It Ic boot-conf Fl flag Cm ...
84Works like
85.Ic boot
86described above, but instead of booting immediately, uses
87.Ic autoboot ,
88so it can be stopped.
89.Pp
90.It Ic start
91Reads
92.Pa /boot/defaults/loader.conf ,
93all other
94.Xr loader.conf 5
95files specified in it, then loads the desired kernel and modules
96.Pq if not already loaded .
97After which you can use the
98.Ic boot
99or
100.Ic autoboot
101commands or simply exit (provided
102.Va autoboot_delay
103is not set to NO) to boot the system.
104.Ic start
105is the command used in the default
106.Pa /boot/loader.rc
107file
108.Pq see Xr loader 8 .
109.Pp
110.It Ic initialize
111Initialize the support library so commands can be used without executing
112.Ic start
113first.
114Like
115.Ic start ,
116it reads
117.Pa /boot/defaults/loader.conf
118and all other
119.Xr loader.conf 5
120files specified in it
121.Pq but does not load kernel or modules .
122Returns a flag on the stack to indicate
123if any configuration files were successfully loaded.
124.Pp
125.It Ic read-conf Ar filename
126Reads and processes a
127.Xr loader.conf 5
128file.
129Does not proceed to boot.
130.Pp
131.It Ic enable-module Ar module
132Enables the loading of
133.Ar module .
134.Pp
135.It Ic disable-module Ar module
136Disables the loading of
137.Ar module .
138.Pp
139.It Ic toggle-module Ar module
140Toggles the loading of
141.Ar module
142on and off.
143.Pp
144.It Ic show-module Ar module
145Shows the information gathered in the
146.Xr loader.conf 5
147files about the module
148.Ar module .
149.Pp
150.It Ic retry
151Used inside
152.Xr loader.conf 5
153files to specify the action after a module loading fails.
154.Pp
155.It Ic ignore
156Used inside
157.Xr loader.conf 5
158files to specify the action after a module loading fails.
159.It Ic try-include Ar file Op Ar
160Process script files if they exist.
161Each file, in turn, is completely read into memory,
162and then each of its lines is passed to the command line interpreter.
163If any error is returned by the interpreter, the try-include
164command aborts immediately, without reading any other files, and
165silently returns without error.
166.El
167.Sh FILES
168.Bl -tag -width /boot/loader.4th -compact
169.It Pa /boot/loader
170The
171.Xr loader 8 .
172.It Pa /boot/loader.4th
173.Nm
174itself.
175.It Pa /boot/loader.rc
176.Xr loader 8
177bootstrapping script.
178.It Pa /boot/defaults/loader.conf
179File loaded by the
180.Ic start
181command.
182.El
183.Sh EXAMPLES
184Standard
185.Pa /boot/loader.rc :
186.Pp
187.Bd -literal -offset indent -compact
188include /boot/loader.4th
189start
190.Ed
191.Pp
192Load a different kernel with the standard configuration:
193.Pp
194.Bd -literal -offset indent -compact
195set kernel="kernel.old"
196unload
197boot-conf
198.Ed
199.Pp
200Read an additional configuration file and then proceed to boot:
201.Pp
202.Bd -literal -offset indent -compact
203unload
204read-conf /boot/special.conf
205boot-conf
206.Ed
207.Pp
208Disable the loading of the splash screen module and bitmap and then
209proceed to boot:
210.Pp
211.Bd -literal -offset indent -compact
212unload
213disable-module splash_bmp
214disable-module bitmap
215boot-conf
216.Ed
217.Sh SEE ALSO
218.Xr loader.conf 5 ,
219.Xr loader 8
220.Sh HISTORY
221The
222.Nm
223set of commands first appeared in
224.Fx 3.2 .
225.Sh AUTHORS
226The
227.Nm
228set of commands was written by
229.An Daniel C. Sobral Aq dcs@FreeBSD.org .
230.Sh BUGS
231A British espionage series.
232