Skip to content

Commit

Permalink
Merge pull request #98 from silug/issue_95
Browse files Browse the repository at this point in the history
Update BLS kernel options on EL >= 9.3
  • Loading branch information
silug authored Jul 9, 2024
2 parents a12d428 + ebbe9c6 commit c90e638
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion lib/puppet/provider/kernel_parameter/grub2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,28 @@ def self.mkconfig_path

confine exists: mkconfig_path, for_binary: true

# Add BLS specific option to mkconfig command if needed
#
# @return (String) The commandline
def self.mkconfig_cmdline
needs_bls_cmdline = lambda do
os = Facter.value(:os)
return false unless os.is_a?(Hash)

return false unless os['family'] == 'RedHat'
return false if os['release']['major'].to_i < 9
return false if os['release']['major'].to_i == 9 && os['release']['minor'].to_i < 3

true
end

cmdline = [mkconfig_path]
cmdline << '--update-bls-cmdline' if needs_bls_cmdline.call
cmdline
end

def mkconfig
execute(self.class.mkconfig_path, { failonfail: true, combine: false })
execute(self.class.mkconfig_cmdline, { failonfail: true, combine: false })
end

# when both grub* providers match, prefer GRUB 2
Expand Down

0 comments on commit c90e638

Please sign in to comment.