Commit fcf8a435 by devttys0

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

parent 74c38e96
...@@ -12,14 +12,7 @@ function libmagic ...@@ -12,14 +12,7 @@ function libmagic
URL="$SITE$OUTFILE" URL="$SITE$OUTFILE"
echo "Downloading '$URL'..." echo "Downloading '$URL'..."
wget "$URL"
if [ "$(which wget)" != "" ]
then
wget "$URL"
elif [ "$(which curl)" != "" ]
then
curl "$URL" > "$OUTFILE"
fi
if [ -e "$OUTFILE" ] if [ -e "$OUTFILE" ]
then then
...@@ -33,6 +26,28 @@ function libmagic ...@@ -33,6 +26,28 @@ function libmagic
fi 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 function debian
{ {
# The appropriate unrar package goes under different names in Debian vs Ubuntu # The appropriate unrar package goes under different names in Debian vs Ubuntu
...@@ -44,27 +59,15 @@ function debian ...@@ -44,27 +59,15 @@ function debian
fi fi
# Install binwalk/fmk pre-requisites and extraction tools # 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 function redhat
{ {
$SUDO yum groupinstall -y "Development Tools" $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 $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
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
} }
if [ "$1" == "" ] || [ "$1" == "--sumount" ] if [ "$1" == "" ] || [ "$1" == "--sumount" ]
...@@ -111,17 +114,13 @@ case $DISTRO in ...@@ -111,17 +114,13 @@ case $DISTRO in
centos) centos)
redhat redhat
;; ;;
darwin)
darwin
;;
*) *)
echo "" echo ""
echo "This system is not recognized by easy install! You may need to install dependent packages manually." echo "This system is not recognized by easy install! You may need to install dependent packages manually."
echo "" 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 ""
echo -e "\t$0 [debian | redhat | darwin] [--sumount]" echo -e "\t$0 [debian | redhat] [--sumount]"
echo "" echo ""
exit 1 exit 1
esac esac
...@@ -132,35 +131,37 @@ then ...@@ -132,35 +131,37 @@ then
libmagic libmagic
fi fi
# FMK doesn't support OSX. if [ "$(python -c 'import pyqtgraph; print (pyqtgraph.__file__)' 2>/dev/null)" == "" ]
if [ "$DISTRO" != "darwin" ]
then then
# Get and build the firmware mod kit echo "pyqtgraph not installed."
$SUDO rm -rf /opt/firmware-mod-kit/ pyqtgraph
$SUDO mkdir -p /opt/firmware-mod-kit fi
$SUDO chmod a+rwx /opt/firmware-mod-kit
git clone https://code.google.com/p/firmware-mod-kit /opt/firmware-mod-kit/ # Get and build the firmware mod kit
$SUDO rm -rf /opt/firmware-mod-kit/
cd /opt/firmware-mod-kit/src $SUDO mkdir -p /opt/firmware-mod-kit
./configure && $SUDO make $SUDO chmod a+rwx /opt/firmware-mod-kit
if [ "$1" == "--sumount" ] || [ "$2" == "--sumount" ] git clone https://code.google.com/p/firmware-mod-kit /opt/firmware-mod-kit/
then
# The following will allow you - and others - to mount/unmount file systems without root permissions. cd /opt/firmware-mod-kit/src
# This may be problematic, especially on a multi-user system, so think about it first. ./configure && $SUDO make
$SUDO chown root ./mountcp/mountsu if [ "$1" == "--sumount" ] || [ "$2" == "--sumount" ]
$SUDO chmod u+s ./mountcp/mountsu then
$SUDO chmod o-w ./mountcp/mountsu # 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/umountsu $SUDO chown root ./mountcp/mountsu
$SUDO chmod u+s ./mountcp/umountsu $SUDO chmod u+s ./mountcp/mountsu
$SUDO chmod o-w ./mountcp/umountsu $SUDO chmod o-w ./mountcp/mountsu
$SUDO chown root ./jffs2/sunjffs2 $SUDO chown root ./mountcp/umountsu
$SUDO chmod u+s ./jffs2/sunjffs2 $SUDO chmod u+s ./mountcp/umountsu
$SUDO chmod o-w ./jffs2/sunjffs2 $SUDO chmod o-w ./mountcp/umountsu
fi
cd - $SUDO chown root ./jffs2/sunjffs2
$SUDO chmod u+s ./jffs2/sunjffs2
$SUDO chmod o-w ./jffs2/sunjffs2
fi fi
cd -
# Install binwalk # Install binwalk
$SUDO python setup.py install $SUDO python setup.py install
......
...@@ -61,13 +61,10 @@ except Exception as e: ...@@ -61,13 +61,10 @@ except Exception as e:
warning(msg) warning(msg)
try: try:
import matplotlib import pyqtgraph
matplotlib.use('Agg')
import matplotlib.pyplot
import numpy
except Exception as e: except Exception as e:
msg = ["Pre-requisite check warning: " + str(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) 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