Commit fcf8a435 by devttys0

Updated setup.py and easy_install.sh to reflect new dependencies

parent 74c38e96
......@@ -12,14 +12,7 @@ function libmagic
URL="$SITE$OUTFILE"
echo "Downloading '$URL'..."
if [ "$(which wget)" != "" ]
then
wget "$URL"
elif [ "$(which curl)" != "" ]
then
curl "$URL" > "$OUTFILE"
fi
if [ -e "$OUTFILE" ]
then
......@@ -33,6 +26,28 @@ function libmagic
fi
}
function pyqtgraph
{
SITE="http://www.pyqtgraph.org/downloads/"
VERSION="0.9.8"
OUTFILE="pyqtgraph-$VERSION.tar.gz"
URL="$SITE$OUTFILE"
echo "Downloading '$URL'..."
wget "$URL"
if [ -e "$OUTFILE" ]
then
echo "Installing pyqtgraph..."
tar -zxvf "$OUTFILE"
cd "pyqtgraph-$VERSION" && $SUDO python ./setup.py install && cd ..
$SUDO rm -rf "pyqtgraph-$VERSION"
else
echo "ERROR: Failed to download '$URL'!"
echo "pyqtgraph not installed."
fi
}
function debian
{
# The appropriate unrar package goes under different names in Debian vs Ubuntu
......@@ -44,27 +59,15 @@ function debian
fi
# Install binwalk/fmk pre-requisites and extraction tools
$SUDO apt-get -y install git build-essential mtd-utils zlib1g-dev liblzma-dev ncompress gzip bzip2 tar arj p7zip p7zip-full openjdk-6-jdk python-matplotlib
$SUDO apt-get -y install git build-essential mtd-utils zlib1g-dev liblzma-dev ncompress gzip bzip2 tar arj p7zip p7zip-full openjdk-6-jdk
$SUDO apt-get -y install python-qt4 python-qt4-gl python-numpy python-scipy
}
function redhat
{
$SUDO yum groupinstall -y "Development Tools"
$SUDO yum install -y git mtd-utils unrar zlib1g-dev liblzma-dev xz-devel compress gzip bzip2 tar arj p7zip p7zip-full openjdk-6-jdk python-matplotlib
}
function darwin
{
if [ "$(which easy_install)" == "" ]
then
curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | $SUDO python
fi
if [ "$(which easy_install)" != "" ]
then
easy_install -m numpy
easy_install -m matplotlib
fi
$SUDO yum install -y git mtd-utils unrar zlib1g-dev liblzma-dev xz-devel compress gzip bzip2 tar arj p7zip p7zip-full openjdk-6-jdk
$SUDO yum install -y python-qt4 python-qt4-gl python-numpy python-scipy
}
if [ "$1" == "" ] || [ "$1" == "--sumount" ]
......@@ -111,17 +114,13 @@ case $DISTRO in
centos)
redhat
;;
darwin)
darwin
;;
*)
echo ""
echo "This system is not recognized by easy install! You may need to install dependent packages manually."
echo ""
echo "If your system is a derivative of Debian, RedHat, or OSX, you can try manually specifying your system type on the command line:"
echo "If your system is a derivative of Debian or RedHat, you can try manually specifying your system type on the command line:"
echo ""
echo -e "\t$0 [debian | redhat | darwin] [--sumount]"
echo -e "\t$0 [debian | redhat] [--sumount]"
echo ""
exit 1
esac
......@@ -132,19 +131,22 @@ then
libmagic
fi
# FMK doesn't support OSX.
if [ "$DISTRO" != "darwin" ]
if [ "$(python -c 'import pyqtgraph; print (pyqtgraph.__file__)' 2>/dev/null)" == "" ]
then
echo "pyqtgraph not installed."
pyqtgraph
fi
# Get and build the firmware mod kit
$SUDO rm -rf /opt/firmware-mod-kit/
$SUDO mkdir -p /opt/firmware-mod-kit
$SUDO chmod a+rwx /opt/firmware-mod-kit
git clone https://code.google.com/p/firmware-mod-kit /opt/firmware-mod-kit/
cd /opt/firmware-mod-kit/src
./configure && $SUDO make
if [ "$1" == "--sumount" ] || [ "$2" == "--sumount" ]
then
# Get and build the firmware mod kit
$SUDO rm -rf /opt/firmware-mod-kit/
$SUDO mkdir -p /opt/firmware-mod-kit
$SUDO chmod a+rwx /opt/firmware-mod-kit
git clone https://code.google.com/p/firmware-mod-kit /opt/firmware-mod-kit/
cd /opt/firmware-mod-kit/src
./configure && $SUDO make
if [ "$1" == "--sumount" ] || [ "$2" == "--sumount" ]
then
# The following will allow you - and others - to mount/unmount file systems without root permissions.
# This may be problematic, especially on a multi-user system, so think about it first.
$SUDO chown root ./mountcp/mountsu
......@@ -158,9 +160,8 @@ then
$SUDO chown root ./jffs2/sunjffs2
$SUDO chmod u+s ./jffs2/sunjffs2
$SUDO chmod o-w ./jffs2/sunjffs2
fi
cd -
fi
cd -
# Install binwalk
$SUDO python setup.py install
......
......@@ -61,13 +61,10 @@ except Exception as e:
warning(msg)
try:
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot
import numpy
import pyqtgraph
except Exception as e:
msg = ["Pre-requisite check warning: " + str(e),
"To take advantage of this tool's entropy plotting capabilities, please install the python-matplotlib module.",
"To take advantage of this tool's graphing capabilities, please install the pyqtgraph module.",
]
warning(msg, prompt=True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment