title: TinyOS Packages
linktitle: tinyospkgs
parent: aptrepo
ctime: 2009-12-10

Repositories: [tinyos](/gitweb/?p=tinyos-2.x.git;a=summary),
[deputy-tinyos](/gitweb/?p=deputy-tinyos.git;a=summary),
[nesc](/gitweb/?p=nesc.git;a=summary),
[[aptrepo]].

# Package versioning

The TinyOS packages are built from the TMI
[TinyOS repository](/gitweb/?p=tinyos-2.x.git;a=summary).  The
package version number is of the form `tosver-tmiver`, where `tosver` is the
official TinyOS release version on which the code is based, and `tmiver` is the
version of the modifications applied by TMI.  Released APT package versions are
associated with tags in the source code repository.  Consider the latest
package version, 2.1.0-3, for which these tags exist in the repository:

* `debian/2.1.0-3-2tmi` is the tag of the 'debianized' code from which the APT
  packages version 2.1.0-3-2tmi were built.

* `release/2.1.0-3` is the tag of the TinyOS code of which
  `debian/2.1.0-3-2tmi` is a superset, the latter containing the debian
  packaging files.

* `tinyos/2.1.0` is the official upstream release on which `release/2.1.0-3` is
  based, the difference being the TMI enhancements.

* `patchset/2.1.0-3` is the head of a string of commits from the
  `tinyos/2.1.0` tag that represent a clean patch series that applies the
  TMI enhancements to the official upstream release.

# Multiple source trees

Often it is impractical to maintain an older application by porting it forward
to the latest TinyOS version.  The TMI approach allows multiple TinyOS trees
to be installed simultaneously, thereby allowing different applications to be
compiled against different TinyOS versions.

The official TinyOS installs the source tree at `/opt/tinyos-2.x`.  The TMI
version installs source trees at `/opt/tinyos/VER`.  For example, the latest
TMI tree is installed at `/opt/tinyos/2.1.0-3`.  TMI also maintains in its
repository the last few official source trees.  At least one must be installed,
and the developer may install others as needed.  When installing or upgrading
TMI TinyOS packages via APT, the latest TMI tree package is automatically
installed.  Source the script `/opt/tinyos/tinyos.sh` to set the three you wish
to use.  Source this script from your login profile with no argument to ensure
that your tree selection is persistent across logins.

This is the currently available trees as of this writing.  You can use the
command shown below to at any time view the available source trees.

    $ sudo apt-cache search tinyos-source
    tinyos-source - TinyOS source meta package
    tinyos-source-2.0.1 - TinyOS source code tree
    tinyos-source-2.0.2.2 - TinyOS source code tree
    tinyos-source-2.1.0 - TinyOS source code tree
    tinyos-source-2.1.0-3 - TinyOS source code tree

# Installing TinyOS

To install TinyOS, perform the steps shown for the [[aptrepo]], then type:

    sudo apt-get install tinyos

By default, the latest TinyOS source tree, with TMI enhancements, and the TMI
[[msp430]] toolchain are installed.  At this point, additional tinyos source
trees may be installed as required.  For example:

    sudo apt-get install tinyos-source-2.1.0
