Commit fa7e8123 by devttys0

Binwalk start script no longer necessary when binwalk is installed to a custom prefix directory.

parent 01efa841
......@@ -45,7 +45,6 @@ dependencies are available from most Linux package managers:
python-qt4-gl
python-numpy
python-scipy
pyqtgraph-0.9.8 [http://www.pyqtgraph.org/downloads/pyqtgraph-0.9.8.tar.gz]
mtd-utils
zlib1g-dev
liblzma-dev
......
......@@ -29,17 +29,8 @@ install: build
build:
if [ "$(BUILD_C_LIBS)" -eq "1" ]; then make -C $(SRC_C_DIR); fi
echo "$(prefix)" > src/binwalk/config/prefix.conf
$(PYTHON) ./setup.py build
start-script:
echo '#\!/bin/sh' > $@
echo "PREFIX=\"$(prefix)\"" >> $@
echo 'PYVERSION=`python --version 2>&1 | cut -d" " -f2 | cut -d"." -f1,2`' >> $@
echo 'export PYTHONPATH="$$PREFIX/lib/python$$PYVERSION/site-packages"' >> $@
echo '$$PREFIX/bin/binwalk "$$@"' >> $@
chmod +x $@
deps:
./deps.sh
......@@ -49,7 +40,7 @@ clean:
distclean: clean
if [ "$(BUILD_C_LIBS)" -eq "1" ]; then make -C $(SRC_C_DIR) distclean; fi
rm -rf Makefile config.* *.cache start-script
rm -rf Makefile config.* *.cache
uninstall:
$(PYTHON) ./setup.py uninstall --pydir=`find $(prefix)/lib -name binwalk | head -1` --pybin=`find $(prefix)/bin -name binwalk | head -1`
......
#!/usr/bin/env python
import sys
import binwalk
from threading import Thread
try:
import binwalk
except ImportError:
# If installed to a custom prefix directory, binwalk may not be in
# the default module search path(s). Try to resolve the prefix module
# path and add it to sys.path.
import os
module_path = os.path.join(os.path.dirname(os.path.dirname(__file__)),
"lib",
"python%d.%d" % (sys.version_info[0], sys.version_info[1]),
"site-packages")
sys.path.append(module_path)
import binwalk
from binwalk.core.compat import user_input
def display_status(m):
......
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