Where should we store programs on the Onion? Can we make users?



  • Just got my onion in the mail and did a few simple GPIO python programs to test things out. I noticed that / (and /root) are mounted as r/o, and the only thing with enough space to actually use is /tmp, which doesn't seem to be persisted across reboots. I've been mounting usb devices to /tmp/sda1 instead of /mnt because /mnt is in a r/o partition as well.

    What was the intention here? I would love to actually make a user and not log in as root all the time, but the common ways of making users (adduser, useradd) don't seem to be available. Its great that there is a nodejs package now, but I can't install it because I don't have enough space in the partition that it installs to.



  • I've been storing programs in /root. It's not read-only (at least not on mine).



  • @Anthony-Naddeo I agree with @Brian-Piersel. On my system / and /root are not read only:

    Doing:

    • cd /
      ls -l
      Clearly shows /root as drwxr-xr-x - i.e. full access as root - the only user that you can use on the Omega (see belwo)

    • mount
      Shows rootfs on / type rootfs (rw) - i.e. / is mounted for read and write

    So, unless there is something wrong/odd with you Omega, you can just use /root for your own files
    However, before doing so, I would urge that you ensure that your Omega is upgraded to the latest firmware using the command oupgrade - earlier versions of the firmware would cause the contents of /root to be lost over an oupgrade

    Regarding adding other users: The Omega runs a very much cut down version of Linux - OpenWrt - originally intended for embedded systems such as routers and the like. As such, it does not have the capabilities for adding additional users. Everything has to be run as root

    Finally, regarding available space: if you are concerned about insufficient space on your Omega, you can increase space using a USB drive and following the instructions described here: https://wiki.onion.io/Tutorials/Using-USB-Storage-as-Rootfs
    I have done this using a 32GB USB thumb drive and it works well. This will add effective disk space up to the size of your USB drive.
    If you need more usable RAM space, you can even set up your Omega with a swap drive using information described in: https://community.onion.io/topic/9/how-to-install-gcc/47
    I am currently doing this to provide 1GBytes of swap space


  • administrators

    @Anthony-Naddeo
    yep, the two posts above are correct, / and /root should definitely not be read-only. As @Kit-Bishop mentioned, try running oupgrade to get the latest firmware.

    If the problem still persists, try doing a factory reset by holding down the Reset button for 10 seconds and releasing.

    Let us know how it goes.



  • Thanks for the help guys. I don't know what the issue was, or why they were read only, but running oupgrade (actually oupgrade -f) and rebooting fixed the issue. I was able to use that wiki that Kit linked to set up the USB storage as well.



  • I can confirm that adding a USB drive (16GB in my case) according to the instructions in

    https://wiki.onion.io/Tutorials/Using-USB-Storage-as-Rootfs

    worked very well. I have written a few simple Python scripts and stored them in /root, and have also installed Ruby and tested a very simple "Hello, World" program. I'm generally very happy with the Onion, but would be even happier to have the Onion's schematic so I can design circuits to take full advantage of the GPIO interface!


  • administrators

    @Jeff-Verive We're working on open sourcing the schematics!

    Hopefully the GPIO pinouts and diagrams will help in your hardware design: https://wiki.onion.io/Hardware/Omega-Hardware#the-hardware_gpios

    Let us know how it goes!



  • FYI, on the latest firmware, I just did it manually.

    mkdir /home

    edit /etc/passwd and add the user with 'x' in the passwd portion, /home/{username} for the home directory. You can either use groupid 100 (users, already in /etc/group) or add a group specifically for the user. (e.g. add user with id starting at 1000, add a group matching the username with the same id - probably a good idea to add the user to users also in the /etc/group)

    Once the username is in /etc/passwd run:

    passwd {username}
    to set the passwd

    mkdir /home/{username}

    to create whatever you specified as the home directory, then

    chown {username}.{groupname} /home/{username}

    replacing the stuff in {} obviously with your values.
    At that point, log out, log back in with the user in question. e.g. ssh myuser@myonion.local or whatever your ip is



Looks like your connection to Onion Community was lost, please wait while we try to reconnect.