Skip to content

Commit

Permalink
Add BLS support to grub_menuentry (#50)
Browse files Browse the repository at this point in the history
* Add BLS support to grub_menuentry

* Adds BLS support which should fix issues on EL8 and Fedora 30
* Fixed the issue with duplicating kernel options while debugging
* Updates both non-EFI and EFI paths

Closes #49
Closes #38
Closes #37

* Work around provider boolean issue

Also fixed a couple of minor issues with pre-populating provider data.
  • Loading branch information
trevor-vaughan committed Mar 23, 2020
1 parent 02ccac5 commit 15e7352
Show file tree
Hide file tree
Showing 7 changed files with 557 additions and 281 deletions.
18 changes: 5 additions & 13 deletions lib/puppet/provider/grub_menuentry/grub.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,16 @@ def self.instances
kernel = aug.get("#{pp}/kernel")
initrd = aug.get("#{pp}/initrd")
fs_root = aug.get("#{pp}/root")
default_entry = ((aug.get("$target/default") || '0').to_i + 1).to_s.to_sym
default_entry = ((aug.get("$target/default") || '0').to_i + 1)

modules = self.class.get_modules(aug, pp)

resource = {
:name => entry_name,
:ensure => :present,
:root => fs_root,
:default_entry => (pp.split('[').last[0].chr == default_entry).to_s.to_sym,
# Broken in the lens
#:lock => aug.exists("#{pp}/lock").to_s.to_sym,
:makeactive => aug.exists("#{pp}/makeactive").to_s.to_sym
:default_entry => (pp.split('[').last[0].chr == default_entry),
:makeactive => aug.exists("#{pp}/makeactive")
}

if kernel
Expand Down Expand Up @@ -249,7 +247,7 @@ def root=(newval)
end

def default_entry
return (menu_entry_index == @default_entry[:index]).to_s.to_sym
menu_entry_index == @default_entry[:index]
end

def default_entry=(newval)
Expand Down Expand Up @@ -367,12 +365,6 @@ def kernel_options=(newval)
process_option_line(new_kernel_options,'kernel')
end

def lock
augopen do |aug|
return aug.exists("#{menu_entry_path}/lock").to_s.to_sym
end
end

def modules
augopen do |aug|
self.class.get_modules(aug, menu_entry_path)
Expand Down Expand Up @@ -427,7 +419,7 @@ def lock=(newval)

def makeactive
augopen do |aug|
return aug.exists("#{menu_entry_path}/makeactive").to_s.to_sym
aug.exists("#{menu_entry_path}/makeactive")
end
end

Expand Down
Loading

0 comments on commit 15e7352

Please sign in to comment.