Sunday, 17 April 2016

Add archbang linux + persistence to E2B

The archlinux ISO must be installed, it is not a 'LiveCD', however archbang does come in LiveCD format. Here is the .mnu file for getting the ISO to boot with a persistent volume.



Files on E2B drive (FAT32 or NTFS or exFAT):
/_ISO/LINUX/MNU/archbang-010316-i686.iso
/_ISO/LINUX/MNU/archbang-010316-i686_persistent.mnu
/arch-rw-010316



I used archbang-010316-i686.iso. To check if persistence is working, I added a new file to the Documents folder and it was still there when I rebooted!

P.S. It boots pretty fast too!

# archbang liveCD + persistence for  /home/live files and system files
# create ext2 file called arch-rw-010316 with volume label of arch-rw using RMPrepUSB - Create ext2 FS

iftitle [if exist $HOME$/archbang-010316-i686.iso] ArchBang (Persistent)\n Uses ext2 file
set ISO=$HOME$/archbang-010316-i686.iso
# specify ext2 file (full path)
set PER=/arch-rw-010316
# specify volume name of ext2 file - e.g. arch-rw
set cow=cow_label=arch-rw

if exist CD echo WARNING: Cannot use partnew command! && pause && configfile (bd)/menu.lst
if "%E2BDEV%"=="" set E2BDEV=hd0 && pause E2BDEV forced to hd0!
#enable parttype output
debug 1
# make empty table entry in 3rd position in ptn table
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 ON %E2BDEV% IS ALREADY IN USE - PERSISTENCE WILL NOT WORK! && 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
#map ptn 4 to ISO
partnew (%E2BDEV%,3) 0x0 %ISO%
map %ISO% (0xff)
map --hook
root (0xff)
#note: archisobasedir is not needed - archisobasedir=arch 
kernel /arch/boot/i686/vmlinuz archisolabel=ARCHBANG %cow% quiet
initrd /arch/boot/intel_ucode.img /arch/boot/i686/archiso.img
boot

I will add the .mnu file to the \_ISO\docs\Sample mnu Files folder in the next Beta version of E2B.

Boot parameters are listed here.

For the 64-bit version we need to change the paths - here is a version of the .mnu file which caters for both i686 and x86_64 ISOs:

# archbang liveCD + persistence for  /home/live files and system files
# create ext2 file called arch-rw-010316 with volume label of arch-rw using RMPrepUSB - Create ext2 FS

iftitle [if exist $HOME$/archbang-010316-x86_64.iso] ArchBang x86_64 or i686 (Persistent)\n Uses ext2 file
set ISO=$HOME$/archbang-010316-x86_64.iso
# specify ext2 file (full path)
set PER=/arch-rw-010316
# specify volume name of ext2 file - e.g. arch-rw
set cow=cow_label=arch-rw

if exist CD echo WARNING: Cannot use partnew command! && pause && configfile (bd)/menu.lst
if "%E2BDEV%"=="" set E2BDEV=hd0 && pause E2BDEV forced to hd0!
#enable parttype output
debug 1
# make empty table entry in 3rd position in ptn table
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 ON %E2BDEV% IS ALREADY IN USE - PERSISTENCE WILL NOT WORK! && 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
#map ptn 4 to ISO
partnew (%E2BDEV%,3) 0x0 %ISO%
map %ISO% (0xff)
map --hook
root (0xff)
if exist /arch/boot/i686/vmlinuz set cpu=i686
if exist /arch/boot/x86_64/vmlinuz set cpu=x86_64
#note: archisobasedir is not needed - archisobasedir=arch 
kernel /arch/boot/%cpu%/vmlinuz archisolabel=ARCHBANG %cow% quiet
initrd /arch/boot/intel_ucode.img /arch/boot/%cpu%/archiso.img
boot

P.S. Always shutdown nicely or you may get file corruption. If you are going to use it a lot, I suggest that you re-format the mounted cow volume to ext3 before you start to use it, because ext3 is more resilient than ext2.