Commit d5eb11e0 by devttys0

Fixed easy_install.sh bugs in debian

parent 013f160b
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
^zip archive data:zip:jar xf '%e' # jar does a better job of unzipping than unzip does... ^zip archive data:zip:jar xf '%e' # jar does a better job of unzipping than unzip does...
^posix tar archive:tar:tar xvf '%e' ^posix tar archive:tar:tar xvf '%e'
^rar archive data:rar:unrar e '%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' ^arj archive data.*comment header:arj:arj e '%e'
^iso 9660:iso:7z x '%e' -oiso-root ^iso 9660:iso:7z x '%e' -oiso-root
......
#!/bin/bash #!/bin/bash
# Easy installer script for Debian/RedHat/OSX systems. # Easy installer script for Debian/RedHat/OSX systems.
SUDO=$(which sudo)
function libmagic function libmagic
{ {
SITE="ftp://ftp.astron.com/pub/file/" SITE="ftp://ftp.astron.com/pub/file/"
...@@ -23,8 +25,8 @@ function libmagic ...@@ -23,8 +25,8 @@ function libmagic
then then
echo "Installing libmagic / python-magic..." echo "Installing libmagic / python-magic..."
tar -zxvf "$OUTFILE" tar -zxvf "$OUTFILE"
cd "file-$VERSION" && ./configure && make && sudo make install && cd python && sudo python ./setup.py install && cd ../.. cd "file-$VERSION" && ./configure && make && $SUDO make install && cd python && $SUDO python ./setup.py install && cd ../..
sudo rm -rf "file-$VERSION" "$OUTFILE" $SUDO rm -rf "file-$VERSION" "$OUTFILE"
else else
echo "ERROR: Failed to download '$URL'!" echo "ERROR: Failed to download '$URL'!"
echo "libmagic not installed." echo "libmagic not installed."
...@@ -34,28 +36,28 @@ function libmagic ...@@ -34,28 +36,28 @@ function libmagic
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
sudo apt-get -y install unrar-nonfree $SUDO apt-get -y install unrar
if [ "$?" != "0" ] if [ "$?" != "0" ]
then then
echo "WARNING: Failed to install 'unrar-nonfree' package, trying 'unrar' instead..." echo "WARNING: Failed to install 'unrar' package, trying 'unrar-free' instead..."
sudo apt-get -y install unrar $SUDO apt-get -y install unrar-free
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 python-matplotlib
} }
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 python-matplotlib
} }
function darwin function darwin
{ {
if [ "$(which easy_install)" == "" ] if [ "$(which easy_install)" == "" ]
then 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 fi
if [ "$(which easy_install)" != "" ] if [ "$(which easy_install)" != "" ]
...@@ -134,32 +136,32 @@ fi ...@@ -134,32 +136,32 @@ fi
if [ "$DISTRO" != "darwin" ] if [ "$DISTRO" != "darwin" ]
then then
# Get and build the firmware mod kit # Get and build the firmware mod kit
sudo rm -rf /opt/firmware-mod-kit/ $SUDO rm -rf /opt/firmware-mod-kit/
sudo mkdir -p /opt/firmware-mod-kit $SUDO mkdir -p /opt/firmware-mod-kit
sudo chmod a+rwx /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/ git clone https://code.google.com/p/firmware-mod-kit /opt/firmware-mod-kit/
cd /opt/firmware-mod-kit/src cd /opt/firmware-mod-kit/src
./configure && sudo make ./configure && $SUDO make
if [ "$1" == "--sumount" ] || [ "$2" == "--sumount" ] if [ "$1" == "--sumount" ] || [ "$2" == "--sumount" ]
then then
# The following will allow you - and others - to mount/unmount file systems without root permissions. # 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. # This may be problematic, especially on a multi-user system, so think about it first.
sudo chown root ./mountcp/mountsu $SUDO chown root ./mountcp/mountsu
sudo chmod u+s ./mountcp/mountsu $SUDO chmod u+s ./mountcp/mountsu
sudo chmod o-w ./mountcp/mountsu $SUDO chmod o-w ./mountcp/mountsu
sudo chown root ./mountcp/umountsu $SUDO chown root ./mountcp/umountsu
sudo chmod u+s ./mountcp/umountsu $SUDO chmod u+s ./mountcp/umountsu
sudo chmod o-w ./mountcp/umountsu $SUDO chmod o-w ./mountcp/umountsu
sudo chown root ./jffs2/sunjffs2 $SUDO chown root ./jffs2/sunjffs2
sudo chmod u+s ./jffs2/sunjffs2 $SUDO chmod u+s ./jffs2/sunjffs2
sudo chmod o-w ./jffs2/sunjffs2 $SUDO chmod o-w ./jffs2/sunjffs2
fi fi
cd - cd -
fi fi
# Install binwalk # 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