(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Ubuntu for Intel Atoms

Description: Part one of a three part tutorial illustrating how to install, maintain and deploy a stripped down ubuntu (lucid) on pen drives for intel atoms using an i686 intel build platform.

Tutorial Level: INTERMEDIATE

Next Tutorial: Ubuntu in a Chroot

Installation

Preparations

  • Download the alternative installer iso for i386.

  • Use your ubuntu's desktop environment to create a usb pen drive using the alternative installer iso.
  • A 2+GB pen drive to install onto (minimal is only 600MB, but 2GB should cover anything we wish to add).

Installing

  • Plug in alternative installer pen drive and empty pen drive into the board.
  • Start the board, use bios to make sure it boots from the installer pen drive.
  • Once you get past the language selection at the main menu screen, hit F4 and choose command line install.
  • Partitioning
    • First partition is root partition, primary, bootable flag, noatime option and has label 'ros'.
    • Second partition is swap, primary and has size approximately 256M.
  • Create a user, 'ros' with whater password you wish (using 'willow' for this tutorial).

Partitioning is actually not terribly important - we'll actually change the way we partition later, this is just so we can get a bootable pen drive up and running. You should now be able to remove the alternative installer pen drive and reboot into your installed pen drive.

Modifications

Once booted, there are some modifications we'll need to make.

Fstab

Actually this is redundant as we'll create our own partitions later, just for the first test.

Key point being, since we can't rely on UUID's (the image will be installed to other pen drives with different uuid's later) edit /etc/fstab and change the drive locations for root and swap.

  • Convert any UUID's to the appropriate @/dev/sda#@ values or LABEL's.

# <file system> <mount point>   <type>  <options>       <dump>  <pass>

proc            /proc           proc    nodev,noexec,nosuid 0       0

# Root filesystem.
# /dev/sda1 /               ext4    noatime,errors=remount-ro 0       1
# Root filesystem with e2label (e.g. e2label /dev/sda1 ros)
LABEL=ros /               ext4    noatime,errors=remount-ro 0       1

# If using swap
# /dev/sda2 none            swap    sw              0       0
# Swap that has been labelled (e.g. mkswap -L ros_swap /dev/sda2)
# LABEL=ros_swap none            swap    sw              0       0

Grub

Grub2 has some issues in embedded robots, so we'll need some modifications there too.

  • Edit the configuration options in /etc/default/grub.

    • Turn off the timeout.
    • Turn off uuid's in grub.cfg (makes things difficult when creating pen drives).

#GRUB_HIDDEN_TIMEOUT=0
GRUB_CMDLINE_LINUX_DEFAULT="text"
GRUB_CMDLINE_LINUX=""

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
GRUB_DISABLE_LINUX_UUID=true
  • Make sure you replace any uuid's with something like either LABEL=ros or /dev/sda1 in /etc/fstab.

  • Fix the grub boot process so that it doesn't need a keyboard after an unclean shutdown
    • Edit /etc/grub.d/00_header and go to the bit about @recordfail@

set timeout=-1 -> set timeout=${GRUB_TIMEOUT}
  • Run the following command to update with the new configuration:

> sudo update-grub # this recreates /boot/grub/grub.cfg
  • Update is not real smart installing a remote grub (which we will do later), hack /boot/grub/grub.cfg, so you will probably need to :

    • Remove all 'search ...' lines
    • Change any root=(hd0,x) to the correct value.

    • Change any sd# to sda1.

> sudo grub-install /dev/sda # reinstalls to /dev/sda's mbr

Packages

Updating Repos

Just in case you need to change the mirror, you can edit by hand (probably an easier way to actually switch them all). You might also want to turn off sources. Don't strictly need anything nondefault yet, but its useful to have the partner repository flagged in addition to the defaults. Don't forget to update,

sudo nano /etc/apt/sources.list
sudo apt-get update

Added Packages

  • Administration

    • apache2 : web server
    • openssh-server : allows remote logins, file copies.
    • subversion : useful if we need to drop code in.
    • sysstat : supplements top, monitors cpu-usage across cores.
    • vim : command line editor.
    • wireless-tools : provides @iwconfig@ amongst other wireless utilities.
    • gdb : debugging utility.
    • valgrind : profiling utility.
    • unison : for remote syncing.
  • RoS

    • liblog4cxx10 : required by roslog.
    • python-yaml : required by roscore.
    • libboost-program-options1.40.0 : convenience library.
    • libboost-thread1.40.0 : required by roslib.
    • libboost-filesystem1.40.0 : required by rosout.
    • libboost-signals1.40.0 : required by rosout.
    • libboost-system1.40.0 : required by rosout.
    • libboost-regex1.40.0 : required by rosout
    • libboost-iostreams1.40.0 : required by ros somethin'.

You may also want to add the ros ubuntu packages to the base install. However, it's not a bad idea to compile them yourself and optimise them globally for the intel atom. You can then easily install and maintain an ros tree with Unison.

Other

Sudoers

You might want to give the normal user passwordless sudo, and may need to give the apache user sudo rights as well, to do this:

> sudo su -
> cd /etc
> chmod 644 sudoers
> vim sudoers
    # Uncomment to allow members of group sudo to not need a password
    # (Note that later entries override this, so you might need to move
    # it further down)
    %sudo ALL=(ALL) NOPASSWD: ALL
    ros ALL=(ALL) NOPASSWD: ALL
    www-data ALL=NOPASSWD: ALL
> chmod 440 sudoers

Make sure this is at the END of the file otherwise it may get overwritten.

What Now?

The basic platform is now configured and you can use this if you wish. However you will probably run into some inconveniences:

  • Pen drives don't last too long, particularly if you have ros logging at 500%.
  • Making changes is inconvenient - always have to do it on the robot.
    • Don't always have an internet connection on the robot.
  • It's useful to have a backup image of this process.
  • If you have more than one robot, easier to have one image that you can deploy.

There are also quite a few things you'll need to do to make it truly ros-ready and we'll need an internet connection for that. This is far easier in a chroot, so that will be the next tutorial - Ubuntu in a Chroot.

Wiki: eros/Tutorials/UbuntuOnAtoms (last edited 2010-12-29 09:26:17 by DanielStonier)