# If you have a USB HDD (or VM) you must use this .mnu as the plain .iso does not work for Tails on a USB HDD
# (optional) add a \tails-rw ext2 file to your USB drive using RMPrepUSB Create ext2 FS button for persistence - Volume Name = tails-rw
# Note: Tails does not support normal persistence and the USB boot partition will be inaccessible in Tails for security purposes
# You can use tails-rw for file storage (on login - choose Yes and set password, this allows you to access the tails-rw volume after login)
# WARNING: 3rd and 4th partition table entries will be wiped!
# IMPORTANT: you MUST run WinContig (Ctrl+F2) before booting E2B.

iftitle [if exist $HOME$/tails-i386-0.23.iso] Tails (with optional storage)\n Use if Easy2Boot is on a USB HDD drive\n or if a storage volume (tails-rw) is required.\n To access it, on Login choose Yes - Forward and set a password\n so you can access the tails-rw volume from the Desktop.

set ISO=$HOME$/tails-i386-0.23.iso
set PERS=/tails-rw

if exist CD echo WARNING: Cannot use partnew command! && pause && configfile (bd)/menu.lst
#enable parttype output
debug 1
if "%E2BDEV%"=="" set E2BDEV=hd0 && pause E2BDEV forced to hd0!

# make empty table entry in 3rd position in ptn table if empty
parttype (%E2BDEV%,2) | set check=
debug off
set check=%check:~-5,4%
if "%check%"=="0x00" partnew (%E2BDEV%,2) 0 0 0
if not "%check%"=="0x00" echo WARNING: PTN TABLE 3 IS ALREADY IN USE - PERSISTENT STORAGE WILL NOT BE AVAILABLE! && pause
debug 1
if not exist %PERS% echo WARNING: %PERS% storage file not found! && pause
errorcheck off
if "%check%"=="0x00" partnew (%E2BDEV%,2) 0x0 (bd)%PERS%
errorcheck on

partnew (%E2BDEV%,3) 0x0 %ISO%
set Q=quiet splash
#for debug comment out next line with a #
#set Q=nosplash
map %ISO% (0xff) || map --mem %ISO% (0xff) || map --mem --heads=0 --sectors-per-track=0 %ISO% (0xff)
map --hook
root (0xff)
kernel /live/vmlinuz findiso=%ISO% boot=live config noprompt timezone=Etc/UTC block.events_dfl_poll_msecs=1000 nox11autologin module=Tails %Q%
initrd /live/initrd.img

