Steve's blog about RMPrepUSB, Easy2Boot and USB booting. Please tick one of the 'Reactions' boxes if you enjoyed a post.
Visit www.rmprepusb.com for over 130 Tutorials on USB booting or www.easy2boot.com for a unique USB multiboot solution.

Wednesday, 9 October 2013

How to add OpenELEC XBMC Installer to Easy2Boot

The OpenElec x86_64 installer is based just on two files from the \target folder, KERNEL and SYSTEM. The KERNEL can be loaded by grub4dos but then it will look for the SYSTEM file on the boot volume. This works fine if we just copy these two files from the OpenElec x86_64 download to the root of our FAT32 Easy2Boot drive and then use a simple .mnu file:

Method 2 - the harder way!

After some trial and error, here is the way I found around this.

1. On a spare USB Flash drive, format it with RMPrepUSB as FAT32 and make the partition size just large enough for the two files + about 10MB. e.g. if the files add up to 92MB make a 110MB FAT32 partition. We need to keep this as small as possible as we are going to create an image from it.

2. Install grub4dos to the MBR

3. Add the two OpenElec boot files, SYSTEM and KERNEL.

4. In RMPrepUSB, press F4 to create a menu.lst file and add these 5 lines

We should have these files on the FAT32 grub4dos Flash drive:
\grldr
\SYSTEM
\KERNEL
\menu.lst

5. Test that it boots to the OpenElec installer by pressing F11 in RMPrepUSB

6. In RMPrepUSB, click on the Drive->File button, choose a destination to save the file (OpenElec.img) and enter P1 for the Start Position on the drive, then P1 for the End Position and then 0 for the File Start position. This will create an image of the entire partition.

7. Copy the OpenElec.img file to \_ISO\MAINMENU\Linux folder of your E2B drive (or any \_ISO\xxx\Linux folder if you want it in a different menu).

8. Create in the same folder an OpenElec.mnu file containing these contents (cut and paste the 5 lines):

title OpenElec Installer \n This installs OpenElec to a drive# Write a new entry into the E2B partition table pointing to the OpenElec partitionpartnew (hd0,3) 0x0 %MFOLDER%/Linux/OpenElec.imgroot (hd0,3)chainloader (hd0,3)/grldr

Now Run WinContig (RMPrepUSB - Ctrl+F2) and we should now be good to go!

We should now have present on the E2B drive:
\_ISO\MAINMENU\Linux\OpenElec.img
\_ISO\MAINMENU\Linux\OpenElec.mnu

Select the OpenElec Installer entry in the Easy2Boot Main Menu and it should boot.

The trick here is that partnew is used to create a type 0C partition entry in the E2B USB drive partition table so that we do have a real partition on our E2B drive when OpenElec boots, however once it boots to the image and we have loaded the kernel in grub4dos, we can set the partition type to 0 because linux does not look at the partition type number. This means that when E2B reboots, it will not complain about the partition table Entry #4 being in use and refuse to load the main menu. If E2B sees a Type 0 in ptn #4 it will clear the entries for us.

Neat eh!

The installer seems to install OK on a VM hard disk, but the VM seems to fail to fully boot to OpenElec (probably wrong hardware?) and I haven't tried it on a real system as it will trash the system's hard disk.