Installing Python on Onion Omega

On December 5th, we had a Hackathon in Basel. It was quite a unique experience. We were one of the first to try out the all-new Onion Omega.

IMG_20151205_113822

Here’s how to install Python on it!

I assume you already did the basic setup. Just login with Chrome and use the Terminal, or better, use ssh (ssh root@onion-XXXX.local).

The Onion Omega comes with only a few megs available on / — We need to expand this to get comfortable. If you don’t want, jump to the next section . You might get stuck pretty fast.

Using USB Storage as the root device.

12351200_1185504674812829_1732641896_n

Onion Omega has a special partition, /overlay, that contains the diff from the ROM. To change it form internal storage to USB Storage, follow these steps:

  1. Update the packages: opkg update
  2. Plug a USB Storage Device (I use a 16GB Stick we won at GDG Basel Hackhaton)
  3. Install e2fsprogs: opkg install e2fsprogs
  4. Format the device as a ext4: mkfs.ext4 /dev/sda1 (change sda1 for your device)
  5. Mount the device: mount /dev/sda1 /mnt
  6. Copy content from /overlay to USB: rsync -avv /overlay /mnt. You will get errors, I’m unsure how to fix them yet, you might need to reconfigure a few things later. No big deal. Please comment if you know a better way!
  7. Create initial fstab: block detect > /etc/config/fstab
  8. Edit /etc/config/fstab, change target to ‘/overlay’ and enabled to ‘0’.
  9. Reboot
  10. Update the packages: opkg update

Source: Using USB Storage as Rootfs

Install Python

Because we now have a lot of space available, we can use the full python! Note: replace ‘python’ (2.7) with ‘python3’ if needed.

  1. Update the packages: opkg update
  2. Install python: opkg install python
  3. Install setuptools: opkg install python-setuptools
  4. Install CA Certificates (or you will get a SSL_VERIFY_FAILED error): opkg install ca-certificates

Done!

Now you’re good to go!

Original Article: Killa Bees – Onion Omega Wiki

3 thoughts on “Installing Python on Onion Omega

  1. Great – Thanks..

    I had to alter the procedure slightly though. Line 8 on the USB, change enable to a ‘1’ to enable it..!
    8.Edit /etc/config/fstab, change target to ‘/overlay’ and enabled to ‘1’.

    After the USB install, you will loose the wireless settings, so take a copy of /etc/config/wireless and reinstate it after. Copy it to the USB and put it back after it has booted.

    Quick check to see that the USB remains present after the reboot with
    df -k

    dev/sda should have lots of free memory…

    Reboot again after the wireless settings are back and install your python.

    Liked by 1 person

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