Chapter 8. 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 future distribution on a per-package basis and to support third party packages whose versioning systems might be different. Future tools will help manage the building of an application from a selection of different versions of different packages.

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 SourceSafeTM. 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 which referred to the versioned source tree, so do the rename first, before doing any other work, and do a complete rebuild afterwards.

Note: This chapter is only relevant to people interested in modifying eCos sources or using their own source control on eCos sources over multiple releases.

Package Structure

The files in an installed eCos source tree are organized in a natural tree structure, grouping together files which work together into Packages. For example, the kernel files are all together in:

BASE_DIR/kernel/v1_2/include/
BASE_DIR/kernel/v1_2/src/
BASE_DIR/kernel/v1_2/tests/

and µITRON compatibility layer files are in:

BASE_DIR/compat/uitron/v1_2/include/
BASE_DIR/compat/uitron/v1_2/src/
BASE_DIR/compat/uitron/v1_2/tests/

The feature of these names which is of interest here is the v1_2 near the end. If you start using eCos after the Version 1.2.1 release, you might see a different name here, e.g. v1_3 for version 1.3; if you received pre-release Beta versions you might have seen v0_2 or v0_3 for versions 0.2 and 0.3.

It may seem odd to place a version number deep in the path, rather than having something like BASE_DIR/v1_2/...everything...

or leaving it up to you to choose a different install-place when a new release of the system arrives.

There is a rationale for this organization: as indicated, the kernel and the µITRON compatibility subsystem are examples of software packages. For the first few releases of eCos, all the Cygnus packages will move along in step, i.e. Release 1.2.1 will feature Version 1.2.1 of every package, and so forth. But in future, especially when third party packages become available, it is intended that the package be the unit of software distribution, so it will be possible to build a system from a selection of packages with different version numbers, and even differing versioning schemes.

Cygnus will be developing tools to manage installation and use of packages in this way. The current underlying eCos build engine (pkgconf) already supports (but is not limited to) this version scheme: when choosing which packages to enable in a build, a choice of available versions is offered.

Many users will have their own source code control system, version control system or equivalent, and will want to use it with eCos sources. In that case, since a new release of eCos comes with different pathnames for all the source files, a bit of work is necessary to import a new release into your source repository.

One way of handling the import is to rename all the version parts to some common name, for example “current”, and continue to work. “current” is suggested because pkgconf recognizes it and places it first in any list of versions. In the future, Cygnus may provide a tool to help with this, or an option in the install wizard. Alternatively, in a POSIX shell environment (Linux or Cygwin on Windows) use the following command:

find . -name v1_2 -type d -printf "mv %p %h/current\n" | sh

Having carried out such a renaming operation, your source tree will now look like this:

BASE_DIR/kernel/current/include/
BASE_DIR/kernel/current/src/
BASE_DIR/kernel/current/tests/
...
BASE_DIR/compat/uitron/current/include/
BASE_DIR/compat/uitron/current/src/
BASE_DIR/compat/uitron/current/tests/

which is a suitable format for import into your own source code control system. When you get a subsequent release of eCos, do the same thing and use your own source code control system to manage the new source base, by importing the new version from

NEW_BASE_DIR/kernel/current/include/

and so on.

The eCos build tool will now offer only the “current” version of each package; select this for the packages you wish to use.

Making such a change has implications for any build trees you already have in use. A configured build tree contains information about the selected packages and their selected versions. Changing the name of the “versioning” folder in the source tree invalidates this information, and in consequence it also invalidates any local configuration options you have set up in this build tree. So if you want to change the version information in the source tree, do it first, before investing any serious time in configuring and building your system. When you create a new build tree to deal with the new source layout, it will contain default settings for all the configuration options, just like the old build tree did before you configured it. You will need to redo that configuration work in the new tree.

Moving source code around also invalidates debugging information in any programs or libraries built from the old tree; these will need to be rebuilt.