Skip to content
Snippets Groups Projects
Commit 256b7cad authored by Thomas Bellman's avatar Thomas Bellman
Browse files

Handle UEFI systems when rebuilding Grub 2 config file.

On UEFI systems, grub.cfg is in /boot/efi/EFI/<os>/grub.cfg instead
of in /boot/grub2/grub.cfg.  Luckily, instead of having to know what
"<os>" needs to be instantiated with (e.g. "centos"), it seems that
we can just point grub2-mkconfig to the symlink /etc/grub2-efi.cfg.
(This at least works on RedHat:ish systems.)
parent c25ee385
No related branches found
No related tags found
No related merge requests found
# Copyright © 2017 Thomas Bellman, Linköping, Sweden
# Copyright © 2017-2018 Thomas Bellman, Linköping, Sweden
# Licensed under the GNU LGPL v3+; see the README file for more information.
......@@ -9,8 +9,9 @@ class bootloader::grub2::rebuild_grub_cfg
{
exec {
'bootloader::grub2::rebuild_grub_cfg':
command => 'grub2-mkconfig -o /boot/grub2/grub.cfg',
command => 'if [ -f /etc/grub2-efi.cfg ]; then grub2-mkconfig -o /etc/grub2-efi.cfg; else grub2-mkconfig -o /boot/grub2/grub.cfg; fi',
path => ['/bin', '/usr/bin', '/sbin', '/usr/sbin'],
provider => 'shell',
refreshonly => true;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment