You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Grab major version number so we can properly adjust grub config.
133
+
# Should work on both RHEL and CentOS reliably
134
+
majorVersion=$(rpm -E %{rhel})
135
+
136
+
# Fix grub.cfg to remove EFI entries, otherwise "boot=" is not set correctly and blscfg fails
137
+
[ "$majorVersion" = "7" ] && {
138
+
EFI_ID=`blkid -s UUID -o value /dev/sda15`
139
+
EFI_ID=`blkid -s UUID -o value /dev/sda1`
140
+
sed -i 's|$prefix/grubenv|(hd0,gpt15)/efi/centos/grubenv|' /boot/grub2/grub.cfg
141
+
sed -i 's|load_env|load_env -f (hd0,gpt15)/efi/centos/grubenv|' /boot/grub2/grub.cfg
142
+
143
+
# Required for CentOS 7.x due to no blscfg: https://bugzilla.redhat.com/show_bug.cgi?id=1570991#c6
144
+
#cat /etc/grub2-efi.cfg | sed -e 's|linuxefi|linux|' -e 's|initrdefi|initrd|' > /boot/grub2/grub.cfg
145
+
sed -i -e 's|linuxefi|linux|' -e 's|initrdefi|initrd|' /boot/grub2/grub.cfg
146
+
}
147
+
[ "$majorVersion" = "8" ] && {
148
+
EFI_ID=`blkid --match-tag UUID --output value /dev/sda15`
149
+
BOOT_ID=`blkid --match-tag UUID --output value /dev/sda1`
150
+
sed -i 's|${config_directory}/grubenv|(hd0,gpt15)/efi/centos/grubenv|' /boot/grub2/grub.cfg
151
+
}
152
+
sed -i 's/gpt15/gpt1/' /boot/grub2/grub.cfg
153
+
sed -i "s/${EFI_ID}/${BOOT_ID}/" /boot/grub2/grub.cfg
154
+
sed -i '/^### BEGIN \/etc\/grub.d\/30_uefi/,/^### END \/etc\/grub.d\/30_uefi/{/^### BEGIN \/etc\/grub.d\/30_uefi/!{/^### END \/etc\/grub.d\/30_uefi/!d}}' /boot/grub2/grub.cfg
0 commit comments