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