Advertisement
Guest User

http://codeinject.org's Edit for the BT5 custom script

a guest
Jul 7th, 2011
2,077
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.87 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4. if [[ $EUID -ne 0]]; then
  5.   echo "[-] Some tools in this script require you to be root."
  6.   exit 1
  7. fi
  8. if [ $# -ne 1 ]; then
  9.   echo "[-] Please supply iso."
  10.   exit 1
  11. fi
  12. btisoname=$1
  13.  
  14. clear
  15. echo "##############################################################"
  16. echo "[*] BackTrack 5 Final customisation script"
  17. echo "[*] Setting up the build environment..."
  18.  
  19. 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"
  20.  
  21. mkdir -p mnt
  22. mount -o loop $btisoname mnt/
  23. mkdir -p extract-cd
  24. rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd
  25. mkdir -p squashfs
  26. mount -t squashfs -o loop mnt/casper/filesystem.squashfs squashfs
  27. mkdir -p edit
  28. echo "[*] Copying over files, please wait ... "
  29.  
  30. cp -a squashfs/* edit/
  31.  
  32. cp /etc/resolv.conf edit/etc/
  33. cp /etc/hosts edit/etc/
  34. cp /etc/fstab edit/etc/
  35. cp /etc/mtab edit/etc/
  36.  
  37. mount --bind /dev/ edit/dev
  38. mount -t proc /proc edit/proc
  39.  
  40. echo "##############################################################"
  41. echo "[*] Entering livecd. "
  42. echo "##############################################################"
  43. echo "[*] Now you can modify the LiveCD. At minimum, we recommend :"
  44. echo "[*] apt-get update && apt-get upgrade & apt-get clean"
  45. echo "##############################################################"
  46. echo "[*] If you are running a large update, you might need to stop"
  47. echo "[*] services like crond, udev, cups, etc in the chroot"
  48. echo "[*] before exiting your chroot environment."
  49. echo "##############################################################"
  50. echo "[*] Once you have finished your modifications, type \"exit\""
  51. echo "##############################################################"
  52.  
  53. chroot edit
  54.  
  55. echo "[*] Exited the build environemnt, unmounting images."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement