voxpupuli / puppet-augeasproviders_grub

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

Fixed the EFI code for grub_config and grub_menuentry #48

Closed tparkercbn closed 4 years ago

tparkercbn commented 4 years ago

The grub.cfg path was not being found for grub_config and grub_menuentry providers with EFI and grub2. This pull request fixes that.

tparkercbn commented 4 years ago

From reading the code it looks like it loops over the files and updates only the ones that exist.

If there is no /boot/efi/EFI directory then nothing will be done.

This is the same code that was already in the kernel_parameter/grub2.rb file that is being used for other variables in different sections of grub, I just ported it over.

I am using this branch on all of my servers (~1000) most of which are still HP G8s with Legacy BIOS and am not seeing any issues. I added this code to support the new G10 systems that are EFI only.

Let me know if there is anything else you would like me to add.

I have also attached a very simple fact that I have on my systems for determining what mode we are using that seems consistent at least on Debian8 and 10 and CentOS7 and 8

Tom

====================== boot_mode.rb ======================

require 'facter'

Facter.add('boot_mode') do setcode do if File.exists?('/sys/firmware/efi') boot_mode = 'UEFI' else boot_mode = 'BIOS' end

    boot_mode
end

end

=========================================================

From: Trevor Vaughan notifications@github.com Sent: Wednesday, March 11, 2020 10:13 AM To: hercules-team/augeasproviders_grub augeasproviders_grub@noreply.github.com Cc: Tom Parker tparker@cbnco.com; Mention mention@noreply.github.com Subject: Re: [hercules-team/augeasproviders_grub] Fixed the EFI code for grub_config and grub_menuentry (#48)

@trevor-vaughan requested changes on this pull request.

We're going to have to park this one for the moment.

@tparkercbnhttps://github.com/tparkercbn Do you have a good way of detecting whether or not EFI mode is being used? The reason that we didn't do this initially is that we couldn't figure out how to do this and you could end up updating a file that has no effect.

Should we update both files?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/hercules-team/augeasproviders_grub/pull/48#pullrequestreview-372794732, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJYF5QAIZS3PWTCGUNHWI3RG6L7PANCNFSM4KPNAGEA.

trevor-vaughan commented 4 years ago

@tparkercbn Good call. I'll approve this and push it based on your use in production. Thanks!