#!/bin/sh #Created by TheX1le function errcsk { if [ "$?" != "0" ]; then echo $ERRMSG exit else echo $SUCMSG fi } clear echo "This simple script is just for installing bt2, it assumes you have created and formatted your partitions all ready. Version BETA 2" #Handles input of boot and root partitions echo "Your Source for BT files EX. /" read SOURCE echo "Your boot partition EX. hda1" read BOOT echo "Your root partition EX. hda3" read ROOT clear if [ -z"$SOURCE" ]; then echo "Please set a source" exit else if [ -z"$BOOT" ]; then echo "Please set a boot Destination" exit else if [ -z"$root" ]; then echo "Please set a root Destination" exit fi fi fi mkdir -p /tmp/backtrack/boot #determines if you are using mutiple partitons or not if [ "$BOOT" == "$ROOT" ]; then echo -e "This is not the best recomended install method" echo "Mounting Drive" ERRMSG=$(echo -e "\033[31m Mounting failed check your partitions") SUCMSG=$(echo "Drive mounted sucessfully") mount /dev/$ROOT /tmp/backtrack errcsk else echo "Mounting Drives" mount /dev/$BOOT /tmp/backtrack/boot mount /dev/$ROOT /tmp/backtrack ERRMSG=$(echo -e "\033[31m Mounting failed check your partitions") SUCMSG=$(echo "Drives mounted sucessfully") mount /dev/$ROOT /tmp/backtrack errcsk fi #copies over the files cp --preserve -R -v $SOURCE/{bin,dev,home,pentest,root,usr,etc,lib,opt,sbin,var} /tmp/backtrack ERRMSG=$(echo -e "\033[31m Files did not copy correctly there were some errors") SUCMSG=$(echo "Backtrack files copied sucessfully") errcsk mkdir /tmp/backtrack/{mnt,proc,sys,tmp} ERRMSG=$(echo -e "\033[31m mnt,proc,sys,tmp failed to be made there was an error") SUCMSG=$(echo "mnt,proc,sys,tmp created sucessfully") errcsk cp "$SOURCE"/boot/vmlinuz /tmp/backtrack/boot ERRMSG=$(echo -e "\033[31m Kernel did not copy correctly there was an error") SUCMSG=$(echo "Kernel copied sucessfully") errcsk read -p "Backtrack copied to hard drive successfully press the ANY KEY to continue" clear echo "mounting dev and proc" mount --bind /dev/ /tmp/backtrack/dev/ && mount -t proc proc /tmp/backtrack/proc/ ERRMSG=$(echo -e "\033[31m dev or proc failed to mount there was an error") SUCMSG=$(echo "dev and proc mounted sucessfully") errcsk echo "your next step is to chroot into your new install IE [chroot /tmp/backtrack/ /bin/bash], then edit /etc/lilo.conf and run lilo -v . Thats it your installed"