Skip to content

Installing Python on Onion Omega

Francois Levaux-Tiffreau edited this page Dec 6, 2015 · 1 revision

So I lost the article I was writing… what a shame. Here's a lighter version.

Installing Python on Onion Omega

The Onion Omega comes with only a few megs available on / -- We need to expand this.

Using USB Storage as the root device.

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.
  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

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!