#!/bin/bash
echo Welcome, this program will test the speed of a kernel 
echo compile on your system
# echo You must have internet connectivity to run this program
echo the results you get from this can be compared to others
echo
echo Good luck! 
echo
echo
echo

export JOBS=32
export KERNEL=2.6.39

clear

#echo retrieving linux-2.6.17.1.tar.bz2 for the purposes of this test
#echo
#wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.17.1.tar.bz2 . &> log.txt
#echo saving to current directory along with log.txt and results.txt
#touch log.txt
#touch results.txt2q1
#echo All files will be cleaned up afterwards
echo

#2>&1
echo decompressing linux-$KERNEL.tar.bz2 and entering linux-$KERNEL/
tar -xjvf ./linux-$KERNEL.tar.bz2 2>&1

#echo Retrieving default sample .config file

echo Now running test!
echo Make sure you have no other cpu/mem/disk intensive programs running

cd linux-$KERNEL
make defconfig
cp -a ../CONFIG-huge .config
#wget http://d3ath.org/.config . 2>&1
time sh -c 'make -j$JOBS bzImage modules'
cd ..
echo Removing linux-$KERNEL/
rm -rf linux-$KERNEL 2>&1
echo Test completed!

