4 menuentry "OS_TITLE VER $1" "$@" --class android-x86 {
8 linux $kdir/kernel CMDLINE $src $@
9 initrd $kdir/initrd.img
16 function add_os_if_exists {
17 # Is there a better way to find ESP?
18 for d in hd0,gpt1 hd0,gpt2 hd1,gpt1 hd1,gpt2 hd0,msdos1 hd0,msdos2 hd1,msdos1 hd1,msdos2; do
19 if [ "($d)$1" != "$cmdpath/$bootefi" -a -e ($d)$1 ]; then
20 menuentry "$2 at $d ->" "$d" "$1" --class "$3" {
30 function savedefault {
31 if [ -s $prefix/grubenv -a "$chosen" != "$default" ]; then
38 loadfont DejaVuSansMono-18
40 terminal_output gfxterm
41 set theme=$prefix/theme/theme.txt
45 if [ -s $prefix/theme/theme.txt ]; then
49 if [ -s $prefix/grubenv ]; then
53 if [ "$grub_cpu" = "i386" ]; then
54 set bootefi=bootia32.efi
57 set bootefi=BOOTx64.EFI
61 if [ -z "$src" -a -n "$isofile" ]; then
62 set src=iso-scan/filename=$isofile
65 search --no-floppy --set android -f $kdir/kernel
66 export android bootefi grub kdir live src
69 add_entry "$live" quiet
70 add_entry "$debug_mode" DEBUG=2
71 if [ -s ($android)$kdir/install.img ]; then
72 add_entry "Installation" INSTALL=1
75 submenu "Advanced options -> " --class forward {
76 add_entry "$live - No Hardware Acceleration" quiet nomodeset HWACCEL=0
77 if [ -s ($android)$kdir/install.img ]; then
78 add_entry "Auto Install to specified harddisk" AUTO_INSTALL=0
79 add_entry "Auto Update" AUTO_INSTALL=update
81 add_os_if_exists /EFI/BOOT/$bootefi "UEFI OS" os
82 add_os_if_exists /EFI/BOOT/fallback.efi "UEFI Fallback" os
83 add_os_if_exists /EFI/BOOT/fallback_x64.efi "UEFI Fallback" os
84 menuentry "Reboot" --class reboot { reboot }
85 menuentry "Poweroff" --class shutdown { halt }
86 menuentry "UEFI firmware settings" --class setup { fwsetup }
89 # Add other OSes boot loaders if exist
90 add_os_if_exists /EFI/fedora/${grub}.efi Fedora fedora
91 add_os_if_exists /EFI/centos/${grub}.efi CentOS centos
92 add_os_if_exists /EFI/ubuntu/${grub}.efi Ubuntu ubuntu
93 add_os_if_exists /EFI/debian/${grub}.efi Debian debian
94 add_os_if_exists /EFI/linuxmint/${grub}.efi "Linux Mint" linuxmint
95 add_os_if_exists /EFI/Microsoft/Boot/bootmgfw.efi Windows windows
97 for d in $config_directory $cmdpath $prefix; do
98 if [ -f $d/custom.cfg ]; then