Skip to main content

Crate rauc

Crate rauc 

Source
Expand description

§RAUC for Rust ✨

Async Rust bindings for the RAUC D-Bus installer API, built with zbus.

Installation · Usage · Examples · API docs · Contributing

§Compatibility

ComponentSupport
PlatformLinux
ConnectionSystem bus
Interfacede.pengutronix.rauc.Installer
RAUCRAUC_VERSION
Rust1.89+
zbus6.x

§Installation

cargo add rauc

§Usage

Connect to the system bus and query slot status:

use rauc::InstallerProxy;
use zbus::{Connection, Result};

#[tokio::main]
async fn main() -> Result<()> {
    let connection = Connection::system().await?;
    let proxy = InstallerProxy::new(&connection).await?;

    let slots = proxy.get_slot_status().await?;
    println!("{slots:#?}");

    Ok(())
}

See the API documentation for all available methods and types.

§Examples

§Inspect and monitor

# Each read-only example is named after its RAUC operation
cargo run --example get_slot_status

# Bundle inspection takes a path or URL
cargo run --example inspect_bundle -- path/to/update.raucb

# Receives installation progress changes
cargo run --example receive_progress_changed

# Receives the installation-completed signal
cargo run --example receive_completed

§Modify the system

[!CAUTION] Installing bundles and marking slots modify the target system.

# Marks a slot as good, bad, or active
cargo run --example mark -- good booted

# Installs a specified bundle
cargo run --example install_bundle -- path/to/update.raucb

§Initial interface generation

The initial bindings were generated from RAUC’s official installer interface for the release in RAUC_VERSION:

mkdir -p src/generated

RAUC_VERSION=$(cat RAUC_VERSION)
RAUC_INTERFACE=de.pengutronix.rauc.Installer.xml

curl -L "https://raw.githubusercontent.com/rauc/rauc/${RAUC_VERSION}/src/${RAUC_INTERFACE}" -o "interfaces/${RAUC_INTERFACE}"
zbus-xmlgen file "interfaces/${RAUC_INTERFACE}" -o src/generated/installer.rs

[!NOTE] This records the original setup, not an ongoing maintenance workflow.

§Contributing

Bug fixes, features, tests, and documentation improvements are welcome. See the contribution guidelines to get started.

§License

Licensed under the MIT License or Apache License 2.0, at your option.

The committed RAUC interface XML is licensed under CC0-1.0.

Structs§

ArtifactStatusArtifactInfo
Status of an artifact stored in a repository.
ArtifactStatusInfo
Status of a configured artifact repository.
ArtifactStatusInstanceInfo
Status of one artifact instance.
GetSlotStatusInfo
Status and metadata of a RAUC slot.
InspectBundleArgs
Options for inspecting a local or remote bundle.
InspectBundleBundleInfo
Bundle format and integrity metadata.
InspectBundleHandlerInfo
Custom handler metadata from a bundle manifest.
InspectBundleHooksInfo
Hook metadata from a bundle manifest.
InspectBundleImageInfo
Metadata for an image contained in a bundle.
InspectBundleInfo
Metadata read from an inspected bundle.
InspectBundleUpdateInfo
Update metadata from a bundle manifest.
InstallBundleArgs
Options for installing a local or remote bundle.
InstallerProxy
MarkInfo
Result of marking a slot as good, bad, or active.
Progress
Progress of the current installation operation.

Enums§

BundleFormat
Format used to package a RAUC bundle.
InstallationResult
Result reported by the installation completion signal.
MarkState
Action used to mark a slot.
Operation
Operation currently performed by RAUC.
SlotBootStatus
Bootloader status of a slot.
SlotIdentifier
Slot selector accepted by the mark operation.
SlotInstallationStatus
Result of the most recent installation to a slot.
SlotState
Runtime state of a slot.

Type Aliases§

SlotName
Name identifying a RAUC slot, such as rootfs.0.