303821d
.TH GRUBBY 8 "Wed Apr 29 2020"
303821d
.SH NAME
303821d
grubby \- command line tool for configuring grub and zipl
303821d
303821d
.SH SYNOPSIS
303821d
\fBgrubby\fR [--add-kernel=\fIkernel-path\fR] [--args=\fIargs\fR]
303821d
       [--bad-image-okay] [--config-file=\fIpath\fR] [--copy-default]
303821d
       [--default-kernel] [--default-index] [--default-title]
303821d
       [--env=\fIpath\fR] [--grub2] [--info=\fIkernel-path\fR]
303821d
       [--initrd=\fIinitrd-path\fR] [--extra-initrd=\fIinitrd-path\fR]
303821d
       [--make-default] [--remove-args=\fIargs\fR]
303821d
       [--remove-kernel=\fIkernel-path\fR] [--set-default=\fIkernel-path\fR]
303821d
       [--set-default-index=\fientry-index\fR] [--title=\fentry-title\fR]
303821d
       [--update-kernel=\fIkernel-path\fR] [--zipl] [--bls-directory=\fIpath\fR]
303821d
303821d
.SH DESCRIPTION
303821d
\fBgrubby\fR is a command line tool for updating and displaying information
303821d
about the configuration files for the \fBgrub2\fR and \fBzipl\fR boot loaders.
303821d
It is primarily designed to be used from scripts which install new kernels and
303821d
need to find information about the current boot environment.
303821d
303821d
On BIOS-based Intel x86 platforms, \fBgrub2\fR is the default bootloader and
303821d
the configuration file is in \fB/boot/grub2/grub.cfg\fR. On UEFI-based Intel
303821d
x86 platforms, \fBgrub2\fR is the default bootloader, and the configuration
303821d
file is in \fB/boot/efi/EFI/redhat/grub.cfg\fR. On PowerPC platforms, systems
303821d
based on Power8 and Power9 support \fBgrub2\fR as a bootloader and use a
303821d
configuration stored in \fB/boot/grub2/grub.cfg\fR. On s390x platforms the
303821d
\fBzipl\fR bootloader use a default configuration in \fB/etc/zipl.conf\fR.
303821d
303821d
All bootloaders define the boot entries as individual configuration fragments
303821d
that are stored by default in \fB/boot/loader/entries\fR. The format for the
303821d
config files is specified at \fBhttps://systemd.io/BOOT_LOADER_SPECIFICATION\fR.
303821d
The \fBgrubby\fR tool is used to update and display the configuration defined
303821d
in the BootLoaderSpec fragment files.
303821d
303821d
There are a number of ways to specify the kernel used for \fB-\-info\fR,
303821d
\fB-\-remove-kernel\fR, and \fB-\-update-kernel\fR. Specificying \fBDEFAULT\fR
303821d
or \fBALL\fR selects the default entry and all of the entries, respectively.
303821d
Also, the title of a boot entry may be specified by using \fBTITLE=\fItitle\fR
303821d
as the argument; all entries with that title are used.
303821d
303821d
.SH OPTIONS
303821d
.TP
303821d
\fB-\-add-kernel\fR=\fIkernel-path\fR
303821d
Add a new boot entry for the kernel located at \fIkernel-path\fR.
303821d
303821d
.TP
303821d
\fB-\-args\fR=\fIkernel-args\fR
303821d
When a new kernel is added, this specifies the command line arguments
303821d
which should be passed to the kernel by default (note they are merged
303821d
with the arguments of the default entry if \fB-\-copy-default\fR is used).
303821d
When \fB-\-update-kernel\fR is used, this specifies new arguments to add
303821d
to the argument list. Multiple, space separated arguments may be used. If
303821d
an argument already exists the new value replaces the old values. The
303821d
\fBroot=\fR kernel argument gets special handling if the configuration
303821d
file has special handling for specifying the root filesystem.
303821d
303821d
.TP
303821d
\fB-\-bad-image-okay\fR
303821d
When \fBgrubby\fR is looking for an entry to use for something (such
303821d
as a default boot entry) it uses sanity checks, such as ensuring that
303821d
the kernel exists in the filesystem, to make sure entries that obviously
303821d
won't work aren't selected. This option overrides that behavior, and is
303821d
designed primarily for testing.
303821d
303821d
.TP
303821d
\fB-\-config-file\fR=\fIpath\fR
303821d
Use \fIpath\fR as the configuration file rather then the default.
303821d
303821d
.TP
303821d
\fB-\-copy-default\fR
303821d
\fBgrubby\fR will copy as much information (such as kernel arguments and
303821d
root device) as possible from the current default kernel. The kernel path
303821d
and initrd path will never be copied.
303821d
303821d
.TP
303821d
\fB-\-default-kernel\fR
303821d
Display the full path to the current default kernel and exit.
303821d
303821d
.TP
303821d
\fB-\-default-index\fR
303821d
Display the numeric index of the current default boot entry and exit.
303821d
303821d
.TP
303821d
\fB-\-default-title\fR
303821d
Display the title of the current default boot entry and exit.
303821d
303821d
.TP
303821d
\fB-\-env\fR=\fIpath\fR
303821d
Use \fIpath\fR as the grub2 environment block file rather then the default path.
303821d
303821d
.TP
303821d
\fB-\-grub2\fR
303821d
Configure \fBgrub2\fR bootloader.
303821d
303821d
.TP
303821d
\fB-\-info\fR=\fIkernel-path\fR
303821d
Display information on all boot entries which match \fIkernel-path\fR. If
303821d
\fIkernel-path\fR is \fBDEFAULT\fR, then information on the default kernel
303821d
is displayed. If \fIkernel-path\fR is \fBALL\fR, then information on all boot
303821d
entries are displayed.
303821d
303821d
.TP
303821d
\fB-\-initrd\fR=\fIinitrd-path\fR
303821d
Use \fIinitrd-path\fR as the path to an initial ram disk for a new kernel
303821d
being added.
303821d
303821d
.TP
303821d
\fB-\-extrainitrd\fR=\fIinitrd-path\fR
303821d
Use \fIinitrd-path\fR as the path to an auxiliary init ram disk image to be
303821d
added to the boot entry.
303821d
303821d
.TP
303821d
\fB-\-make-default\fR
303821d
Make the new kernel entry being added the default entry.
303821d
303821d
.TP
303821d
\fB-\-remove-args\fR=\fIkernel-args\fR
303821d
The arguments specified by \fIkernel-args\fR are removed from the kernels
303821d
specified by \fB-\-update-kernel\fR. The \fBroot\fR argument gets special
303821d
handling for configuration files that support separate root filesystem
303821d
configuration.
303821d
303821d
.TP
303821d
\fB-\-remove-kernel\fR=\fIkernel-path\fR
303821d
Removes all boot entries which match \fIkernel-path\fR. This may be used
303821d
along with -\-add-kernel, in which case the new kernel being added will
303821d
never be removed.
303821d
303821d
.TP
303821d
\fB-\-set-default\fR=\fIkernel-path\fR
303821d
The first entry which boots the specified kernel is made the default
303821d
boot entry.
303821d
303821d
.TP
303821d
\fB-\-set-default-index\fR=\fIentry-index\fR
303821d
Makes the given entry number the default boot entry.
303821d
303821d
.TP
303821d
\fB-\-title\fR=\fIentry-title\fR
303821d
When a new kernel entry is added \fIentry-title\fR is used as the title
303821d
for the entry.
303821d
303821d
.TP
303821d
\fB-\-update-kernel\fR=\fIkernel-path\fR
303821d
The entries for kernels matching \fRkernel-path\fR are updated. Currently
303821d
the only items that can be updated is the kernel argument list, which is
f24781c
modified via the \fB-\-args\fR and \fB-\-remove-args\fR options. If the
f24781c
\fBALL\fR argument is used the variable \fB GRUB_CMDLINE_LINUX\fR in
f24781c
\fB/etc/default/grub\fR is updated with the latest kernel argument list,
f24781c
unless the \fB-\-no-etc-grub-update\fR option is used.
303821d
303821d
.TP
303821d
\fB-\-zipl\fR
303821d
Configure \fBzipl\fR bootloader.
303821d
303821d
.TP
303821d
\fB-\-bls-directory\fR=\fIpath\fR
303821d
Use \fIpath\fR as the directory for the BootLoaderSpec config files rather
303821d
than the default \fB/boot/loader/entries\fR.
303821d
f24781c
.TP
f24781c
\fB-\-no-etc-grub-update\fR
f24781c
Makes grubby to not update the \fBGRUB_CMDLINE_LINUX\fR variable in
f24781c
\fB/etc/default/grub\fR when the \fB-\-update-kernel\fR option is
f24781c
used with the \fBALL\fR argument.
f24781c
303821d
.SH "SEE ALSO"
303821d
.BR zipl (8),
303821d
.BR mkinitrd (8),
303821d
.BR kernel-install (8)
303821d
303821d
.SH AUTHORS
303821d
.nf
303821d
Erik Troan
303821d
Jeremy Katz
303821d
Peter Jones
303821d
Javier Martinez
303821d
.fi