Startup of a Sabaton based product

Initial Ramdisk approach

Sabaton uses an initial ramdisk approach to boot. The initial ramdisk, or initrd, is combined with the Linux Kernel and is loaded by the bootloader.

The initrd is an important variability point in the system and it is a way to handle hardware specific variabilities from the rest of the system.

The initrd performs the following tasks,

  1. Mount the partitions expected by the system image. The initrd also understands the dual partition scheme and selects the correct partition to mount based on the currently active partition. The mechanism to retrieve and store the currently active partition is hardware specific and implemented in the initrd.

  2. Satisfy the system interface for proper startup of the system.

  3. Handle any critical early use-cases.

The Sabaton initrd is a statically linked binary developed in Rust. It uses the MUSL C Library target.

Platform vs Product specific parts of a Sabaton system

Sabaton Boot sequence overview

The initrd has a compile time binding to the product and it is the mechanism by product specific runtime configurations can be injected into the system via the filesystem or by passing parameters to SystemD.

SystemD

SystemD is used as the init process. SystemD supports several features that are useful in an embedded system, such as fast parallel startups, loading modules and configuring networks, just to mention a few. The init process is a critical piece of software and though we would like to have it implemented in Rust, we decided to go with SystemD because it is a proven component in use by multiple distrubitions.

The startup sequence via the systemD unit files are developed and injected into the system during the image building process. (See imagebuilder ) .