Live Raizo - Linux for Virtual SysAdmin Wiki
Environment to experiment the system on simulated and real networks
Brought to you by:
raizo62
# 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
FILE_ISO="Live-Raizo-v12.21.01.04p.iso"
# Not needed to be changed :
NEW_FILE_ISO="new_${FILE_ISO}"
NEW="new"
OLD="old"
DIR_FILESYSTEM="filesystem"
FS="${NEW}/${DIR_FILESYSTEM}"
mkdir -p "${OLD}" "${NEW}"
DIR_OLD_ISO="${OLD}/iso"
mkdir -p "${DIR_OLD_ISO}"
sudo mount -o loop "${FILE_ISO}" "${DIR_OLD_ISO}"
DIR_NEW_ISO="${NEW}/iso"
sudo rsync -X -a "${DIR_OLD_ISO}/" "${DIR_NEW_ISO}"
sudo umount "${DIR_OLD_ISO}"
DIR_OLD_FILESYSTEM="${OLD}/${DIR_FILESYSTEM}"
mkdir -p "${DIR_OLD_FILESYSTEM}"
sudo mount "${DIR_NEW_ISO}/live/filesystem.squashfs" "${DIR_OLD_FILESYSTEM}" -o loop
sudo rsync -X -a "${DIR_OLD_FILESYSTEM}/" "${NEW}/${DIR_FILESYSTEM}"
sudo umount "${DIR_OLD_FILESYSTEM}"
# VDI for VM
cp FILE.VDI "${FS}/opt/raizo/user/OS/QEMU"
cp FILE.VDI.md5sum "${FS}/opt/raizo/user/OS/QEMU"
# 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/"
# Config
cp FILES.CONFIG "${FS}/etc/skel/"
# Copy on the FTPs server : srvftp.domain.local
cat << EOF | sudo tee -a "${FS}/opt/raizo/etc/cmd-fast-save-project.conf"
net:ftps echo -n "Login : " && read LOGIN && lftp -u \$LOGIN -e "set ftp:ssl-protect-data true ; put '%f'; exit" srvftp.domain.local
EOF
source "${FS}/etc/os-release"
sudo chown -R 1000:1000 "${FS}/opt/raizo/user"
cd "${NEW}"
sudo mksquashfs "${DIR_FILESYSTEM}" new.filesystem.squashfs -comp xz -noappend
cd ..
sudo cp "${NEW}/new.filesystem.squashfs" "${DIR_NEW_ISO}/live/filesystem.squashfs"
sudo chmod 444 "${DIR_NEW_ISO}/live/filesystem.squashfs"
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}"