# Build The Root Filesystem Use this guide when you need to rebuild `build/rootfs`. ## Command ```bash ct run rootfs ``` For a rebuild with checks: ```bash ct run smoke ``` By default Den reads Den-owned packages from a sibling forge checkout at `../den-forge/build/conda`. To build from the hosted release channel, set `DEN_PACKAGE_CHANNEL`: ```bash DEN_PACKAGE_CHANNEL=https://packages.den-os.org/den-forge/den-2026.6 ct run rootfs ``` ## What It Does The rootfs target: - writes a target-specific image workspace manifest, - locks the `agent`, `runtime`, and `system` environments with conda-workspaces APIs, - creates `build/den-workspace.tar.zst`, - installs the runtime environment with runtime prefix `/opt/den`, - installs generation 1 with runtime prefix `/den/generations/1/sw`, - records generation metadata, - applies package-owned rootfs file manifests, - applies package-owned rootfs link manifests, - adds static BusyBox if the Buildroot target already exists. The staging path uses conda-workspaces archive support through the public `WorkspaceArchive` API. The image manifest is pruned to one target platform and the `agent`, `runtime`, and `system` environments before archiving, so `/etc/den/conda.toml` and `/etc/den/conda.lock` describe the image rather than the developer checkout. conda-workspaces `0.8.*` requires the archive extraction target to be absent. Den removes only its managed staging directory before each install. Receipt verification requires SHA-256 package records and Den rejects failed installs or references to the physical staging prefix. ## Outputs ```text build/rootfs/opt/den build/rootfs/den/generations/1/sw build/rootfs/den/generations/1/metadata build/rootfs/den/current-system build/rootfs/run/current-system ``` ## Notes Do not use `conda-pack` for this path. The prototype relies on conda-workspaces archive installation with explicit `prefix` and `dest` arguments so packages are installed with their final runtime prefix while still landing under the staged rootfs.