You were never here, you didn't see anything..

Gentoo and Arduino


I like most people in to tech have a few arduino boards lying around. They are fun to play with and can on occasion be used to do some really useful and/or creative stuff. I recently reinstalled Gentoo on my desktop to move the system to encrypted drives, so of course setting up the arduino IDE was a task to be completed.

These are my notes:

  1. Install layman. This is required for the local build tools and such:
    emerge -aq layman
  2. Step 2) Edit “/etc/portage/make.conf” to use layman accordingly by adding:
    source /var/lib/layman/make.conf
        PORTDIR_OVERLAY="/usr/local/portage $PORTDIR_OVERLAY"
  3. Step 3) Install arduino:
    emerge -aq arduino
  4. Step 4) Build the tool chain. This hit a glitch due to a bug related to the “sanitize” use flag. The command below sets an ENV variable to override this:
    USE="-sanitize" crossdev -t avr
    Assuing the bug is fixed it should work with just:
    crossdev -t avr
  5. Link to the linker scripts. NOTE: the 2.25 is dependant on the actual version present in “/usr/lib/binutils/avr”
    ln -s /usr/lib/binutils/avr/2.25/ldscripts /usr/avr/lib/ldscripts
  6. The java rxtx wants to create a lock file in “/var/lock”. This is a symlink to “/run/lock”. On my system it was owned by root:root, and of course we don’t want to add users to the group “root” just to use serial ports. Also the permissions on “/run/lock” were set to 755 which would not allow a group member to write to it. Change the group and set the required permissions:
    chown -R root:lock /run/lock
        chown -R root:lock /var/lock
        chmod -R 775 /run/lock
  7. Add the user to the needed groups. The -aG works out to -a = append to supplementary groups and -G list of groups separated by commas:
    usermod -aG uucp,lock andarius

At this point I could fire up the arduino IDE, compile a sketch (horrible name…) and upload it to my OSEPP Pro.

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This blog is kept spam free by WP-SpamFree.

Most who fail…

Most who fail have yet to really try!