LABGRID-DEVICE-CONFIG(5)
π labgrid-device-config β the manual page, but make it a group chat π
okay so bestie, this is labgrid-device-config(5) from the embedded testing corner of the world (that's the manual section it lives in, section 5, files and formats, iykyk) π¦
β¨ NAME β¨
labgrid-device-config β labgrid test configuration files π
β¨ SYNOPSIS β¨
*.yaml
that's it. that's the whole synopsis. she's a yaml file. iconic. π
β¨ DESCRIPTION β¨
so to integrate a device into a labgrid test, labgrid literally needs a description of the device and how to access it. no description = no access = no test = we're not doing that. π
this manual page is divided into sections, and each one describes exactly one top-level yaml key. one key per section, very demure, very mindful. β¨
β¨ TARGETS β¨
the targets: top key configures a target β like, its drivers and its resources. that's the whole job.
the top level key is the name of the target, and it needs both a resources subkey and a drivers subkey. both. don't skip one.
π¨ and here's the part people trip on: the order of instantiated resources and drivers is important, because they get parsed as an ordered dictionary and a driver may depend on a previous driver. so the order you write = the order they go. no cap.
for the full list of available resources and drivers, go look at https://labgrid.readthedocs.io/en/latest/configuration.html π
β¨ OPTIONS β¨
the options: top key configures various options, such as the crossbar_url. yes that's literally the example the manpage gives. π
OPTIONS KEYS π«Ά
crossbar_urlβ takes as parameter the URL of the crossbar (coordinator) to connect to. defaults to'ws://127.0.0.1:20408'.crossbar_realmβ takes as parameter the realm of the crossbar (coordinator) to connect to. defaults to'realm1'.
β¨ IMAGES β¨
the images: top key provides paths to access preconfigured images to flash onto the board. π
and the image paths can be either relative to the YAML file or absolute. your choice, bestie.
IMAGE KEYS π
the subkeys consist of image names as keys and their paths as values. so like, name β path. then the corresponding name can be used with the appropriate tool found under TOOLS. πΈ
IMAGE EXAMPLE π
two configured images, one for the root filesystem, one for the bootloader:
images:
root: "platform-v7a/images/root.img"
boot: "platform-v7a/images/barebox.img"
look at her. two images. organized. π
β¨ TOOLS β¨
the tools: top key provides paths to binaries such as fastboot. π₯
TOOLS KEYS π§
fastbootβ path to thefastbootbinarymxs-usb-loaderβ path to themxs-usb-loaderbinaryimx-usb-loaderβ path to theimx-usb-loaderbinary
TOOLS EXAMPLE β
configure the tool path for imx-usb-loader:
tools:
imx-usb-loader: "/opt/labgrid-helper/imx-usb-loader"
β¨ IMPORTS β¨
the imports key is a list of files or python modules which are imported by the environment after loading the configuration. π
paths relative to the configuration file are also supported, so you don't have to write the whole absolute path if you don't want to. π«Ά
this is useful to load drivers and strategy which are contained in your testsuite, since the import is done before instantiating the targets. (order matters again, bestie, it always does π)
IMPORTS EXAMPLE π
import a local myfunctions.py file:
imports:
- myfunctions.py
β¨ EXAMPLES β¨
example one πΈ
a sample configuration with one main target, accessible via SerialPort /dev/ttyUSB0, allowing usage of the ShellDriver:
targets:
main:
resources:
RawSerialPort:
port: "/dev/ttyUSB0"
drivers:
SerialDriver: {}
ShellDriver:
prompt: 'root@\w+:[^ ]+ '
login_prompt: ' login: '
username: 'root'
example two π¦
a sample configuration with RemotePlace, using the tools configuration and importing the local mystrategy.py file. The MyStrategy strategy is contained in the loaded local python file:
targets:
main:
resources:
RemotePlace:
name: test-place
drivers:
SerialDriver: {}
ShellDriver:
prompt: 'root@\w+:[^ ]+ '
login_prompt: ' login: '
username: 'root'
MyStrategy: {}
IMXUSBLoader: {}
tools:
imx-usb-loader: "/opt/lg-tools/imx-usb-loader"
imports:
- mystrategy.py
she has everything. targets, tools, imports. main character energy fr fr π
β¨ SEE ALSO β¨
go read those too, they're the whole friend group π«Ά
β¨ AUTHOR β¨
Rouven Czerwinski <r.czerwinski@pengutronix.de>
Organization: Labgrid-Project π
β¨ COPYRIGHT β¨
Copyright (C) 2016-2017 Pengutronix. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
π and that's the whole page, bestie! version 0.0.1, dated 2017-04-15, shipped under the LABGRID-DEVICE-CONFIG(5) name β go forth and yaml responsibly. slay β¨π
π
π¦ where this page comes from
- debian bookworm: labgrid 0.4.1-6 Β· LGPL-2.1-or-later
- ubuntu jammy: labgrid 0.4.1-2 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms