Wednesday, 9 April 2014

Easy2Boot and .imgPTN file development proceeds...

I have decided to not call the file extension '.imgEFI' for the partition images for UEFI booting. Instead they will be called .imgPTN which stands  for 'ParTitioN images'.

The new feature in E2B 1.32 (release version) is actually pretty powerful! It will swap in a new single-partition image to replace all of the E2B partitions instantly. You can then boot to whatever was in the new partition. Most UEFI systems will only boot if the first partition is a FAT32 partition (or is a GPT drive). Once you have finished, you can use the grub4dos boot menu in CSM mode to return the USB drive back to the 'E2B' partition state and carry on using E2B in the normal way.

The Windows script I am working on, MakePartImage.cmd, will convert ISOs, a folder or drive contents to a partition image file, which you then can just drop onto the E2B USB drive and it will appear in the menu just like any other menu item.

MakePartImage works best on non-grub4dos payloads that don't have a menu.lst file because it adds it's own menu.lst file into the image - if a menu.lst is present, you will be prompted to append it to  the MPI menu or delete it.

If  any .imgPTN file is over 4GB, then the E2B USB drive will need to be formatted as NTFS. UEFI booting is still possible as long as the image partition itself was formatted as FAT32.

As long as the biggest file inside the image is below 4GB and the image is a FAT32 partition image, then you can also UEFI-boot it (if image is UEFI-boot capable, of course!). If some files are over 4G, then only MBR (non-UEFI) booting is possible, as the .imgPTN image must be in the NTFS format (however, it is possible to have a FAT32+NTFS dual partition arrangement with later versions of E2B - see here for more details).

MakePartImage will also attempt to convert isolinux-based source files (ISOs) to syslinux-based ones. It will also rename any overlay file it finds in \LiveOS to match the new drive label and UUID too. It also warns you about any LABEL= and UUID= cheat codes in the syslinux config files - though you will have to change these manually if there are any. [Edit: Now it automatically converts these!]

Basically, if you have a single partition (FAT32 or NTFS) USB Flash drive (or HDD) that works correctly, then you should be able to easily convert it to an .imgPTN file and boot from it using Easy2Boot. You can thus convert all you flash drives into images and add them to Easy2Boot (if they don't work as ISOs in E2B).

You can use MakePartImage.cmd to automatically convert the following types of payloads to working .imgPTN files:
  1. Windows Install ISOs
  2. Multi-boot ISOs such as Hirens, DLCD, etc.
  3. WinPE v2+ based Windows ISOs
  4. Various Linux ISOs (Lubuntu, Ubuntu, Fedora, CentOS, Deft8, etc. just work)
  5. UEFI-capable utilities such as KonBoot or EasyRE
  6. Any working single-partition USB drive that is in FAT32 or NTFS format.

Linux ISO conversion
Some linux ISOs may not boot in MBR\BIOS\CSM mode, due to the change from an ISO(CD) to a disk filesystem(USB drive). In these cases, you can edit the image to fix the problem (just mount the .imgPTN file in ImDisk). However, they probably boot fine in MBR mode as an ISO under the E2B menu, so you don't really need to get them working from the CSM menu.
Some linux ISOs may not boot as .imgPTN images in UEFI mode. Typically you will need to change the grub .conf file to fix these UEFI images.

The most common fixes are:

1. Look in all .cfg, .conf and .lst files for CDLABEL and change CDLABEL to LABEL
2. Where a value for CDLABEL was defined, change it to the Volume label of the image: - e.g.
    Was: root=root=live:CDLABEL=SL-65-x86_64-LiveMiniCD
    Change to: root=live:LABEL=LIVE
3. Look for UUID= in the .cfg, .conf and .lst files. Change the value to that which is listed at the top of the CSM Menu when you boot from the .imgPTN. e.g.
   Was: root=live:UUID=%UUID%
   Change to: root=live:UUID=xxxx-yyyyy
where xxxx-yyyy is the UUID in the Easy2Boot CSM menu.
4. Lastly, if all else fails (for MBR booting only), add a grub4dos menu entry in the \menu.lst file which uses the correct kernel and initrd commands and parameters. e.g.

title Boot YlmF 3.0 (Windows Like OS) \n Image made from the ISO file Ylmf_OS_3.0.iso
kernel /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper floppy.allowed_drive_mask=0 splash
initrd /casper/initrd.img

[Edit: Now it automatically converts these! You shouldn't need to edit ant .cfg or .conf files.]

Progress
I have not had to do any sector editing to restore my E2B drives for several days now, so the partition swapping is looking fairly robust and reliable! I just have to go through a selection of different payload files (ISOs) to test them out and check they work.

If you have any favourite UEFI ISOs or other UEFI-enabled payloads, please contact me tell me what they are and I will test them for you. This way they should work for you when I finally release v1.32 of E2B!