Monday, 27 August 2018

E2B grub2 menu system v0.09 Beta released

If you previously tried the E2B grub2 menu system but could not get it to work (e.g. no payload files were listed in the menus), then please try the new Beta9 versions.

You will need to replace the old UEFI_GRUB2_PTN2_Beta8.imgPTNLBAa23 file with the new UEFI_GRUB2_PTN2_Beta9.imgPTNLBAa23 file.



This menu system allows you to UEFI or MBR boot to a grub2 menu and then directly boot to a large selection of (mainly Linux) ISO files.

It may be more suitable for linux users because you do not need to defragment the ISO files.


Unlike the E2B menu system however, the grub2 menu entries are made for specific types of ISOs so you will need to be prepared to write new grub2 menu entries if you want to expand the range of 60 or so ISOs and payloads already supported.

The ISO files that you add must each have a unique name (see Excel spreadsheet) - e.g.  you can add one Ubuntu ISO which must be named ubuntu.iso (case sensitive).

You can add more ISOs by adding more menu files. e.g. if you wanted to add another ubuntu ISO, then you would make a new xxxxxx.grub2 menu file for it.

All .grub2 menu files are automatically added into the menu each time a new menu is loaded...

When loading the Main menu, all .grub2 files in the MAINMENU\grub2 and MAINMENU\MNU\grub2 folder are added to the menu.

If you tried the E2B grub2 menu system before but couldn't get any files to be listed in the menu, the issue should now be fixed.

Here is an example of how you can add your own xxxx.grub2 menu file:

#$isofpath            e.g. (hd0,msdos2)/_ISO/LINUX - use only in  if [ -e  tests
#$root2                e.g. (hd0,msdos2)  partition containing payload files
#$root                  e.g. hd0,msdos1    boot partition with grub2 on it
#$root2uuid         e.g. 1234-2123-33  (uuid of $root2)

#Special variables: MBR EFI MBR32 MBR64 EFI32 EFI64 BIT32 BIT64    FAT (true if filesystem on ptn2 is FAT)
#Examples:
#if $BIT32 ; then echo 32-bit ; fi
#if ! $BIT64 ; then echo not 64-bit ; fi
#if [ $BIT64 = true and $FAT = true ] ; then echo 64-bit MBR on FAT partititon ; fi
#if [ $BIT64 = true and $EFI = true ] ; then echo 64-bit EFI (same as \$EFI64) ; fi

#CHECK_MNU_FOLDER sets these variables on return
#$ip                 e.g. /_ISO/LINUX
#$ifp                e.g. (hd0,msdos2)/_ISO/LINUX
#$isofile            e.g. /_ISO/LINUX/xxxx.iso 

if $MBR; then
if [ -e "$isofpath/avg.iso" ]; then
menuentry "AVG Rescue CD" --unrestricted --class avg{
  set isoname=avg.iso ; CHECK_MNU_FOLDER
if $MBR; then set gfxpayload=text ; fi
if $EFI; then set gfxpayload=keep ; fi
set root=$root2
  loopback loop $isofile
# use safe mode boot
  linux (loop)/isolinux/vmlinuz root=/dev/ram0 real_root=/dev/loop0 max_loop=255 init=linuxrc initrd=initrd.lzm video=vesafb:off reboot=bios
  initrd (loop)/isolinux/initrd.lzm
boot
}
fi
fi

The red text indicates the parts that will change depending on what ISO you are using.

The grub2 variables (e.g. $BIT64) have already been pre-defined for you and you can use them with if statements to prevent the menu from being displayed under certain circumstances (for instance if the CPU is a 32-bit CPU you don't want to list 64-bit ISOs, or if the ISO does not support UEFI then you don't want to list the ISO in the menu if you have UEFI-booted to the grub2 menu).

Full details are here.

Please let me know if you have any problems.

P.S. Knoppix 8.2 ISO no longer seems to work with the original grub2 menu. I found out it does not boot if the kernel parameter acpi=off is present. I have revised linux_menu.grub2 in Beta9 today to fix the issue. You can now MBR64/32 & UEFI64/32 boot to the Knoppix 8.2 live cd ISO. If you downloaded the 2018-08-26 version, please download todays Beta9 again to get the updated files.