Chapter 27. Managing the Package Repository

A source distribution of eCos consists of a number of packages, such as the kernel, the C library, and the µITRON subsystems. These are individually versioned in the tree structure of the source code, to support distribution on a per-package basis and to support third party packages whose versioning systems might be different. A command-line tool, ecosadmin.tcl is used is used to manage the installation and removal of packages from a variety of sources with potentially multiple versions. A graphical user interface is also provided to this tool through a dialog box from the eCos Configuration Tool as illustrated Figure 27-1.

The presence of the version information in the source tree structure might be a hindrance to the use of a separate source control system such as CVS or SourceSafe. To work in this way, you can rename all the version components to some common name (such as “current”) thus unifying the structure of source trees from distinct eCos releases.

The eCos build system will treat any such name as just another version of the package(s), and support building in exactly the same way. However, performing this rename invalidates any existing build trees that referred to the versioned source tree, so do the rename first, before any other work, and do a complete rebuild afterwards. If you do have an existing configuration you wish to move over to a new structure, you are advised to use the process described in the Section called Switching Targets, Repositories and Versions in Chapter 15.

Package Installation

Package installation and removal is performed using the eCos command line tool ecosadmin.tcl, also known as the eCos Package Administration Tool, or through the eCos Configuration Tool. The latter provides a GUI interface to the former. This tool is a Tcl script which allows the user to add new eCos packages and new versions of existing packages to an eCos repository. Such packages must be distributed as a single file in the eCos package distribution format. By convention, eCos package distribution files are given the .epk suffix. Unwanted packages may also be removed from the repository using this tool.

Using the Package Administration Tool

The graphical interface accesses all the functionality of the command-line tool and may be accessed from the menu option Tools->Administration. You will first be prompted to save your existing configuration before the dialog in Figure 27-1 is displayed.

Figure 27-1. Package Administration

The dialog displays the packages which are currently installed in the form of a tree. The installed versions of each package may be examined by expanding the tree.

Packages within a package distribution file (traditionally with a .epk suffix) may be added to the eCos repository, or if using multiple repositories the top-most repository, by clicking on the Add button. You will be prompted to provide the location and filename of the package distribution file via a File Open dialog box.

Packages may be removed by selecting a package in the tree and then clicking on the Remove button. If a package node is selected, all versions of the selected package will be removed. If a package version node is selected, only the selected version of the package will be removed.

Using the command line

The ecosadmin.tcl script is located in the base of the eCos repository. Use a command of the following form:

$ tclsh ecosadmin.tcl <command>

The following commands are available:

add <file>

Adds the packages contained with the specified package distribution file to the eCos repository and updates the package database accordingly.

remove <package> [ --version=<version> ]

Removes the specified package from the eCos repository and updates the package database accordingly. Where the optional version qualifier is used, only the specified version of the package is removed.


Produces a list of the packages which are currently installed and their versions. The available templates and hardware targets are also listed.

merge <package directory>

Merges all the packages within <package directory> into the current repository (defined by the environment variable ECOS_REPOSITORY).

Note that is is possible to remove critical packages such as the common HAL package using this tool. Users should take care to avoid such errors since core eCos packages may only be re-installed in the context of a complete re-installation of eCos.

Documentation license for this page: Open Publication License