Menu

CustomizeLiveRaizo


Info

  • Code is here : ModifyISO.sh

Necessary Packages

# mksquashfs
sudo apt-get install squashfs-tools
# xorriso
sudo apt-get -y install xorriso
# /usr/lib/ISOLINUX/isohdpfx.bin
sudo apt-get -y install isolinux
# rsync
sudo apt-get install rsync

Variables

FILE_ISO="Live-Raizo-v15.24.10.01i.iso"

# Not needed to be changed :

NEW_FILE_ISO="new_${FILE_ISO}"

NEW="new"
OLD="old"

DIR_FILESYSTEM="filesystem"

FS="${NEW}/${DIR_FILESYSTEM}"

Before Customization

  • Create temporary directory :
mkdir -p "${OLD}" "${NEW}"
  • Mount iso :
DIR_OLD_ISO="${OLD}/iso"
mkdir -p "${DIR_OLD_ISO}"
sudo mount -o loop "${FILE_ISO}" "${DIR_OLD_ISO}"
  • Create a writable iso :
DIR_NEW_ISO="${NEW}/iso"
sudo rsync -X -a "${DIR_OLD_ISO}/" "${DIR_NEW_ISO}"
  • Umount iso :
sudo umount "${DIR_OLD_ISO}"
  • Mount filesystem :
DIR_OLD_FILESYSTEM="${OLD}/${DIR_FILESYSTEM}"
mkdir -p "${DIR_OLD_FILESYSTEM}"
sudo mount "${DIR_NEW_ISO}/live/filesystem.squashfs" "${DIR_OLD_FILESYSTEM}" -o loop
  • Create a writable filesystem :
sudo rsync -X -a "${DIR_OLD_FILESYSTEM}/" "${NEW}/${DIR_FILESYSTEM}"
  • Umount old filesystem :
sudo umount "${DIR_OLD_FILESYSTEM}"

Customization (examples)

  • QEmu :
# VDI for VM
cp FILE.VDI "${FS}/opt/raizo/user/OS/QEMU"
cp FILE.VDI.md5sum "${FS}/opt/raizo/user/OS/QEMU"
  • GNS3 :
# IOS
cp FILE.image "${FS}/opt/raizo/user/OS/IOS/"
cp FILE.image.md5sum "${FS}/opt/raizo/user/OS/IOS/"

# IOU
cp FILE.image "${FS}/opt/raizo/user/OS/IOU/"
cp FILE.image.md5sum "${FS}/opt/raizo/user/OS/IOU/"

# Config
cp FILES.CONFIG "${FS}/opt/raizo/user/Config/GNS3/"
  • User :
# Config
cp FILES.CONFIG "${FS}/etc/skel/"
  • fast-save-project :
cat << EOF | sudo tee -a "${FS}/opt/raizo/etc/cmd-fast-save-project.conf"
# Copy on the FTPs server : srvftp.domain.local :
net:ftps echo -n "Login : " && read LOGIN && lftp -u \${LOGIN} -e "set ftp:ssl-protect-data true ; put '%f'; exit" srvftp.domain.local
# Copy on the ssh server srvssh.domain.local :
net:ssh echo -n "Login : " && read LOGIN && scp %f \${LOGIN}@srvssh.domain.local:
EOF

After Customization

  • Load parameters of LiveRaizo :
source "${FS}/etc/os-release"
  • Change owner :
sudo chown -R 1000:1000 "${FS}/opt/raizo/user"
  • Create new squashfs :
cd "${NEW}"
sudo mksquashfs "${DIR_FILESYSTEM}" new.filesystem.squashfs -comp xz -noappend
cd ..
  • Create new live :
sudo cp "${NEW}/new.filesystem.squashfs" "${DIR_NEW_ISO}/live/filesystem.squashfs"
sudo chmod 444 "${DIR_NEW_ISO}/live/filesystem.squashfs"
  • Create new iso :
sudo xorriso -as mkisofs -R -r -J -joliet-long -l -cache-inodes -iso-level 3 -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -partition_offset 16 -A Live_Raizo -p 'live-build' -publisher 'Live Raizo; https://sourceforge.net/projects/live-raizo/;' -V Live_Raizo_v${VERSION_ID} --modification-date=$(date "+%Y%m%d%H%m%S00") -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat -isohybrid-apm-hfsplus -o "${NEW_FILE_ISO}" "${DIR_NEW_ISO}"