A Yocto-based Linux distribution featuring a PREEMPT-RT patched kernel for real-time applications.
Chronos is a custom Linux distribution built with the Yocto Project, designed for real-time performance with a PREEMPT-RT kernel patch. It supports multiple hardware platforms and provides a minimal, optimized system for embedded and real-time applications.
- Overview
- Prerequisites
- Repository Setup
- Build Environment
- Building
- Running
- Testing
- Debugging
- Additional Information
- Resources
- License
- Ubuntu 20.04 LTS or newer (recommended)
- At least 50GB of free disk space
- Minimum 8GB RAM (16GB recommended)
- Multi-core processor for faster builds
Update your system packages:
sudo apt update && sudo apt upgrade -yInstall required build tools:
sudo apt install build-essential chrpath cpio diffstat file gawk lz4 tmux zstd iptables python3-setuptools python3-venvCreate a Python virtual environment:
python3 -m venv venvClone the repository with all submodules:
git clone --recurse-submodules https://github.com/mrabine/chronos.gitIf you've already cloned without --recurse-submodules, initialize them with:
git submodule update --init --recursiveMove to chronos directory:
cd chronosInitialize the Yocto build environment:
source ./meta-chronos-distro/chronos-init-build-envNote
This script must be sourced (using . or source) in each new terminal session before building.
| Machine | Architecture | Description |
|---|---|---|
daytona |
x86_64 | Default configuration for x86-64 systems |
tank |
ARM64 | ARM 64-bit architecture support |
Build the image for your target machine:
MACHINE=daytona bitbake chronos-imageOr for ARM64:
MACHINE=tank bitbake chronos-imageTip
First-time builds (without local or remote cache) can take several hours depending on your system. Subsequent builds will be significantly faster due to local caching.
After a successful build, you'll find the output images in:
build/tmp/deploy/images/<machine>/
Test your image using QEMU:
MACHINE=daytona runqemu chronos-image nographicTip
Keyboard shortcuts to exit QEMU: Ctrl+A then X
Flash the image to your target device using tools like:
- dd for SD cards
- bmaptool for efficient flashing
- Your platform's specific flashing tool
Example using dd:
sudo dd if=build/tmp/deploy/images/daytona/chronos-image-daytona.wic \
of=/dev/sdX bs=4M status=progress && syncWarning
Replace /dev/sdX with your actual device. Double-check to avoid data loss!
Chronos supports automated testing using Yocto's testimage framework. This runs a suite of tests on the image in QEMU (or real hardware) to verify functionality.
Customize which tests to run on your image by including the following in conf/local.conf:
TEST_SUITES = "ping ssh parselogs"Build the image and run tests in QEMU:
MACHINE=daytona bitbake chronos-image -c testimageTests will automatically:
- Boot the image in QEMU (or real hardware)
- Execute the configured test suites
- Report results to the console and log files
Test results are saved to:
build/tmp/log/oeqa/testresults.json
Detailed logs are available in:
build/tmp/log/oeqa/
Common included test suites:
| Test Suite | Description |
|---|---|
ping |
Basic network connectivity test |
ssh |
SSH server functionality |
parselogs |
System log error checking |
python |
Python interpreter tests |
gcc |
GCC compiler tests |
kernelmodule |
Kernel module loading tests |
You can create custom test cases by adding Python test modules to your layer:
meta-chronos/lib/oeqa/runtime/cases/mytest.py
Generate IDE support files:
MACHINE=daytona bitbake meta-ide-supportBuild native development sysroot:
MACHINE=daytona bitbake -c build_native_sysroot build-sysrootsBuild target sysroot for cross-compilation:
MACHINE=daytona bitbake -c build_target_sysroot build-sysrootsExtract and use the SDK for application development:
MACHINE=daytona bitbake chronos-image -c populate_sdkThe SDK installer will be located in build/tmp/deploy/sdk/.
Build a specific recipe:
bitbake <recipe-name>Execute a specific task of a specific recipe (fetch, unpack, configure, compile etc...):
bitbake -c <task-name> <recipe-name>Clean a specific recipe:
bitbake -c clean <recipe-name>Clean all in order to rebuild from scratch:
bitbake -c cleanall <recipe-name>Show recipe dependencies:
bitbake -g chronos-image- Yocto Project Documentation - Complete documentation hub
- Yocto Project Overview and Concepts Manual - Understanding Yocto concepts
- Yocto Project Development Tasks Manual - Common development tasks
- Yocto Project Test Environment Manual - Testimage framework documentation
- BitBake User Manual - BitBake build tool reference
- OpenEmbedded Layer Index - Search and browse available layers
- Yocto Project Compatible Layers - Compatible layer listing
- License: Licensed under the MIT License.