1
0
Fork 0
Commit graph

5 commits

Author SHA1 Message Date
Yoann Congal
e9f0f228b3 bootloader: export Grub variables to make them available in submenus
Without exporting the grub variables, they are only available in the
main grub menu[0]. When descending in a submenu (like in default Debian for
example), tuned_* variable are expanded to the empty string and, so,
tuned kernel cmdline tuning is effectively disabled.

With the export, variables are available in submenus and tuned tuning is
applied as expected.

[0]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1094201#10

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
2025-01-27 11:59:21 +01:00
Jaroslav Škarvada
047a7335b0 bootloader: add support for initrd overlays
The bootloader plugin now supports the following options:
  initrd_add_img=IMAGE
  initrd_add_dir=DIR
  initrd_dst_img=PATHNAME

The 'initrd_add_img' adds initrd overlay named IMAGE. The IMAGE is
added from the current profile directory. If IMAGE begins with '/' it's
taken as absolute path (e.g. initrd_add_img="/root/overlay.img").

The 'initrd_add_dir' creates initrd image from the DIR at first and then
adds the image as a overlay. The DIR is taken from the current profile
directory. If DIR begins with '/' it's taken as absolute path.

The 'initrd_dst_img' sets the name and location of the resulting initrd
image. Usually it is not needed to set it. By default the location of
initrd images is /boot and the name of the image is taken as a basename
of IMAGE or DIR. This can be overridden by 'initrd_dst_img'

Currently grub2-mkconfig doesn't support initrd overlays, so the initrd
settings are lost after 'grub2-mkconfig -o /boot/grub2/grub.cfg' is
issued. There is grub2 RFE bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1427899

Resolves: rhbz#1414098

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-03-01 15:56:17 +01:00
Jaroslav Škarvada
8fc93e7453 plugin_bootloader: fix for multiple parameters on command line
Related: rhbz#1148711

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2014-10-06 10:56:42 +02:00
Jaroslav Škarvada
05a17e4abe plugin_bootloader: 00_tuned do not return error if there is noc cmdline
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2014-10-03 21:02:51 +02:00
Jaroslav Škarvada
5b8a2d2e8e plugins: added bootloader plugin
This plugin can be used to add parameters to kernel (boot/dracut)
command line. Currently only grub2 bootloader is used and reboot
is required to apply the tunings. The tuning can be only unloaded
by profile change followed by reboot.

It patches grub.cfg at runtime and installs /etc/grub.d/00_tuned
grub2 template. So it's possible to regenerate grub.cfg by
grub2-mkconfig and the tuning persists.

It also patches /etc/default/grub and adds tuned_params grub2 variable
to GRUB_CMDLINE_LINUX. This is probably the only way how to get
variables into kernel command line in grub.cfg. Nothing else is added to
/etc/default and it's patched if the plugin is used for the first
time. It's re-patched on plugin initialization only if the tuned_params
variable is missing.

On subsequent invocation only the tuned_params grub2 variable and
grub.cfg are changed.

Example of use:

[bootloader]
cmdline=quiet

This adds "quiet" parameter to the kernel boot command line (reboot
is required).

EFI is also supported. By default it autodetects redhat and fedora
directories (in this order). Nothing else is touched. If you have
different EFI system and your grub.cfg location is not auto-detected
or your grub.cfg is located on different place you can specify
the grub.cfg location manually:

[bootloader]
grub2_cfg_file=CUSTOM_PATH/grub.cfg
cmdline=quiet

This has precedence over auto-detection. This is used for runtime
patching. In case it is not set correctly, the grub.cfg patching
will not work, but you can still regenerate the config by hand by
grub2-mkconfig.

Resolves: rhbz#1044111

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2014-09-29 16:33:56 +02:00