Sunday, 8 May 2016

Grub2 support in E2B - progress report...

I have been spending quite a while thinking about the grub2 menu structure and it seems some people put E2B on the 2nd partition of their USB drive instead of the first partition. I don't advise this because of the 137GB BIOS bug, but as long as the 2nd partition ends before 137GB, it should work OK.

For payload files to be detected by the grub2 menu system, they must have specific lower-case names (e.g. avg.iso, konbootx64.efi). Files with names such as avg_arl_cdi_all_120_150814a10442.iso or "AVG AntiVirus.iso" will NOT be detected by the default grub2 menu system.

So there will be a large list of specific payload file names which I will document at a later date. As a consequence, you can only have one version of any ISO (though you can add your own uniquely-named payloadfiles and add your own grub2 menu for it).


The new grub2 folder system

People who keep E2B on the 2nd partition don't want to have two copies of the same ISO in two different folders on the 2nd E2B partition if they want to use the grub2 feature. So I have decided to re-arranged the grub2 menu folders. It makes it a lot more complicated to implement for me though!

Your payload files (ISOs, .img floppy image files, .EFI files, etc.) can now be placed in one of five different menu folders (or five menu sub-folders) on the 2nd partition of the E2B USB drive:

Partition 2 folders:
\_ISO\MAINMENU
\_ISO\MAINMENU\MNU
\_ISO\ANTIVIRUS
\_ISO\ANTIVIRUS\MNU
\_ISO\BACKUP
\_ISO\BACKUP\MNU
\_ISO\LINUX
\_ISO\LINUX\MNU
\_ISO\UTILITIES
\_ISO\UTILITIES\MNU

Note that the MNU sub-folder will also be scanned for payload files (but not any other sub-folder).

Each payload file must be a specific name and case (e.g. avg.iso for the AVG AntiVirus Live CD ISO, konboot.img, memtest.efi, etc.). If not an exact match (such as avg1.iso), then it won't be added to the grub2 menu system (but will be added to the E2B menu system if you have the PTN2 .mnu file addd to your E2B folder).

You can place any and all of the specifically named payload files in the entire list (TBA) in the \_ISO\MAINMENU folder (or \_ISO\MAINMENU\MNU folder) and they will all appear in the grub2 Main Menu.

The grub2 sub-menus (e.g. \_ISO\LINUX) will only detect a sub-set of the specifically named payload files (in this case only files listed as grub2 linux payload filenames). For instance, you could put avg.iso in either the \_ISO\MAINMENU folder or \_ISO\MAINMENU\MNU folder or \_ISO\ANTIVIRUS folder or \_ISO\ANTIVIRUS\MNU folder and it will be listed in the grub2 Main or AntiVirus menus accordingly.

However, if you put the same avg.iso file in the \_ISO\BACKUP folder, it would not be listed in the grub2 Backup menu.

Adding the payload files to the E2B menu system

E2B already contains a sample .mnu file for the \_ISO\ANTIVIRUS folder on partition 2 at "\_ISO\docs\Sample mnu files\E2B Menus\PTN2_MNU.mnu".

If you copy this file to your \_ISO\MAINMENU folder or \_ISO\ANTIVIRUS folder (on the E2B partition), then you can run any of the payloadfiles on the 2nd partition from E2B (in MBR mode though, not UEFI mode).

In the next Beta of E2B, I will provide all five 5 PTN2_xxxx.mnu files for partition 2.

E2B Main Menu with PTN2_xxx.mnu files added.

PTN2 linux menu in E2B showing the lowercase ISO files
that I have added for grub2 UEFI booting.

If you add .EFI files to the 2nd partition \_ISO\xxx folders (e.g. konboot.efi, which the E2B menu obviously cannot boot to) they will still be listed in the E2B menu, so place .EFI files in the \_ISO\xxxxx\MNU folder so that they are not listed by E2B.

Adding your own grub2 menu entries

Any additional user's menu files for grub2 will use a .grub2 file extension and be kept in a grub2 sub-folder. For instance, if you wanted to add  'myavg.iso' to the \_ISO\ANTIVIRUS folder, you could add your own grub2 menu file \_ISO\ANTIVIRUS\grub2\myavg.grub2 which contains the grub2 code to boot it (either in UEFI mode or MBR mode or both).

Changing the grub2 menu default settings

Default settings for default menu entry and timeout can be placed in a defaults.txt file (e.g. \_ISO\ANTIVIRUS\grub2\defaults.txt. e.g.

#default menu entry to highlight (0-n)
set default=1
# timeout for highlighted menu entry in seconds, -1=off, 0=immediate
set timeout=0
# set delay in seconds for showing user what .cfg files are loaded for each menu (0-n)
#set showdelay=0
#change grub2 console password for user easy2boot to "fred" (default=easy2boot)
#password easy2boot fred

Example grub2 Main menu. Android and AVG are in \_ISO\MAINMENU.


This is the Utilities Menu in grub2  (MBR mode). 

konboot.img and pmagic.iso are both present in the \_ISO\UTILITES folder.

Adding Kaspersky AntiVirus in grub2

I have been working on the Kaspersky AV Rescue Disk ISO to get this work with persistent updates from the grub2 system. It is possible now, but you have to make a 400MB GRUB2_UEFI.imgPTNLBAa23 file instead of the 30MB file (the updates currently need 240MB of space). This is because the update folder needs to be in the first partition on the disk (AFAIK). All attempts to get it to use the 2nd partition have failed!

Also, the ISO must be extracted to the root of the 2nd partition (I cannot get it to work as an ISO from the 2nd partition).

I will give full details in the future.

Please feed back any comments or ideas ASAP.