Skip to content
Snippets Groups Projects
Commit 3356b440 authored by Thomas Bellman's avatar Thomas Bellman
Browse files

Handle kernel options for Grub 2 when using Xen.

When you are using the Xen virtualization hypervisor, you need to
set a different variable, GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT, in
/etc/default/grub to pass kernel options to the Dom0 Linux kernel,
instead of GRUB_CMDLINE_LINUX when not using Xen.  Detect when Xen
Dom0 is used in bootloader::grub2::kernel_option and do the right
thing.
parent 7b0efb73
No related branches found
No related tags found
No related merge requests found
......@@ -10,9 +10,13 @@ define bootloader::grub2::kernel_option($ensure, $value)
include bootloader::grub2::rebuild_grub_cfg
$grub_defaults_file = '/etc/default/grub'
$cfgparam = $::virtual ? {
'xen0' => 'GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT',
default => 'GRUB_CMDLINE_LINUX',
}
$qname = regexp_quote($name)
# Augeas path expression to find nodes for the kernel parameter
$pathexpr = "GRUB_CMDLINE_LINUX/value[. =~ regexp('${qname}(=.*)?')]"
$pathexpr = "${cfgparam}/value[. =~ regexp('${qname}(=.*)?')]"
if ($ensure == 'absent')
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment