Skip to content

Instantly share code, notes, and snippets.

@bitsurgeon
Created October 1, 2019 05:53
Show Gist options
  • Save bitsurgeon/645e9892a4f29e36ecf2960992471a03 to your computer and use it in GitHub Desktop.
Save bitsurgeon/645e9892a4f29e36ecf2960992471a03 to your computer and use it in GitHub Desktop.
Grub chainloading | Ubuntu -> RHEL
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
#
# replace <ESP_UUID> with the UUID of your ESP partition
# run 'sudo update-grub -o /boot/efi/EFI/ubuntu/grub.cfg'
menuentry "Chainload RHEL" {
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 <ESP_UUID>
else
search --no-floppy --fs-uuid --set=root <ESP_UUID>
fi
chainloader /EFI/redhat/grubx64.efi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment