Wednesday, 7 January 2015

E2B 1.62 Beta7 with Parted Magic LIVE support

The Parted Magic Parted_Magic_2014_09_21.iso (490MB) can be booted just by adding it to your E2B USB drive. Note: This Parted Magic release is not free but it is only $10.

However the file must be contiguous or else it will copied using dd to the CONTIG.ISO each time you boot it (if it exists).

I have now modified isoboot.g4b so that it will boot directly from a non-contiguous Parted Magic iso file and it also will support LIVE boot so that you can save the settings on exit.

To run it using isoboot, select the ISO file in the E2B (v1.62+) menu and hold down the SHIFT key before pressing ENTER (or use a .mnu file).

Note: If you make an .imgPTN file from the PMagic iso using the MPI Tool Pack and MakePartImage, it can boot in MBR or UEFI mode and you can select LIVE or non-LIVE mode and choose from a range of supported languages. No modifications or menu editing is required but you will need to allow for at least 200MB of extra free space for storage of the session settings..

P.S. For non-E2B users (why not?!!!) - there is an article on RMPrepUSB.com here.



Method

1. Copy the Parted_Magic_isoboot_Persistent.mnu file from the \_ISO\docs\Sample mnu Files folder to the desired E2B menu folder (e.g. \_ISO\MAINMENU\MNU)

2. Copy the Parted_Magic_2014_09_21.iso to the same folder.

When you boot from the new menu item, you will be asked if you want to boot as a LIVE version.
If you answer 'Y' then the last saved Session settings will be used (e.g. Desktop settings, etc.).


When you Quit from Parted Magic, you can then 'Save the Session'.

Note that this relies on there being a xxx.SQFS file (of any size or content) in the \pmagic\pmodules folder on the E2B USB drive - that is how PMagic determines where to save the session file.

3. At the PMagic Desktop use the File Manager to find the mounted iso file and find the /pmagic/pmodules folder and make a note of the  SQFS filename - e.g. PMAGIC_2014_09_29.SQFS.

4. Now navigate to the E2B USB drive and create a new folder at /pmagic/pmodules on the E2B USB drive.

5. Now create a new empty SQFS file in the /pmagic/pmodules folder - e.g. PMAGIC_2014_09_29.SQFS -  (or just copy the whole .SQFS file if you have plenty of space to spare!)

You should now find that when you quit from pmagic, you can save the current Session settings. A new session file (e.g. \pmagic\pmodules\099-saved-session.sqfm) will then be written.

6. The next time you boot to PMagic, answer Y for a LIVE session and you should see the same Desktop as before, because it will load the previously saved session file.

If you save multiple sessions, the latest saved session will be loaded by PMagic as it boots.

isoboot.b4g has been written so that it will use the language that is used by E2B, so if you have set LANG=SPANISH in your \_ISO\MyE2B.cfg file, then Parted Magic will also be set to Spanish.

FYI, the isoboot.g4b code is:

:.pmagic

set try=/pmagic/bzImage
if exist %try% set kernel=%try%
set try=/pmagic/initrd.img
if exist %try% set initrd=%try%

echo
echo -e Live (persistent) mode (for 512MB-1G based systems).\nThe USB drive must remain attached to the system during this session.
echo -e You can then save settings on exit.
echo -e For Live Mode (persistence) - the file /pmagic/pmodules/PMAGIC_XXXX_XX_XX.SQFS\nmust exist on the E2B USB DRIVE.
echo -e You can copy the SQFS file from iso/pmagic/pmodules to the \nE2B drive's /pmagic/pmodules folder using Parted Magic File Manager.
echo -e The SQFS file can be of 0 bytes in size as long as the filename is identical to the one in the ISO.
set LIVE=
echo
set /p ask=Do you want LIVE boot (Y/[N]) : 
if /i "%ask%"=="Y" set LIVE=boot=live

set keymap=
if "%LANG%"=="GERMAN"       set keymap=keymap=de-latin1 de_DE
if "%LANG%"=="SPANISH"      set keymap=keymap=es es_ES
if "%LANG%"=="FRENCH"       set keymap=keymap=fr-latin1 fr_FR
if "%LANG%"=="ITALIAN"      set keymap=keymap=it it_IT
if "%LANG%"=="PORTU_BRAZIL" set keymap=keymap=br-abnt2 pt_BR
if "%LANG%"=="POLISH"       set keymap=keymap=pl pl_PL
if "%LANG%"=="SIMP_CHINESE" set keymap=keymap=us zh_CN
if "%LANG%"=="TRAD_CHINESE" set keymap=keymap=us zh_CN

echo -e kernel %kernel% iso_filename=%ISOSCAN% eject=no edd=on vga=normal vmalloc=512MiB %keymap% %LIVE% > (md)0x220+1
echo initrd %initrd% >> (md)0x220+1

set LIVE=
set keymap=
set ISOSCAN=

goto :ISOBOOT



Make your own menu

Of course, you can make your own .mnu file and change the parameters to suit you - you can use the Parted_Magic_Live_Persistent.mnu file as a template and edit it as you wish (for instance change the amount of memory used from 512MiB to 1Gib+ by removing the vmalloc parameter:

Parted_Magic_Live_Persistent.mnu

# Copy this file and iso to same folder (e.g. \_ISO\LINUX\MNU)
# if using Parted Magic and want LIVE Save Session (persistence) to work - make sure the \pmagic\pmodules folder on the E2B USB drive contains a xxxx.SQFS file.
# The file can be of 0 bytes in size as long as the filename is the same as is inside the ISO file you are using.
# Change first 4 lines to match ISO, language and live requirement

iftitle [if exist $HOME$/pmagic_2014_09_29.iso] Parted Magic (LIVE)\n Boot Parted Magic with Save Session option.
set ISO=$HOME$/pmagic_2014_09_29.iso
set LIVE=boot=live

# uncomment next line if LIVE is not required
# set LIVE=

map --read-only %ISO% (0xff) || map --mem %ISO% (0xff)
map --hook
root (0xff)
set keymap=
if "%LANG%"=="GERMAN"       set keymap=keymap=de-latin1 de_DE
if "%LANG%"=="SPANISH"      set keymap=keymap=es es_ES
if "%LANG%"=="FRENCH"       set keymap=keymap=fr-latin1 fr_FR
if "%LANG%"=="ITALIAN"      set keymap=keymap=it it_IT
if "%LANG%"=="PORTU_BRAZIL" set keymap=keymap=br-abnt2 pt_BR
if "%LANG%"=="POLISH"       set keymap=keymap=pl pl_PL
if "%LANG%"=="SIMP_CHINESE" set keymap=keymap=us zh_CN
if "%LANG%"=="TRAD_CHINESE" set keymap=keymap=us zh_CN


# For 1GiB+ 64-bit systems use:#kernel /pmagic/bzImage64 iso_filename=%ISO% eject=no edd=on vga=normal %keymap% %LIVE%#initrd /pmagic/initrd64.img


kernel /pmagic/bzImage iso_filename=%ISO% eject=no edd=on vga=normal vmalloc=512MiB %keymap% %LIVE%
initrd /pmagic/initrd.img
boot


Parted Magic 2016 for E2B

# Copy this file and iso to same folder (e.g. \_ISO\LINUX\MNU)
# if using Parted Magic and want LIVE Save Session (persistence) to work - make sure the \pmagic\pmodules folder on the E2B USB drive contains a pmagic_2016_07_12.SQFS file.
# The file can be of 0 bytes in size as long as the filename is the same as is inside the ISO file you are using.
# SAVE feature only works on USB drives (not under a VM)

iftitle [if exist $HOME$/pmagic_2016_07_12.iso] Parted Magic 2016 (LIVE)\n Boot Parted Magic with Save Session option.
set ISO=$HOME$/pmagic_2016_07_12.iso

#set keymap=keymap=us
#set keymap=keymap=uk
if "%LANG%"=="GERMAN"       set keymap=keymap=de-latin1 de_DE
if "%LANG%"=="SPANISH"      set keymap=keymap=es es_ES
if "%LANG%"=="FRENCH"       set keymap=keymap=fr-latin1 fr_FR
if "%LANG%"=="ITALIAN"      set keymap=keymap=it it_IT
if "%LANG%"=="PORTU_BRAZIL" set keymap=keymap=br-abnt2 pt_BR
if "%LANG%"=="POLISH"       set keymap=keymap=pl pl_PL
if "%LANG%"=="SIMP_CHINESE" set keymap=keymap=us zh_CN
if "%LANG%"=="TRAD_CHINESE" set keymap=keymap=us zh_CN

if not exist /pmagic/pmodules/PMAGIC_2016_07_12.SQFS pause --wait=5 WARNING: \pmagic\pmodules\PMAGIC_2016_07_12.SQFS does not exist - SAVE feature not enabled!

set default=edd=on vga=normal
set LIVE=boot=live eject=no
set linux_64=/pmagic/bzImage64
set linux_32=/pmagic/bzImage
set init_img=/pmagic/initrd.img /pmagic/fu.img /pmagic/m64.img
set init_32=/pmagic/initrd.img /pmagic/fu.img /pmagic/m32.img
map --read-only %ISO% (0xff) || map --mem %ISO% (0xff)
map --hook
root (0xff)

# For 1GiB+ 64-bit systems use:
checkrange 2,3 is64bit && pause --wait=3 Booting 64-bit version...
checkrange 2,3 is64bit && kernel %linux_64% %default% iso_filename=%ISO% %keymap% %LIVE%
checkrange 2,3 is64bit && initrd %init_img%
checkrange 2,3 is64bit && boot

#32-bit
pause --wait=3 Booting 32-bit version...
kernel %linux_32% %default% iso_filename=%ISO% %keymap% %LIVE%
initrd %init_32%
boot