Compiling & Installing Python 2.7 on the Netgear ReadyNAS Duo2

I wanted to get some automation working on my NAS at home, and I needed to install Python. Being an ARM-powered model, it was traditionally hard to get compatible binaries from sources like APT, so I’d previously used the add-on found at ReadyNASExtras. This time, I ran into issues with some dependencies. I couldn’t install and compile all of the Python modules that I needed, so I was required to compile Python from source.

readynas_pythonMy original goal: write a Python script to transform a gnarly HTML listing of available downloads into a nice clean RSS feed for FlexGet to consume.

FlexGet is an awesome tool that can be used to automate the downloading of files. It’s great, as it tracks which URLs it has seen before, and won’t download the same file twice. There are also lots of other plugins. It is often used for nefarious purposes, to download torrents from an XML feed and pass the torrent file on to a BitTorrent client.

My first-ever Python script turned out great. I used a combination of the following Python modules:

  • Requests – to scrape the HTML
  • BeautifulSoup – to parse the HTML, and make it easy to pull out the data I was after
  • Feedgen – to build a compliant XML RSS Podcast feed file

I won’t post the code, as the site I’m scraping is a private subscription site that I’ve paid for access to, so most of the code isn’t really relevant for re-use. I may write another blog post in the near future that re-uses this concept against a publicly-accessible site.

Here’s my braindump of how I compiled and installed Python on my ReadyNAS, along with some extra bits and pieces.

  1. Enable SSH by installing this ReadyNAS add-on(http://www.downloads.netgear.com/files/ReadyNAS/ADDON/4.2(X86)/EnableRootSSH_1.0-arm.bin)
  2. Use Putty or similar to SSH into the NAS
  3. apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev libdb-dev
  4. wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
  5. tar zxvf Python-2.7.10.tgz
  6. cd Python-2.7.10
  7. ./configure –prefix=/usr –enable-shared –build=sparc-linux
  8. make
  9. make install
  10. wget https://bootstrap.pypa.io/get-pip.py –no-check-certificate
  11. wget http://peak.telecommunity.com/dist/ez_setup.py
  12. python ez_setup.py

    The remainder of the below steps aren’t required unless you want to use the additional modules:

  13. easy_install requests
  14. easy_install beautifulsoup4
  15. apt-get install libxml2-dev
  16. apt-get install libxslt-dev
  17. easy_install lxml
  18. easy_install feedgen
  19. easy_install functools32
  20. easy_install flexget
    (This broke easy_install. I had to re-run #11 to get it working again)
  21. apt-get autoremove

5 thoughts on “Compiling & Installing Python 2.7 on the Netgear ReadyNAS Duo2

  1. Thank you for sharing this.
    I tried on my Readynas v2 Duo, I can’t pass the step 9 (make install) because of error messages:

    [Errno 28] No space left on device

    I checked but I have enough space on my disk.
    Do you have an idea about this ?

    Like

  2. Debian Squeeze is end of life.
    To continue to use unsupported packages you’ll need to point apt-get to a different repository.
    Edit /etc/apt/sources.list, comment out all the lines with a preceding # and add the following line:
    deb http://archive.debian.org/debian/ squeeze contrib main non-free
    This will allow you access to the last released version of Squeeze from the Debian archive site.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s