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