#!/bin/bash if [[ $EUID -ne 0]]; then echo "[-] Some tools in this script require you to be root." exit 1 fi if [ $# -ne 1 ]; then echo "[-] Please supply iso." exit 1 fi btisoname=$1 clear echo "##############################################################" echo "[*] BackTrack 5 Final customisation script" echo "[*] Setting up the build environment..." services="inetutils-inetd tinyproxy iodined knockd openvpn atftpd ntop nstxd nstxcd apache2 sendmail atd dhcp3-server winbind miredo miredo-server pcscd wicd wacom cups bluetooth binfmt-support mysql" mkdir -p mnt mount -o loop $btisoname mnt/ mkdir -p extract-cd rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd mkdir -p squashfs mount -t squashfs -o loop mnt/casper/filesystem.squashfs squashfs mkdir -p edit echo "[*] Copying over files, please wait ... " cp -a squashfs/* edit/ cp /etc/resolv.conf edit/etc/ cp /etc/hosts edit/etc/ cp /etc/fstab edit/etc/ cp /etc/mtab edit/etc/ mount --bind /dev/ edit/dev mount -t proc /proc edit/proc echo "##############################################################" echo "[*] Entering livecd. " echo "##############################################################" echo "[*] Now you can modify the LiveCD. At minimum, we recommend :" echo "[*] apt-get update && apt-get upgrade & apt-get clean" echo "##############################################################" echo "[*] If you are running a large update, you might need to stop" echo "[*] services like crond, udev, cups, etc in the chroot" echo "[*] before exiting your chroot environment." echo "##############################################################" echo "[*] Once you have finished your modifications, type \"exit\"" echo "##############################################################" chroot edit echo "[*] Exited the build environemnt, unmounting images."