Skip to content

Setting up a TCE repository mirror

sayotte edited this page Nov 1, 2012 · 1 revision

Introduction

The Razor-Microkernel is built on the Tinycorelinux distribution, which uses a package-management system it calls "TCE" (for Tiny Core Extensions). The Tinycorelinux project itself provides many, many TCE packages pre-built, which is wonderful. Sadly their free hosting is at times painfully slow, and in any event the sort of problems that Razor solves usually take place in datacenters where it is impossible to connect directly to the internet.

But do not greatly despair! Setting up a mirror of the Tinycorelinux packages, or constructing your own repository with only those you're interested in, is trivial.

Setting up the repository

A TCE repository is merely an indexed-directory (in the sense of "index.html" or "ls"), found in the tinycorelinux/4.x/x86/tcz/ directory underneath some reachable URI, which contains some number of .tcz files along with their MD5-checksums and, if appropriate, dependency-list files.

A minimal example containing a TCE-package for an application written in Ruby, along with the Ruby TCE-package itself, might look like this:

tinycorelinux/4.x/x86/tcz/my-application.tcz
tinycorelinux/4.x/x86/tcz/my-application.tcz.md5
tinycorelinux/4.x/x86/tcz/my-application.tcz.dep.txt
tinycorelinux/4.x/x86/tcz/ruby.tcz

The my-application.tcz.dep.txt file itself would contain only the string "ruby.tcz".

This author has only attempted to use HTTP URIs, e.g. http://localhost/, but it's entirely possible/probably that file:/// URIs would work as well.

Configuring the tools to use the repository

The TCE tools themselves (tce, tce-load, et cetera) consult only the file /opt/tcemirror to determine which URI to search for packages. This is adequate to point them at the mirror you've just set-up:

echo 'http://localhost/' > /opt/tcemirror

Dependency-resolution

The tce-* toolset will automatically search for and install any dependencies mentioned in the .dep.txt file associated with the requested package, recursively.

Sadly, the tce-* toolset doesn't understand how to use more than one mirror, so if the dependency mentioned does not exist in the repository... actually, I don't know whether it will abort or fail but continue installing as much as possible.

At any rate, you'll likely want to include everything you'll need in your repository-- either by mirroring everything provided by Tinycorelinux (be polite about this: they're already bandwidth-starved!), or scrupulously maintaining the list of those you need. For the latter case, you may find it useful to simply spin-up a TCL machine, install everything you want from the public/internet mirrors, and then tar up the contents of /tmp/tce/optional (this is where all the downloaded .tcz files are stored).