-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
grub.cfg isn't being properly updated on EFI systems running CentOS 7 #4
Comments
I don't think copying this file in this resource type is a proper solution. How about managing a file resource for your need? file { '/boot/efi/EFI//grub.cfg':
ensure => file,
source => '/boot/grub2/grub.cfg',
} |
/boot/grub2/grub.cfg does not exist on my CentOS 7 system using EFI. So running puppet would give me an error on my kernel_parametering complaining no grub.cfg existed. So I fixed this by simplying adding "/boot/efi/EFI/centos/grub.cfg" to the list in the each command in grub2.rb |
OK. Feel free to provide a PR for that. |
I notice though that /etc/grub2-efi.cfg is a symlink to ../boot/efi/EFI/centos/grub.cfg so it would be a more general option to put in the list assuming you don't anticipate any way the code would not work with symlinks by, for example, doing 'rm' on the given file path before writing out a new file? |
I think symlinks should work imo. |
I note on non-EFI CentOS 7 systems, it is /etc/grub2.cfg that exists and is I have no idea why the grub2 packages for RHEL/CentOS felt it was necessary I see in the new-kernel-pkg script that it does a readlink on both possible On Thu, Dec 3, 2015 at 2:43 AM, Raphaël Pinson notifications@github.com
|
I'd like to bump this issue. I just installed on RHEL 7 and I have the same problem. Only difference is that the active grub.cfg is /boot/efi/EFI/redhat/grub.cfg. |
Hi, We have the same issue on RHEL-7. But we are assuming its using /boot/efi/EFI/redhat/grub.cfg but when the server reboots it couldn't find the kernel and disk to load. We have to give manually at grub loader. I assumed its looking the files in /boot/grub2/grub.cfg so created a symbolic link there and tried. But still same issue. |
That's surprising. 5e2d464 introduced the support for EFI config files. @trevor-vaughan what do you think? |
@raphink Well, the code certainly looks like it should be doing the right thing. @srisrija Can you let us know if running Also, have you modified your grub2 scripts by hand in any way? It's notoriously difficult to auto-test EFI settings. |
HI, We just run into items related to this So it's true that this module runs
if the file However if you are running booting with
then this file is not updated. I had a look through what a kernel upgrade does which calls So I believe this module should mkconfig for each file that exists and copy the logic |
Currently grub2-mkconfig is called on the first file that exists from. ``` "/etc/grub2-efi.cfg", "/boot/efi/EFI/#{os_name.downcase}/grub.cfg", "/boot/grub2/grub.cfg", "/boot/grub/grub.cfg" ``` So on a CentOS 7 system `grub2-efi.cfg` is generated only from `/etc/default/grub`. With an EFI system configured for bios boot the `/boot/grub2/grub.cfg` is the important one so `kernel_parameter` updates are not applied. Taking inspiration from [new-kernel-pkg](https://github.com/rhboot/grubby/blob/master/new-kernel-pkg) to see what happens on kernel upgrade `grubby` is called for each of these files that exists so emulating this logic make sense. Fixes voxpupuli#4
Currently grub2-mkconfig is called on the first file that exists from. ``` "/etc/grub2-efi.cfg", "/boot/efi/EFI/#{os_name.downcase}/grub.cfg", "/boot/grub2/grub.cfg", "/boot/grub/grub.cfg" ``` So on a CentOS 7 system `grub2-efi.cfg` is generated only from `/etc/default/grub`. With an EFI system configured for bios boot the `/boot/grub2/grub.cfg` is the important one so `kernel_parameter` updates are not applied. Taking inspiration from [new-kernel-pkg](https://github.com/rhboot/grubby/blob/master/new-kernel-pkg) to see what happens on kernel upgrade `grubby` is called for each of these files that exists so emulating this logic make sense. Fixes voxpupuli#4
* Call grub2-mkconfig on all targets Currently grub2-mkconfig is called on the first file that exists from. ``` "/etc/grub2-efi.cfg", "/boot/efi/EFI/#{os_name.downcase}/grub.cfg", "/boot/grub2/grub.cfg", "/boot/grub/grub.cfg" ``` So on a CentOS 7 system `grub2-efi.cfg` is generated only from `/etc/default/grub`. With an EFI system configured for bios boot the `/boot/grub2/grub.cfg` is the important one so `kernel_parameter` updates are not applied. Taking inspiration from [new-kernel-pkg](https://github.com/rhboot/grubby/blob/master/new-kernel-pkg) to see what happens on kernel upgrade `grubby` is called for each of these files that exists so emulating this logic make sense. Fixes #4 * fixup - push in a different way
grub.cfg isn't being properly updated on EFI systems running CentOS 7
It works as expected on servers with a traditional BIOS, but when run on an EFI system, grub active configuration doesn't get updated.
Looking into the issue a bit, line 111 of lib/puppet/provider/kernel_parameter/grub2.rb says:
The problem is the system does have a /boot/grub2/grub.cfg file, but the file actively being used is /boot/efi/EFI/centos/grub.cfg
I was going to submit a patch, but since centos is in the name, it would have been very distribution specific so taking a step back to create a more generic version probably makes sense.
Why would /boot/grub2/grub.cfg exist if /boot/efi/EFI/centos/grub.cfg is the active configuration?
Honestly, I don't know; making an educated guess is if I were to change to running in legacy bios mode then the /boot/grub2/grub.cfg file probably gets used.
EFI requires that there is a partition of a limited number of files systems (e.g. fat16/fat32/etc) that has an EFI folder in the root. To support this, /boot/efi is a different partition then /boot So when booting in legacy bios mode, my guess is it acts as if there was no efi and reads the configuration file off of the /boot partition. Since they are separate partitions, you can't hard link etc, so two copies are maintained.
Thus the "best" solution may be to add a line after 117 (mkconfig "-o", cfg), that looks for files /boot/efi/EFI//grub.cfg and if so copies cfg (in this case /boot/grub2/grub.cfg) over /boot/efi/EFI//grub.cfg
The text was updated successfully, but these errors were encountered: