voxpupuli / puppet-augeasproviders_grub

Augeas-based grub type and providers
Apache License 2.0
9 stars 33 forks source link

Absent GRUB_CMDLINE_LINUX_DEFAULT can result in duplicated kernel parameters. #38

Closed sandynomad closed 4 years ago

sandynomad commented 6 years ago

When using grub2 the initial state in /etc/default/grub includes:

GRUB_CMDLINE_LINUX populated GRUB_CMDLINE_LINUX_DEFAULT absent

Used:

kernel_parameter { "pci=nomsi,noaer":
    ensure   => present,
    bootmode => "normal",
}

results in GRUB_CMDLINE_LINUX_DEFAULT being copied from GRUB_CMDLINE_LINUX and then massaged by the lens.

The resultant kernel boot line includes duplicate entries. According to the grub2 manual (https://www.gnu.org/software/grub/manual/grub/grub.html):

‘GRUB_CMDLINE_LINUX_DEFAULT’

    Unless ‘GRUB_DISABLE_RECOVERY’ is set to ‘true’, two menu entries will be
    generated for each Linux kernel: one default entry and one entry for recovery
    mode. This option lists command-line arguments to add only to the default
    menu entry, after those listed in ‘GRUB_CMDLINE_LINUX’.

Desired behaviour is for GRUB_CMDLINE_LINUX_DEFAULT to not being populated from GRUB_CMDLINE_LINUX as they maybe concatenated when generating the grub.conf

raphink commented 6 years ago

@trevor-vaughan I see you code that part in https://github.com/hercules-team/augeasproviders_grub/blob/master/lib/puppet/provider/kernel_parameter/grub2.rb#L88-L108, what's your take on it?

trevor-vaughan commented 6 years ago

Interesting. This may be a RHEL quirk that I ended up testing around. @sandynomad What OS are you working against?

sandynomad commented 6 years ago

The behaviour reported was on CentOS 7.5.

raphink commented 6 years ago

@trevor-vaughan were you able to reproduce?