Using the NAOqi OS in a virtual machine

This section gives some hints about how to build third-party software for NAO.

Before starting, make sure the NAOqi OS virtual machine already setup and running. If it is not the case:

Tweaking the NAOqi OS virtual machine

Optimizing builds for Atom targets

As root, make the /etc/portage symlink point to:

  • /etc/portage.generic to build x86-generic binary. targets;
  • /etc/portage.atom to build optimized binaries for Atom targets;

To change, just run the following commands:

# Here, set optimizations for Atom (a.k.a. NAO V4):
su
rm -fi /etc/portage
ln -sfv /etc/portage.atom /etc/portage
exit

# do some developments...

# Then you can switch back to the generic settings:
su
rm -fi /etc/portage
ln -sfv /etc/portage.generic /etc/portage
exit

Building the third-party software

emerge usage

emerge is the package manager used by Gentoo, NAOqi OS.

As usual, do not hesitate to checkout the emerge documentation http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1#doc_chap3 or the its man page:

man emerge

This section gives the most often used emerge commands.

Warning

Never run:

emerge --sync

This will upgrade the whole system, all packages build after that may be not compatible with those from the NAOqi OS on the robot.

Searching a package

Searching in the package name (quick search):

emerge -s <some package>

Searching in the package description (a lot slower):

emerge -S <some package>

Building and installing a package

To build and install a package and all its dependencies, run (this requires root privileges):

su
emerge -ab <package name>
exit

After the building and installing some packagea in the virtual machine, the binary packages are locally stored in /home/nao/opennao-distro/packages.

The following command will show you all built packages:

tree ``/home/nao/opennao-distro/packages``

Package content

To check the content of an installed package:

equery files <package name>

To know which package a file belongs:

portageq owners / <full path of the file>