Explore System Generations

This tutorial shows how Den records and switches system generations in the staged rootfs. You will create a second generation, activate it, and roll back.

The current prototype does this in build/rootfs rather than inside a running machine. That keeps the tutorial contained and repeatable while the OS model is still early.

Build The Rootfs

Start with the staged rootfs:

ct run smoke

The initial generation is:

build/rootfs/den/generations/1/sw

The active generation pointer is:

build/rootfs/den/current-system

It points to:

generations/1

Run The Generation Smoke

Create generation 2, validate both generations, activate generation 2, then roll back to generation 1:

ct run generation-smoke

The smoke target uses:

conda workspace unarchive /work/build/den-workspace.tar.zst \
  --target /work/build/workspace-archive-generation-smoke \
  --install \
  -e system \
  --prefix /den/generations/2/sw \
  --dest /work/build/rootfs \
  -y

The critical detail is the pair of --prefix and --dest values. --prefix is the runtime prefix that packages see inside the Den machine. --dest is the staging root on the build host.

Inspect The Result

After the smoke finishes, generation 1 is active again:

readlink build/rootfs/den/current-system

Expected output:

generations/1

List generation metadata:

find build/rootfs/den/generations -maxdepth 3 -type f | sort

Each recorded generation has:

metadata/conda.toml
metadata/conda.lock
metadata/generation.toml
metadata/packages.txt

You can also inspect the same state through the Den system manager:

build/rootfs/den/generations/1/sw/usr/lib/den/den --root build/rootfs generations list
build/rootfs/den/generations/1/sw/usr/lib/den/den --root build/rootfs generations validate 1

What To Notice

Root-level compatibility paths such as /bin/bash, /usr/bin/*, and /lib/ld-linux-aarch64.so.1 point through /run/current-system/sw. Generation activation changes which package graph those root-level paths resolve to. That is the core OS idea: the system is not a mutable pile of files, it is a selected conda generation.