T2 SDE Linux
T2 SDE is not just a regular Linux distribution - it is a flexible Open Source System Development Environment or "meta distribution". T2 allows the creation of custom distributions with state of the art technology, up-to-date packages and integrated support for cross compilation. Currently the Linux kernel is usually used, but we also started to port T2 to support compiling home-brew like add-on packages on macOS, BSDs, classic Unix systems (Irix, ...) or support bootstrapping alternative micro kernel systems (like a L4 variant or Fuchsia). Similarly building Haiku, Android, Minix, Hurd, Open (or Pure) Darwin, Haiku and OpenBSD could be supported, too.
It is usually best to start with a pre-built ISO download. More information, including about the latest source tree are at:
"T2" started as a community driven fork of the ROCK Linux project in 2004, aiming for a simple, clean, lightweight and cross-compiling build system.
"T2" was an intern project name for "try two / second try" or "technology two". The idea was to eventually choose a more public relation aware name, but somehow we just kept sticking with t2 so far ;-)
Quick reference for T2 SDE development, system maintenance and hacking. Run commands from /usr/src/t2-src.
Reference docs:
T2 SDE started as a fork of ROCK Linux, and some of the tools date back
to that time. Source build scripts live in scripts/*; binary package handling
is a separate, older layer:
| Tool | Origin | Role |
|---|---|---|
t2 |
added 2023 | modern CLI wrapper around scripts/* |
scripts/* |
ROCK era | the build system itself: Build-Pkg builds one package, Emerge-Pkg resolves dependencies, Build-Target builds whole systems |
mine |
ROCK Linux | the original binary package manager; installs, removes and creates .gem packages, also handles tar.* |
bize |
T2 | lighter reimplementation; installs and removes tar.* binary packages |
Source builds always go through the top-level t2 mapping to internal scripts/*.
Binary package install/remove goes through mine or bize; the stone installer
and t2 uninstall use mine when available and fall back to bize. The
.gem format is the ROCK/T2 binary package container (unrelated to Ruby
gems); plain tar.* packages carry the same content without the wrapper.
| Command | Does |
|---|---|
t2 up (pull, sync) |
update the source tree (svn/git) |
t2 config |
create/edit a target configuration profile |
t2 install (inst) |
build + install a package and its dependencies |
t2 uninstall |
remove a package (via mine/bize) |
t2 upgrade |
upgrade all installed packages (Emerge-Pkg -system) |
t2 build-target |
build a whole target sandbox |
t2 create-iso |
create an ISO after a target build |
t2 download (dl) |
download a package's source assets |
t2 clean (clear) |
clean up build artifacts |
t2 find |
find packages by name/metadata |
t2 create |
create a new package from an external URL |
t2 update |
bump a package's version metadata |
t2 list-errors |
list build errors across the target |
t2 commit (ci) |
commit changes to the T2 source tree |
t2 apply |
apply a patch to the tree |
t2 bench |
benchmark the system |
t2 help |
help for a sub-command |
Always update the source tree before starting work to avoid working on stale files.
t2 upNote:
t2 updateis different: it bumps a package's version metadata (queries Repology, refreshes checksums). It does not update the source tree.
Build (and install) a package and its dependencies. Use -optional-deps=no to
skip optional deps and -parallel 1 for serialized, readable output.
t2 install -optional-deps=no -parallel 1 Rebuild and reinstall a package even if it is already installed and up to
date. Use this after editing a .desc so the change takes effect.
t2 install -force
t2 install -force -optional-deps=no -parallel 1 The second form skips optional dependencies and prints serialized, readable output.
Remove build artifacts (temporary src.* build dirs, logs) to start fresh.
t2 clean
t2 cleanWhen a build fails, T2 writes per-package logs to /var/adm/logs/, named
-.{out,log,err}. A .err file means that package failed;
.out holds the full output and .log a successful build. The path is:
/var/adm/logs/-.errList or browse current build errors across the target with:
t2 list-errorsInspect a specific failure directly (full output and the error log):
ls /var/adm/logs/*.err
less /var/adm/logs/9-.err
less /var/adm/logs/9-.outt2 create generates a new package skeleton. For GitHub/GitLab URLs it
queries the API and fills in description, author, license, latest release
version and the [D] download automatically; kde.org and gnome.org URLs
get matching repository defaults.
t2 create https://github.com//
t2 create package// It creates package///.desc, adds the copyright
header, runs svn add, then immediately starts a test build. Fill in any
fields it prints as TODOs afterwards.
| Field | Required | Notes |
|---|---|---|
[COPY] |
yes | always GPL-2.0, license of the .desc file itself, not the package |
[I] |
yes | one-line title |
[T] |
yes | description, one sentence per line |
[A] |
yes | upstream author(s) |
[M] |
yes | maintainer name and email |
[U] |
yes | homepage URL |
[C] |
yes | category from misc/share/PKG-CATEGORIES |
[F] |
no | build flags, see below |
[L] |
yes | license from misc/share/REGISTER, e.g. GPL, GPL3, MIT, OpenSource |
[V] |
yes | upstream version |
[P] |
no | build-by-default flag, stage mask and build priority, see below |
[E] |
no | dependencies: add pkg, opt pkg, del pkg |
[D] |
yes | |
[P] syntax, e.g. X 01---5---9 110.900:
X or O: build by default or not- means it is skipped theresort -k3 in
scripts/Create-PkgList), the dot is only a naming convention: digits
before it are the coarse group (000 dirtree, 101 libc, 102 toolchain,
110 libraries, 5xx applications, 800 kernel), digits after it order
packages within the groupCommon [F] flags:
| Flag | Meaning |
|---|---|
CROSS |
can be built during the cross-compilation stage |
NO-LTO |
disable Link Time Optimization |
NO-SSP |
disable stack smashing protector |
OBJDIR |
build out-of-tree (separate build directory) |
t2 update bumps a package's [V] version and refreshes the [D]
checksums:
| Invocation | Effect |
|---|---|
t2 update |
query Repology for the latest version and update to it |
t2 update |
update to the given version |
t2 update refresh |
keep the version, recompute checksums only |
t2 update |
scan a directory listing and update all matching packages |
[D] lines use the legacy "Unix" CRC cksum or, preferably, modern SHA of the decompressed tarball, not of the file:
cripts/Create-CkSumPatch
Lint a package's .desc format, and check upstream for newer versions:
scripts/Check-PkgFormat
scripts/Check-PkgVersion Both also accept -repository to sweep a whole repository.
Include the build cache so reviewers have dependency information:
t2 ci --cache By default t2 download uses the T2 mirror, which hides broken [D] URLs. To test the real upstream URL, turn the mirror off, re-fetch, then restore it:
t2 download --mirror none
rm download/Mirror-CacheShow which files have changed across the tree, or scoped to a package:
svn status
svn status package/base/bashFor a per-file line-count summary (+/-), pipe through diffstat:
svn diff | diffstat
svn diff package/base/bash | diffstatShow what changed on the server since your last update (ignores your local edits):
svn diff -r BASE:HEAD | diffstat
svn diff -r BASE:HEAD | colordiff | less -RShow how your working copy differs from the latest upstream HEAD (local + upstream changes combined):
svn diff -r HEAD | diffstatQuick reference:
| Command | Compares |
|---|---|
svn diff |
working copy vs BASE (your last update) |
svn diff -r HEAD |
working copy vs HEAD (latest on server) |
svn diff -r BASE:HEAD |
BASE vs HEAD (server changes only, no local edits) |
Diff one file against upstream (server changes only):
svn diff -r BASE:HEAD package/base/bash/bash.descPull (update) one file from upstream without touching anything else:
svn update package/base/bash/bash.descPipe through colordiff and page with -R to preserve colors:
svn diff | colordiff | less -R
svn diff package/base/bash | colordiff | less -RGenerate a patch to ship upstream. In an svn checkout, svn diff is enough:
svn diff package///.desc > package-fix.patchApply a patch to the tree:
t2 apply For an interactive diff-review + auto-generated cksum and commit log before committing to SVN:
t2 commit bashTo batch commit all locally modified packages that have a [D] download entry:
t2 ci $(grep 'D] .[^ ]' $(svn st package/ | grep '\.desc$' | sed 's/.* //') | cut -d / -f 3)Build a complete system from source into a sandbox under build//.
Each config lives in config// and is independe
No open issues yet, or sync has not completed.