Changing the default Linux 7 kernel to boot from

Changing the default Linux 7 kernel to boot from

Changing the default Linux 7 kernel to boot from
Step 1 - Determine which entries are available from the boot menu

Example:
# grep '^menuentry' /boot/efi/EFI/redhat/grub.cfg
menuentry 'Oracle Linux Server (5.4.17-2011.6.2.el7uek.x86_64 with Unbreakable Enterprise Kernel) 7.9' --class oracle --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-5.4.17-2011.6.2.el7uek.x86_64-advanced-f8d49bf4-fa48-4ef5-be1a-e20e163f7558' {
menuentry 'Oracle Linux Server (3.10.0-1160.el7.x86_64 with Linux) 7.9' --class oracle --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-1160.el7.x86_64-advanced-f8d49bf4-fa48-4ef5-be1a-e20e163f7558' {
menuentry 'Oracle Linux Server (0-rescue-8e63694bc70c4af5ba2a920076fe811c with Linux) 7.9' --class oracle --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-8e63694bc70c4af5ba2a920076fe811c-advanced-f8d49bf4-fa48-4ef5-be1a-e20e163f7558' {

From the output above, we can see we have 3 entries available which translates to entries 0, 1 and 2

We want to boot the Redhat kernel and NOT the Oracle UEK kernel.

Step 2 - Change to entry 1

Example:
# grub2-set-default 1

Step 3 - Recreate the the grub2 menu

Example:
# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.17-2011.6.2.el7uek.x86_64
Found initrd image: /boot/initramfs-5.4.17-2011.6.2.el7uek.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-1160.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-1160.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-8e63694bc70c4af5ba2a920076fe811c
Found initrd image: /boot/initramfs-0-rescue-8e63694bc70c4af5ba2a920076fe811c.img
done

Step 4: Test by rebooting