The Linux on the pc104

From Wiki for RobotCub and Friends

Jump to: navigation, search

Contents


This page is about the Debian Linux that runs on the pc104, a Live Debian customization (see http://debian-live.alioth.debian.org).

From time to time images are updated. To determine what version of the image you are running you can have a look at the following files in the root of the filesystem:

  • VERSION: contains the version of the image
  • ChangeLog: list changes to the image

Organization

The Linux on the pc104 is a Debian etch with kernel 2.6.24 (etchnhalf).

In the "open call" configuration it is built as follows:

  • static ip 10.0.0.2
  • users: icub and root

During boot a script mounts the directory from 10.0.0.1:/exports/code-pc104 to /usr/local/src/robot. This directory contains other files used to finish the initialization, plus the code repositories.

 /usr/local/src/robot/yarp2: yarp repository 
 /usr/local/src/robot/iCub: iCub repository

Notice that there is also a "dhcp" enabled version of the Linux (see below). This allows people to use the pc104 on their network infrastructure.

Environment

The environment of the user icub is configured as indicated in Section 6.1 (see ~/.bashrc). In addition since version 1.4 the following environment variables have been added:

  ESDCANAPI_DIR=/usr/local/src/robot/drivers/esdCanApi
  PLXCANAPI_DIR=/usr/local/src/robot/drivers/plxCanApi
  CWF2CANAPI_DIR=/usr/local/src/robot/drivers/cfw002
  

These directories are used by cmake to localize the APIs required to compile some of the modules that run on the pc104 (can bus devices). See Section 6.6 for details.

Update the usb key on your pc104

Download

First you need to download the new image. We provide the standard images that come with the robot here: http://eris.liralab.it/iCub/downloads/pc104-images/

There are different versions of the image.

The name format is: image.x.y-build.img

Where x.y identify the version of the live. Latest versions are:

  • 1.3 Last version configured for CVS.
  • 1.4 Configured for SVN, cmake 2.4.
  • 1.5 Configured for SVN, cmake 2.6.4.

The "build" keyword affects minor differences in the network configuration:

  • oc: "open call" standard installation (static ip 10.0.0.2, it mounts software from 10.0.0.1).
  • dhcp: dhcp-enabled network configuration. If you want to connect the robot on your own network you should be able to use this image. The live will use dhcp. If you configure your dhcp server appropriately you should be able to make this work (click here to see how: live-with-dhcp).

Burn a new image

This can be probably done in different ways. We provide instructions for Linux.

First you need to identify the device node that corresponds to your usb key. There are a couple of options:

Procedure 1. Type:

ls -la /dev/disk/by-id/usb-*

you will get something like:

lrwxrwxrwx 1 root root  9 2007-08-11 12:46 
  /dev/disk/by-i/usb-Kingston_DataTraveler_II+_5B720CB323C1->../../sdc

here /dev/sdc is the device node of your usb key.

Procedure 2. Alternatively you can try unplugging and plugging in the usb key and see what happens in /dev/sd*.

Important: make sure you identify the device correctly, otherwise you risk to wipe the content of your hard drive. To be sure you can try procedure 1 and 2 (above) a couple of time.

Now you can burn the new image by typing as root:

 dd if=IMAGE_FILE of=DEVICE_NODE

where IMAGE_FILE is the name of the new image (e.g. image.1.4-OC.img) and DEVICE_NODE is, for example, /dev/sdc.

Important:

  • make sure that you overwrite the whole device, not just the first partition of it that you normally mount, i.e. /dev/sdx instead of the more familiar /dev/sdx1.
  • Don't forget to unmount the usb key before unplugging it.

More instructions are available here: http://wiki.debian.org/DebianLive/Howto/USB

Testing the new image

Plug the usb key in the usb port of the pc104, and turn it on. Wait some time (2 minutes or so) and connect to the pc104 with ssh:

 ssh pc104

Before you do this, you need to fix or remove the known_hosts file:

 rm /home/icub/.ssh/known_hosts

Startup scripts update

Besides the usual initialization sequence the pc104 loads and executes a list of scripts that are in $ICUB_ROOT/../pc104/hooks.

A copy of those scripts in also in the repository, you can update them from $ICUB_ROOT/pc104/startupscripts/opencall/hooks:

  • cd $ICUB_ROOT
  • svn update
  • copy ./pc104/startupscripts/opencall/hooks/* ../pc104/hooks -r
  • Customize S08_robotname.sh according to your setup.

Further customization

Unfortunately the current iCub Live is not writable. This means that all changes are lost when you reboot the pc104. Making a writable partition is possible, but it proved to be harder than expected. We are working on this. In the meanwhile there are a couple of options.

  • If you need to perform some operations at startup you can add or modify scripts in the $ICUB_ROOT/../pc104/hooks directory. This directory is mounted from the remote server and is persistent. Scripts from the "hooks" directory are executed in alphabetical order from /etc/rc.local as root.
  • You can rebuild your own version of the image (we can provide the configuration files/options if you like).
Personal tools