Skip to content

Commit

Permalink
Re-arrange setup script to get input early
Browse files Browse the repository at this point in the history
  • Loading branch information
pranith committed Jan 20, 2016
1 parent 0328d64 commit c0f8759
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ normal=$(tput sgr0)

ARCH=$1

# Install dependencies
echo "Installing dependencies..."
echo "sudo apt-get -y build-dep qemu"
sudo apt-get -y build-dep qemu
sudo apt-get -y install gcc-aarch64-linux-gnu
sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu

# set the QSIM environment variable
echo "Setting QSIM environment variable..."
export QSIM_PREFIX=`pwd`
Expand All @@ -30,6 +23,28 @@ echo "Press any key to continue..."

read inp

echo "\n\nDown QEMU OS images? This will take a while. (Y/n):"
read inp

# Install dependencies
echo "Installing dependencies..."
echo "sudo apt-get -y build-dep qemu"
sudo apt-get -y build-dep qemu
sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu

if [ "$inp" = "y" -o "$inp" = "Y" ]; then
cd ..
# get qemu images
echo "\nDownloading arm QEMU images..."
wget -c https://www.dropbox.com/s/2jplu61410tfime/arm64_images.tar.xz?dl=0 -O arm64_images.tar.xz
wget -c https://www.dropbox.com/s/4ut7e4d5ygty020/x86_64_images.tar.xz?dl=0 -O x86_64_images.tar.xz

echo "\nUncompresssing images. This might take a while..."
tar -xf arm64_images.tar.xz
tar -xf x86_64_images.tar.xz
cd $QSIM_PREFIX
fi

# update submodules
git submodule update --init
echo "Building capstone disassembler..."
Expand All @@ -55,21 +70,6 @@ echo "\nConfiguring and building qemu...\n"
# copy header files to include directory
make release install

echo "\n\nDown QEMU OS images? This will take a while. (Y/n):"
read inp
if [ ! "$inp" != "y" ]; then
cd ..
# get qemu images
echo "\nDownloading arm QEMU images..."
wget -c https://www.dropbox.com/s/2jplu61410tfime/arm64_images.tar.xz?dl=0 -O arm64_images.tar.xz
wget -c https://www.dropbox.com/s/4ut7e4d5ygty020/x86_64_images.tar.xz?dl=0 -O x86_64_images.tar.xz

echo "\nUncompresssing images. This might take a while..."
tar -xf arm64_images.tar.xz
tar -xf x86_64_images.tar.xz
cd $QSIM_PREFIX
fi

echo "\n\nBuilding busybox"
cd initrd/
./getbusybox.sh
Expand Down

0 comments on commit c0f8759

Please sign in to comment.