Installing the TAIL OS SDK
The SDK is what you build TAIL OS applications with: the portable OS and the
toolchain that targets it. It needs no TAIL OS source and no cross-compiler —
the bundled toolchain links with its own rust-lld.
TAIL OS ships as two artifacts. The SDK here is board-agnostic: install it once and the same install serves every board. A bootable image for a specific board is built from a separate per-board BSP against this SDK.
To try TAIL OS without installing anything, see the Quick Start: it boots a prebuilt image in QEMU with one script.
1. Prerequisites
| Linux on x86-64 | The bundled toolchain runs there |
rustup |
The installer registers the bundled toolchain with it: rustup.rs |
curl and tar |
Usually preinstalled |
QEMU is needed only to boot an image, not to build applications:
sudo apt-get install -y qemu-system-arm qemu-utils.
2. Download
curl -O https://tail-os.com/downloads/tail-sdk-installer-0.1.0.tar.gz
curl -O https://tail-os.com/downloads/SHA256SUMS
sha256sum -c --ignore-missing SHA256SUMS
The bundle is 289 MiB: it carries the toolchain and the portable OS, so nothing is fetched during installation.
3. Install
tar xzf tail-sdk-installer-0.1.0.tar.gz
cd tail-sdk-installer-0.1.0
./install.sh --prefix ~/tail-sdk
install.sh copies the toolchain and the portable OS into the directory you
name, registers the toolchain with rustup as tail_release pointing there, and
writes ~/tail-sdk/tail-sdk-env.sh, which exports TAIL_SDK (the SDK tree
inside the install, ~/tail-sdk/sdk/tail-sdk-0.1.0). It finishes by
compiling and linking a throwaway program, so a successful run means the next
step works. The extracted bundle is disposable afterwards.
Run it without --prefix to be prompted for the directory, with --profile to
add the env file to your shell startup, and with --force to reinstall over an
existing install.
4. Build an application
cargo +tail_release new my_app && cd my_app
cargo +tail_release build --target aarch64-unknown-tail
That produces an AArch64 ELF for TAIL OS with no further configuration. The
+tail_release selects the installed toolchain; rustup default tail_release
makes a bare cargo build use it.
Application builds need nothing else. TAIL_SDK matters only when building a
board BSP, whose verify-sdk.sh reads it:
source ~/tail-sdk/tail-sdk-env.sh
Where next
- The periodic framework in Rust and in Python: the API for periodic applications, with examples.
- Quick Start: boot a prebuilt image in QEMU.
- Running TAIL OS in QEMU and on a Raspberry Pi 3.