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