set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
#set gfxmode=auto
set gfxmode=1024x768
set gfxpayload=keep
set midx=x
set sidx=x
#declar functie increment,nu pot injecta modul increment in grub semnat si cu secure boot
#folosesc menuindex si submenuindex ca hotkey si ma opresc la d daca apas e imi face edit ci nu lanseaza meniul,oricum pe 1024x786 nu vad mai mult de 14 linii
function mincrement {
if [ x$midx == xx ]; then midx=1; elif [ x$midx == x1 ]; then midx=2; elif [ x$midx == x2 ]; then midx=3; elif [ x$midx == x3 ]; then midx=4; elif [ x$midx == x4 ]; then midx=5; elif [ x$midx == x5 ]; then midx=6; elif [ x$midx == x6 ]; then midx=7; elif [ x$midx == x7 ]; then midx=8; elif [ x$midx == x8 ]; then midx=9; elif [ x$midx == x9 ]; then midx=0; elif [ x$midx == x0 ]; then midx=a; elif [ x$midx == xa ]; then midx=b; elif [ x$midx == xb ]; then midx=c; elif [ x$midx == xc ]; then midx=d; else midx=x; fi
}
function sincrement {
if [ x$sidx == xx ]; then sidx=1; elif [ x$sidx == x1 ]; then sidx=2; elif [ x$sidx == x2 ]; then sidx=3; elif [ x$sidx == x3 ]; then sidx=4; elif [ x$sidx == x4 ]; then sidx=5; elif [ x$sidx == x5 ]; then sidx=6; elif [ x$sidx == x6 ]; then sidx=7; elif [ x$sidx == x7 ]; then sidx=8; elif [ x$sidx == x8 ]; then sidx=9; elif [ x$sidx == x9 ]; then sidx=0; elif [ x$sidx == x0 ]; then sidx=a; elif [ x$sidx == xa ]; then sidx=b; elif [ x$sidx == xb ]; then sidx=c; elif [ x$sidx == xc ]; then sidx=d; else sidx=x; fi
}
mincrement
menuentry $midx.' Esti in Secure Boot, UEFI Setup?' --hotkey=$midx {
fwsetup
}
if [ -d "($rootntfs)/mint" ]; then
mincrement
submenu $midx.' Linux Mint >' --hotkey=$midx {
sidx=x
if [ -d "($rootntfs)/mint/211" ]; then
sincrement
menuentry $sidx.' Linux Mint 21.1 Cinnamon 64-bit' --hotkey=$sidx {
root=$rootntfs
probe -u $root --set=devuuid
echo UUID=$devuuid
set gfxpayload=keep
echo load kernel
linux /mint/211/casper/vmlinuz file=/cdrom/mint/211/preseed/linuxmint.seed boot=casper uuid=$devuuid live-media=/dev/disk/by-uuid/$devuuid live-media-path=/mint/211/casper net.ifnames=0 ro nopersistent --
echo load initrd
initrd /mint/211/casper/initrd.lz
}
fi
}
fi
if [ -d "($rootntfs)/ubuntu" ]; then
mincrement
submenu $midx.' Ubuntu >' --hotkey=$midx {
sidx=x
if [ -d "($rootntfs)/ubuntu/2204" ]; then
sincrement
menuentry $sidx.' Ubuntu 22.04 LTS 64-bit' --hotkey=$sidx {
root=$rootntfs
probe -u $root --set=devuuid
echo UUID=$devuuid
set gfxpayload=keep
echo load kernel
linux /ubuntu/2204/casper/vmlinuz file=/cdrom/ubuntu/2204/preseed/ubuntu.seed boot=casper uuid=$devuuid live-media=/dev/disk/by-uuid/$devuuid live-media-path=/ubuntu/2204/casper net.ifnames=0 ro nopersistent --
echo load initrd
initrd /ubuntu/2204/casper/initrd
}
fi
}
fi
if [ -f "($rootntfs)/efi/memtest/BOOTX64.efi" ]; then
mincrement
menuentry $midx.' MemTest86 EFI' --hotkey=$midx {
echo load memtest
root=$rootntfs
chainloader /efi/memtest/BOOTX64.efi
}
fi
if [ -f "($rootntfs)/efi/boot/bootx64ms.efi" ]; then
mincrement
menuentry $midx.' Bootmgr for Windows tools from NTFS' --hotkey=$midx {
echo load bootmgr
root=$rootntfs
chainloader /efi/boot/bootx64ms.efi
}
fi
mincrement
menuentry $midx.' Boot from next volume' --hotkey=$midx {
exit 1
}