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.
122
+
# Should work on both RHEL and CentOS reliably
123
+
majorVersion=$(rpm -E %{rhel})
124
+
125
+
# Fix grub.cfg to remove EFI entries, otherwise "boot=" is not set correctly and blscfg fails
126
+
[ "$majorVersion" = "7" ] && {
127
+
EFI_ID=`blkid -s UUID -o value /dev/sda15`
128
+
EFI_ID=`blkid -s UUID -o value /dev/sda1`
129
+
sed -i 's|$prefix/grubenv|(hd0,gpt15)/efi/centos/grubenv|' /boot/grub2/grub.cfg
130
+
sed -i 's|load_env|load_env -f (hd0,gpt15)/efi/centos/grubenv|' /boot/grub2/grub.cfg
131
+
132
+
# Required for CentOS 7.x due to no blscfg: https://bugzilla.redhat.com/show_bug.cgi?id=1570991#c6
133
+
#cat /etc/grub2-efi.cfg | sed -e 's|linuxefi|linux|' -e 's|initrdefi|initrd|' > /boot/grub2/grub.cfg
134
+
sed -i -e 's|linuxefi|linux|' -e 's|initrdefi|initrd|' /boot/grub2/grub.cfg
135
+
}
136
+
[ "$majorVersion" = "8" ] && {
137
+
EFI_ID=`blkid --match-tag UUID --output value /dev/sda15`
138
+
BOOT_ID=`blkid --match-tag UUID --output value /dev/sda1`
139
+
sed -i 's|${config_directory}/grubenv|(hd0,gpt15)/efi/centos/grubenv|' /boot/grub2/grub.cfg
140
+
}
141
+
sed -i 's/gpt15/gpt1/' /boot/grub2/grub.cfg
142
+
sed -i "s/${EFI_ID}/${BOOT_ID}/" /boot/grub2/grub.cfg
143
+
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