#!/bin/sh
#Created by TheX1le
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 boot partition EX. hda1"
read BOOT
echo "Your root partition EX. hda3"
read ROOT
clear
mkdir -p /tmp/backtrack/boot
#determines if you are using mutiple partitons or not
if [ "$BOOT" == "$ROOT" ]; then
echo "This is not the best recomended install method"
echo "Mounting Drive"
mount /dev/$ROOT /tmp/backtrack
if [ "$?" != "0" ]; then
echo "Mounting failed check your partitions"
exit
fi
else
echo "Mounting Drives"
mount /dev/$BOOT /tmp/backtrack/boot
mount /dev/$ROOT /tmp/backtrack
if [ "$?" != "0" ]; then
echo "Mounting failed check your partitions"
exit
fi
fi
#copies over the files
cp --preserve -R -v /{bin,dev,home,pentest,root,usr,etc,lib,opt,sbin,var} /tmp/backtrack
if [ "$?" != "0" ]; then
echo "Files did not copy correctly there were some errors"
exit
else
echo "Backtrack files copied sucessfully"
fi
mkdir /tmp/backtrack/{mnt,proc,sys,tmp}
mount --bind /dev/ /tmp/backtrack/dev/
mount -t proc proc /tmp/backtrack/proc/
cp /boot/vmlinuz /tmp/backtrack/boot
if [ "$?" != "0" ]; then
echo "Kernel did not copy correctly there was an error"
exit
else
echo "Kernel copied sucessfully"
fi
read -p "Backtrack copied to hard drive successfully press the ANY KEY to continue"
clear
"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"