Unverified Commit 772f271f by Peter Eacmen Committed by GitHub

Merge pull request #531 from ReFirmLabs/530-fix-sasquatch-in-binwalk-docker-container

530 fix sasquatch in binwalk docker container
parents 80a519b6 c84bec17
...@@ -3,3 +3,4 @@ dist ...@@ -3,3 +3,4 @@ dist
.coverage .coverage
*.extracted *.extracted
*.pyc *.pyc
**/*.egg-info
\ No newline at end of file
...@@ -6,11 +6,13 @@ addons: ...@@ -6,11 +6,13 @@ addons:
apt: apt:
update: true update: true
install: install:
- export PYTHON=$(which python3)
- ./deps.sh --yes - ./deps.sh --yes
- pip install coverage - sudo -E $PYTHON -mpip install coverage
- ./setup.py install - sudo -E $PYTHON ./setup.py install
script: ./setup.py test script:
cache: pip - export PYTHON=$(which python3)
- sudo -E $PYTHON ./setup.py test
jobs: jobs:
include: include:
- stage: test - stage: test
......
...@@ -8,7 +8,9 @@ else ...@@ -8,7 +8,9 @@ else
YES=0 YES=0
fi fi
set -eu
set -o nounset set -o nounset
set -x
if ! which lsb_release > /dev/null if ! which lsb_release > /dev/null
then then
...@@ -60,35 +62,36 @@ fi ...@@ -60,35 +62,36 @@ fi
PYTHON3_APT_CANDIDATES="" PYTHON3_APT_CANDIDATES=""
PYTHON3_YUM_CANDIDATES="" PYTHON3_YUM_CANDIDATES=""
YUM_CANDIDATES="git gcc gcc-c++ make openssl-devel qtwebkit-devel qt-devel gzip bzip2 tar arj p7zip p7zip-plugins cabextract squashfs-tools zlib zlib-devel lzo lzo-devel xz xz-compat-libs xz-libs xz-devel xz-lzma-compat python-backports-lzma lzip pyliblzma perl-Compress-Raw-Lzma lzop srecord" YUM_CANDIDATES="git gcc gcc-c++ make openssl-devel qtwebkit-devel qt-devel gzip bzip2 tar arj p7zip p7zip-plugins cabextract squashfs-tools zlib zlib-devel lzo lzo-devel xz xz-compat-libs xz-libs xz-devel xz-lzma-compat python-backports-lzma lzip pyliblzma perl-Compress-Raw-Lzma lzop srecord"
PIP_COMMANDS="pip3" PYTHON="$(which python3)"
# Check for root privileges # Check for root privileges
if [ $UID -eq 0 ] if [ $UID -eq 0 ]
then then
echo "UID is 0, sudo not required"
SUDO="" SUDO=""
else else
SUDO="sudo" SUDO="sudo -E"
REQUIRED_UTILS="sudo $REQUIRED_UTILS" REQUIRED_UTILS="sudo $REQUIRED_UTILS"
fi fi
function install_yaffshiv function install_yaffshiv
{ {
git clone https://github.com/devttys0/yaffshiv git clone --quiet --depth 1 --branch "master" https://github.com/devttys0/yaffshiv
(cd yaffshiv && $SUDO python3 setup.py install) (cd yaffshiv && $SUDO $PYTHON setup.py install)
$SUDO rm -rf yaffshiv $SUDO rm -rf yaffshiv
} }
function install_sasquatch function install_sasquatch
{ {
git clone https://github.com/devttys0/sasquatch git clone --quiet --depth 1 --branch "master" https://github.com/devttys0/sasquatch
(cd sasquatch && $SUDO ./build.sh) (cd sasquatch && $SUDO ./build.sh)
$SUDO rm -rf sasquatch $SUDO rm -rf sasquatch
} }
function install_jefferson function install_jefferson
{ {
git clone https://github.com/sviehb/jefferson git clone --quiet --depth 1 --branch "master" https://github.com/sviehb/jefferson
(cd jefferson && $SUDO pip3 install -r requirements.txt && $SUDO python3 setup.py install) (cd jefferson && $SUDO $PYTHON -mpip install -r requirements.txt && $SUDO $PYTHON setup.py install)
$SUDO rm -rf jefferson $SUDO rm -rf jefferson
} }
...@@ -110,7 +113,7 @@ function install_cramfstools ...@@ -110,7 +113,7 @@ function install_cramfstools
INSTALL_LOCATION=/usr/local/bin INSTALL_LOCATION=/usr/local/bin
# https://github.com/torvalds/linux/blob/master/fs/cramfs/README#L106 # https://github.com/torvalds/linux/blob/master/fs/cramfs/README#L106
git clone https://github.com/npitre/cramfs-tools git clone --quiet --depth 1 --branch "master" https://github.com/npitre/cramfs-tools
# There is no "make install" # There is no "make install"
(cd cramfs-tools \ (cd cramfs-tools \
&& make \ && make \
...@@ -123,19 +126,15 @@ function install_cramfstools ...@@ -123,19 +126,15 @@ function install_cramfstools
function install_ubireader function install_ubireader
{ {
git clone https://github.com/jrspruitt/ubi_reader git clone --quiet --depth 1 --branch "master" https://github.com/jrspruitt/ubi_reader
(cd ubi_reader && $SUDO python3 setup.py install) (cd ubi_reader && $SUDO $PYTHON setup.py install)
$SUDO rm -rf ubi_reader $SUDO rm -rf ubi_reader
} }
function install_pip_package function install_pip_package
{ {
PACKAGE="$1" PACKAGE="$1"
$SUDO $PYTHON -mpip install $PACKAGE
for PIP_COMMAND in $PIP_COMMANDS
do
$SUDO $PIP_COMMAND install $PACKAGE
done
} }
function find_path function find_path
...@@ -240,14 +239,6 @@ then ...@@ -240,14 +239,6 @@ then
exit 1 exit 1
fi fi
# Check to see if we should install modules for python3 as well
find_path python3
if [ $? -eq 0 ]
then
PKG_CANDIDATES="$PKG_CANDIDATES $PKG_PYTHON3_CANDIDATES"
PIP_COMMANDS="pip3 $PIP_COMMANDS"
fi
# Do the install(s) # Do the install(s)
cd /tmp cd /tmp
$SUDO $PKGCMD $PKGCMD_OPTS $PKG_CANDIDATES $SUDO $PKGCMD $PKGCMD_OPTS $PKG_CANDIDATES
......
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