Commit d5eb11e0 by devttys0

Fixed easy_install.sh bugs in debian

parent 013f160b
......@@ -14,6 +14,7 @@
^zip archive data:zip:jar xf '%e' # jar does a better job of unzipping than unzip does...
^posix tar archive:tar:tar xvf '%e'
^rar archive data:rar:unrar e '%e'
^rar archive data:rar:unrar -x '%e' # This is for the 'free' version
^arj archive data.*comment header:arj:arj e '%e'
^iso 9660:iso:7z x '%e' -oiso-root
......
#!/bin/bash
# Easy installer script for Debian/RedHat/OSX systems.
SUDO=$(which sudo)
function libmagic
{
SITE="ftp://ftp.astron.com/pub/file/"
......@@ -23,8 +25,8 @@ function libmagic
then
echo "Installing libmagic / python-magic..."
tar -zxvf "$OUTFILE"
cd "file-$VERSION" && ./configure && make && sudo make install && cd python && sudo python ./setup.py install && cd ../..
sudo rm -rf "file-$VERSION" "$OUTFILE"
cd "file-$VERSION" && ./configure && make && $SUDO make install && cd python && $SUDO python ./setup.py install && cd ../..
$SUDO rm -rf "file-$VERSION" "$OUTFILE"
else
echo "ERROR: Failed to download '$URL'!"
echo "libmagic not installed."
......@@ -34,28 +36,28 @@ function libmagic
function debian
{
# The appropriate unrar package goes under different names in Debian vs Ubuntu
sudo apt-get -y install unrar-nonfree
$SUDO apt-get -y install unrar
if [ "$?" != "0" ]
then
echo "WARNING: Failed to install 'unrar-nonfree' package, trying 'unrar' instead..."
sudo apt-get -y install unrar
echo "WARNING: Failed to install 'unrar' package, trying 'unrar-free' instead..."
$SUDO apt-get -y install unrar-free
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 python-matplotlib
}
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
$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
curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | $SUDO python
fi
if [ "$(which easy_install)" != "" ]
......@@ -134,32 +136,32 @@ fi
if [ "$DISTRO" != "darwin" ]
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
$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
./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
sudo chmod u+s ./mountcp/mountsu
sudo chmod o-w ./mountcp/mountsu
$SUDO chown root ./mountcp/mountsu
$SUDO chmod u+s ./mountcp/mountsu
$SUDO chmod o-w ./mountcp/mountsu
sudo chown root ./mountcp/umountsu
sudo chmod u+s ./mountcp/umountsu
sudo chmod o-w ./mountcp/umountsu
$SUDO chown root ./mountcp/umountsu
$SUDO chmod u+s ./mountcp/umountsu
$SUDO chmod o-w ./mountcp/umountsu
sudo chown root ./jffs2/sunjffs2
sudo chmod u+s ./jffs2/sunjffs2
sudo chmod o-w ./jffs2/sunjffs2
$SUDO chown root ./jffs2/sunjffs2
$SUDO chmod u+s ./jffs2/sunjffs2
$SUDO chmod o-w ./jffs2/sunjffs2
fi
cd -
fi
# Install binwalk
sudo python setup.py install
$SUDO python setup.py install
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