How to install binwalk on Slackware (updated)

Update-even-more: Binwalk has just moved to GitHub.

Update: Second half of this tutorial refers to the binwalk version 1.2.1 only. It appears that with 1.2.2 release, problem with has been resolved. Diff here.

Firstly, a few dependencies.

There is a package “file” in Slackware but it doesn’t have it’s Python bindings installed. You need to download appropriate source file from here: Choose version that you have in your system. In my case it is 5.14.

At this point you should run something like this without getting an exception:

Next, you may want to get matplotlib working. This is not required to and if you don’t want it you can fall back to regular binwalk install procedure (docs/README in binwalk sources) and quit reading this text. From now on, I assume you want to have fancy plotting option in your binwalk.

There is a bunch of packages to install. My preferred way to do this is by getting them from SlackBuilds. You can also use sbopkg tool, to speed up whole process. Install following packages in order: pysetuptools, six, python_dateutil, pytz, numpy and matplotlib.

Before we proceed there is a test to perform. Switch to non-root user and type:

If you don’t get anything more serious than some fontconfig warnings, It’s OK to proceed.

Get binwalk: In my case current version is 1.2.1. Then, type:

Now it’s tricky part. You want to have your binwalk installed globally since this is how setup script works, but installer (matplotlib.pyplot, actually) needs X server and you don’t have it in root’s python session. Because you verified that matplotlib.pyplot works on non-root user, where one usually runs software from, you can make little ugly hack to binwalk’s file. Let’s change the way how installer checks if matplotlib is present. This is a diff of original and modified file in patch format:

By changing method of plotting (to textual) you bypass the need for X server and installation runs smoothly. And app should work great too.

This is it, enjoy your binwalk:)

You may get a warning each time you run binwalk:

If so, update signatures (as root):

P.S. 2
Be sure to check for recommendations for other handy tools.

P.S. 3 (new)
Version 1.2.2 installs flawlessly.

05. August 2013 by resset
Categories: Software | Tags: , , | Leave a comment

Leave a Reply

Required fields are marked *