forked from rhboot/grubby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grubby.8
405 lines (323 loc) · 13.4 KB
/
grubby.8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
.TH GRUBBY 8 "Tue Jan 18 2005"
.SH NAME
grubby \- command line tool used to configure bootloader menu entries across
multiple architectures
.SH SYNOPSIS
\fBgrubby\fR [\fIOPTIONS\fR]
.SH DESCRIPTION
.SS General Information
\fBgrubby\fR is a command line tool for updating and displaying information
about the configuration files for various architecture specific bootloaders.
It is primarily designed to be used from scripts which install new kernels
and need to find information about the current boot environment.
.SS Architecture Support
The \fBgrubby\fR executable has full support for the \fBgrub2\fR
bootloader on \fBx86_64\fR systems using legacy BIOS or modern
UEFI firmware and \fBppc64\fR and \fBppc64le\fR hardware using
OPAL or SLOF as firmware.
Legacy \fBs390\fR and the current \fBs390x\fR architectures
and their \fBzipl\fR bootloader are fully supported.
Support for \fByaboot\fR has been deprecated as all ppc architecture
hardware since the Power8 uses \fBgrub2\fR or petitboot
which both use the grub2 configuration file format.
Legacy bootloaders \fBLILO\fR, \fBSILO\fR, and \fBELILO\fR
are deprecated and no longer receiving active support in favor of
previously mentioned bootloaders.
.SS Default Behavior
The default bootloader target is primarily determined by the architecture
for which grubby has been built. Each architecture has a preferred
bootloader, and each bootloader has its own configuration file. If no
bootloader is selected on the command line, grubby will use these default
settings to search for an existing configuration. If no bootloader
configuration file is found, grubby will use the default value for that
architecture. These defaults are listed in the table below.
.TS
allbox;
lbw6 lbw10 lbw18
l l l.
Arch Bootloader Configuration File
x86_64 [BIOS] grub2 /boot/grub2/grub.cfg
x86_64 [UEFI] grub2 /boot/efi/EFI/redhat/grub.cfg
i386 grub2 /boot/grub2/grub.cfg
ia64 elilo /boot/efi/EFI/redhat/elilo.conf
ppc [>=Power8] grub2 /boot/grub2/grub.cfg
ppc [<=Power7] yaboot /etc/yaboot.conf
s390 zipl /etc/zipl.conf
s390x zipl /etc/zipl.conf
.TE
.SS Special Arguments
There are a number of ways to specify the kernel used for \fB-\-info\fR,
\fB-\-remove-kernel\fR, and \fB-\-update-kernel\fR. Specifying \fBDEFAULT\fR
or \fBALL\fR selects the default entry and all of the entries, respectively.
If a comma separated list of numbers is given, the boot entries indexed
by those numbers are selected. Finally, the title of a boot entry may
be specified by using \fBTITLE=\fItitle\fR as the argument; all entries
with that title are used.
.SH OPTIONS
.SS Basic Options
.TP
\fB-\-add-kernel\fR=\fIkernel-path\fR
Add a new boot entry for the kernel located at \fIkernel-path\fR. A title for
the boot entry must be set using \fB-\-title\fR. Most invocations should also
include \fB-\-initrd\fR with memtest86 as a notable exception.
The \fB-\-update-kernel\fR option may not be used in the same invocation.
.TP
\fB-\-remove-kernel\fR=\fIkernel-path\fR
Remove all boot entries which match \fIkernel-path\fR. This may be used
along with \fB-\-add-kernel\fR, in which case the new entry being added will
not be removed.
.TP
\fB-\-update-kernel\fR=\fIkernel-path\fR
Update the entries for kernels matching \fRkernel-path\fR. Currently
the only item that can be updated is the kernel argument list, which is
modified via the \fB-\-args\fR and \fB-\-remove-args\fR options.
.TP
\fB-\-args\fR=\fIkernel-args\fR
When a new kernel is added, this specifies the command line arguments
which should be passed to the kernel by default (note they are merged
with the arguments from the template if \fB-\-copy-default\fR is used).
When \fB-\-update-kernel\fR is used, this specifies new arguments to add
to the argument list. Multiple, space separated arguments may be used. If
an argument already exists the new value replaces the old values. The
\fBroot=\fR kernel argument gets special handling if the configuration
file has special handling for specifying the root filesystem (like
lilo.conf does).
.TP
\fB-\-remove-args\fR=\fIkernel-args\fR
The arguments specified by \fIkernel-args\fR are removed from the
kernels specified by \fB-\-update-kernel\fR. The \fBroot\fR argument
gets special handling for configuration files that support separate root
filesystem configuration.
.TP
\fB-\-copy-default\fR
\fBgrubby\fR will copy as much information (such as kernel arguments and
root device) as possible from the current default kernel. The kernel path
and initrd path will never be copied.
.TP
\fB-\-title\fR=\fIentry-title\fR
When a new kernel entry is added \fIentry-title\fR is used as the title
(\fBlilo\fR label) for the entry. If \fIentry-title\fR is longer then maximum
length allowed by the bootloader (15 for lilo, unlimited for grub and elilo)
the title is shortened to a (unique) entry.
.TP
\fB-\-initrd\fR=\fIinitrd-path\fR
Use \fIinitrd-path\fR as the path to an initial ram disk for a new kernel
being added.
.TP
\fB-\-efi\fR
Use appropriate bootloader commands for EFI on this architecture.
.TP
\fB-\-set-default\fR=\fIkernel-path\fR
The first entry which boots the specified kernel is made the default
boot entry. This may not be invoked with \fB-\-set-default-index\fR.
.TP
\fB-\-set-default-index\fR=\fIentry-index\fR
Makes the given entry number the default boot entry. This may not be invoked
with \fB-\-set-default\fR. The given value represents the index in the
post-modification boot entry list.
.TP
\fB-\-make-default\fR
Make the new kernel entry being added the default entry.
.TP
\fB-\-set-index\fR=\fIentry-index\fR
Set the position at which to add a new entry created with \fB-\-add-kernel\fR.
.TP
\fB-\-debug\fR
Display extra debugging information for failures.
.TP
\fB-i\fR, \fB-\-extra-initrd\fR=\fIinitrd-path\fR
Use \fIinitrd-path\fR as the path for an auxiliary initrd image.
.SS Display Options
Passing the display option to grubby will cause it to print out the
requested information about the current bootloader configuration and
then immediately exit. These options should not be used in any
script intended to update the bootloader configuration.
.TP
\fB-\-default-kernel\fR
Display the full path to the current default kernel and exit.
.TP
\fB-\-default-index\fR
Display the numeric index of the current default boot entry and exit.
.TP
\fB-\-default-title\fR
Display the title of the current default boot entry and exit.
.TP
\fB-\-info\fR=\fIkernel-path\fR
Display information on all boot entries which match \fIkernel-path\fR. If
\fIkernel-path\fR is \fBDEFAULT\fR, then information on the default kernel
is displayed. If \fIkernel-path\fR is \fBALL\fR, then information on all boot
entries are displayed.
.TP
\fB-\-bootloader-probe\fR
Attempt to probe for installed bootloaders. If this option is specified,
\fBgrubby\fR tries to determine if \fBgrub\fR or \fBlilo\fR is currently
installed. When one of those bootloaders is found the name of that
bootloader is displayed on stdout. Both could be installed (on different
devices), and grubby will print out the names of both bootloaders, one per
line. The probe for \fBgrub\fR requires a commented out boot directive
\fBgrub.conf\fR identical to the standard directive in the lilo
configuration file. If this is not present \fBgrubby\fR will assume grub is
not installed (note that \fBanaconda\fR places this directive in
\fBgrub.conf\fR files it creates).
\fIThis option is only available on x86 BIOS platforms.\fR
.TP
\fB-v\fR, \fB-\-version\fR
Display the version of \fBgrubby\fR being run and then exit immediately.
.SS Output Format Options
Sane default options for the current platform are compiled into grubby on
a per platform basis. These defaults determine the format and layout of
the generated bootloader configuration file. A different configuration file
format may be specified on the command line if the system uses a supported
alternative bootloader.
.TP
\fB-\-elilo\fR
Use an \fBelilo\fR style configuration file. This is the default on ia64
platforms. This format is deprecated.
.TP
\fB-\-extlinux\fR
Use an \fBextlinux\fR style configuration file. This format is deprecated.
.TP
\fB-\-grub\fR
Use a \fBgrub\fR style configuration file. This is the default on the i386
architecture.
.TP
\fB-\-grub2\fR
Use a \fBgrub2\fR style configuration file. This is the default on
\fBx86_64\fR architecture as well as the \fBppc64\fR and \fBppc64le\fR
architectures running on Power8 or later hardware.
.TP
\fB-\-lilo\fR
Use a \fBlilo\fR style configuration file.
.TP
\fB-\-silo\fR
Use a \fBsilo\fR style configuration file. This is the default on SPARC
systems. This format is legacy, deprecated, and unsupported.
.TP
\fB-\-yaboot\fR
Use a \fByaboot\fR style configuration file. This is the default for
the \fBppc\fR architecture on on Power7 and earlier hardware.
.TP
\fB-\-zipl\fR
Use a \fBzipl\fR style configuration file. This is the default on the
legacy s390 and current s390x architectures.
.SS Override Options
.TP
\fB-\-bad-image-okay\fR
When \fBgrubby\fR is looking for a entry to use for something (such
as a template or a default boot entry) it uses sanity checks, such as
ensuring that the kernel exists in the filesystem, to make sure
entries that obviously won't work aren't selected. This option overrides
that behavior, and is designed primarily for testing.
.TP
\fB-\-boot-filesystem\fR=\fIbootfs\fR
The \fBgrub\fR boot loader expects file paths listed in its configuration
path to be relative to the top of the filesystem they are on, rather then
relative to the current root filesystem. By default \fBgrubby\fR searches
the list of currently mounted filesystems to determine this. If this option
is given \fBgrubby\fR acts as if the specified filesystem was the filesystem
containing the kernel (this option is designed primarily for testing).
.TP
\fB-\-env\fR=\fIpath\fR
Path for the file where grub environment data is stored.
.TP
\fB-c\fR, \fB-\-config-file\fR=\fIpath\fR
Use \fIpath\fR as the configuration file rather then the default.
.TP
\fB-o\fR, \fB-\-output-file\fR=\fIfile_path\fR
The destination path for the updated configuration file. Use "-" to
send it to stdout.
.TP
\fB-\-devtree\fR=\fIfile_path\fR
Use \fIpath\fR for device tree path in place of the path of any devicetree
directive found in the template stanza.
.TP
\fB-\-devtreedir\fR=\fIfile_path\fR
Use the specified \fIfile path\fR to load the devicetree definition. This is
for platforms where a flat file is used instead of firmware to instruct the
kernel how to communicate with devices.
.SS Multiboot Options
The Multiboot Specification provides a generic interface for boot
loaders and operating systems. It is supported by the GRUB bootloader.
.TP
\fB-\-add-multiboot\fR=\fImultiboot-path\fR
Add a new boot entry for the multiboot kernel located at
\fImultiboot-path\fR. Note that this is generally accompanied with a
\fB--add-kernel\fR option.
.TP
\fB-\-remove-multiboot\fR=\fImultiboot-path\fR
Removes all boot entries which match \fImultiboot-path\fR.
.TP
\fB-\-mbargs\fR=\fImultiboot-args\fR
When a new multiboot kernel is added, this specifies the command line
arguments which should be passed to that kernel by default
When \fB-\-update-kernel\fR is used, this specifies new arguments to add
to the argument list. Multiple, space separated arguments may be used. If
an argument already exists the new value replaces the old values.
.TP
\fB-\-remove-mbargs\fR=\fImultiboot-args\fR
The arguments specified by \fImultiboot-args\fR are removed from the
kernels specified by \fB-\-update-kernel\fR.
.SH "BUGS"
The command line syntax is more than a little baroque. This probably
won't be fixed as \fBgrubby\fR is only intended to be called from shell
scripts which can get it right.
.SH EXAMPLE
The following examples assume the following:
.TS
allbox;
rbw15 l.
cfg_file Full path to bootloader config file
new_kernel Full path to kernel image to be installed
old_kernel Full path to old kernel image to be removed
current_kernel Full path to a currently installed kernel
entry_title Title that appears on bootloader menu
new_initrd Full path to initrd for a new kernel
kernel_args Set of arguments for the kernel
menu_index Index number of a menu entry
.TE
The examples below quote strings that may have spaces or other whitespace in
them. It is also perfectly valid to backslash escape these strings if that
is more convenient.
.PP
Add a new kernel entry and copy all options from the current default kernel.
This is the behavior that most users will want.
.IP
\fBgrubby\fR --add-kernel=\fInew_kernel\fR --title="\fIentry_title\fR" --initrd="\fInew_initrd\fR" --copy-default
.PP
Add a new kernel entry with custom arguments
.IP
\fBgrubby\fR --add-kernel=\fInew_kernel\fR --title="\fIentry_title\fR" --initrd="\fInew_initrd\fR" --args=\fIkernel_args\fR
.PP
Remove \fBall menu entries\fR for a specified kernel.
.IP
\fBgrubby\fR --remove-kernel=\fIold_kernel\fR
.PP
Target a single menu entry to remove without targetting other entries with
the same kernel.
.IP
\fBgrubby\fR --info=\fIold_kernel\fR
\fBgrubby\fR --remove-kernel=\fImenu_index\fR
.PP
Update the arguments for all entries of a specific kernel. New arguments get
added while existing arguments get updated values.
.IP
\fBgrubby\fR --update-kernel=\fIcurrent_kernel\fR --args="\fIkernel_args\fR"
.PP
Remove the arguments for a single entry of a specific kernel.
.IP
\fBgrubby\fR --info=\fIcurrent_kernel\fR
\fBgrubby\fR --remove-args=\fImenu_index\fR --args="\fIkernel_args\fR"
.SH "SEE ALSO"
.BR grub (8),
.BR lilo (8),
.BR yaboot (8),
.BR zipl (8),
.BR dracut (8),
.BR mkinitrd (8)
.SH AUTHORS
.nf
Erik Troan
Jeremy Katz
Peter Jones
Robert Marshall
.fi