# --- FAT32 E2B USB DRIVES ONLY ---
# Just copy \system and \kernel files to root of E2B USB drive
# Make ext2 FS file in root of E2B drive - FileName=OpenElec-rw  VolumeName=DATA
# Copy this .mnu file to \_ISO\MAINMENU\MNU folder

iftitle [if exist /system if exist /kernel] OpenElec Live\n Boot OpenElec with persistence

set PER=/OpenElec-rw

if "%E2BDEV%"=="" set E2BDEV=hd0 && pause E2BDEV forced to hd0!
if exist CD echo WARNING: Cannot use partnew command! && pause && configfile (bd)/menu.lst
debug 1
parttype (%E2BDEV%,2) | set check=
debug off
set check=%check:~-5,4%
# make empty table entry in 3rd position in ptn table
if "%check%"=="0x00" partnew (%E2BDEV%,2) 0 0 0
if not "%check%"=="0x00" echo WARNING: PTN TABLE 3 IS ALREADY IN USE! && pause
debug 1
if not exist %PER% echo WARNING: %PER% persistence file not found! && pause
errorcheck off
if "%check%"=="0x00" partnew (%E2BDEV%,2) 0x0 %PER%
errorcheck on

uuid () > nul
set UUID=%?%
echo %UUID%
kernel /kernel boot=UUID=%UUID% disk=LABEL=DATA quiet
