embedded-linux-patterns

A reference guide for building Linux systems on ARM-based chips. Yocto and Buildroot are tools for creating embedded Linux images, device trees describe hardware to Linux, and kernel modules add driver code.

In plain words
What is it for?
Use it when arranging Yocto layers and recipes, building images with BitBake, changing kernel configuration, working with device trees, or developing kernel modules.
Why use it?
It collects common project patterns and commands in one place, reducing trial and error when configuring the build system, hardware description, or kernel.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/hermeticormus/libreembed-claude-code/embedded-linux-patterns
Any agent
npx skills add HermeticOrmus/LibreEmbed-Claude-Code --skill embedded-linux-patterns
Clone the repo
git clone --depth 1 https://github.com/HermeticOrmus/LibreEmbed-Claude-Code

Made for: Claude Code, Codex.

Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,295 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01295
Opus 5 $0.00000 $0.00647
Sonnet 5 $0.00000 $0.00259
Haiku 4.5 $0.00000 $0.00129

Measured 2d ago against content hash e847fcd9af31, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

embedded-linux-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/embedded-linux/skills/embedded-linux-patterns/SKILL.md · 170 lines

How it starts

The opening of the file, as written. The whole thing — 170 lines — stays where its author put it; the contents beside it link to each section on GitHub.

embedded-linux-patterns

Knowledge Base

Patterns for Yocto, Buildroot, device trees, and kernel modules on ARM SoCs.


Pattern 1: Yocto Layer and Recipe Hierarchy

Layers (priority, low to high):
  poky/meta                   # Core: glibc, busybox, gcc toolchain
  poky/meta-poky              # Poky distribution configuration
  meta-openembedded/meta-oe   # Extended packages (Python, Qt, etc.)
  meta-raspberrypi            # BSP: kernel, u-boot, machine configs
  meta-myproject              # Project-specific: your app, config

bblayers.conf adds layers. local.conf sets MACHINE, DISTRO, and BB_NUMBER_THREADS.

# Common BitBake operations:
bitbake core-image-minimal          # Build minimal console image
bitbake -s | grep myapp             # Check recipe is found
bitbake myapp -c cleanall && bitbake myapp  # Rebuild from scratch
bitbake myapp -e | grep ^S=         # Show S (source dir) variable
devtool modify myapp                # Unpack source for development
devtool finish myapp meta-myproject # Write changes back to recipe

Pattern 2: Kernel Configuration Fragment

Instead of editing .config directly, use a config fragment in a .bbappend:

# meta-myproject/recipes-kernel/linux/linux-%.bbappend
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI += "file://my-features.cfg"
# files/my-features.cfg
CONFIG_CAN=y
CONFIG_CAN_RAW=y
CONFIG_SPI=y
CONFIG_SPI_SPIDEV=y
CONFIG_I2C_CHARDEV=y
# CONFIG_MODULES is not set   ← explicit disable

Apply with: bitbake linux-imx -c menuconfig then bitbake linux-imx -c savedefconfig.


Pattern 3: Device Tree GPIO and Interrupt Properties

/* GPIO: <&gpioN pin_num active_level> */
/* IRQ:  <&intc GIC_SPI irq_num IRQ_TYPE_EDGE_RISING> */

mysensor@48 {
    compatible = "ti,ads1115";
    reg = <0x48>;

    /* Active-low interrupt from sensor, connected to PA3 */
    interrupt-parent = <&gpioa>;
    interrupts = <3 IRQ_TYPE_EDGE_FALLING>;

    /* Reset GPIO: active low, initially deasserted */
    reset-gpios = <&gpiob 5 GPIO_ACTIVE_LOW>;
};

Read the full file on GitHub · 170 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 170 lines · 0 tokens per session scan A e847fcd9af31

Subscribe to this mod's changes

embedded-linux-patterns is a skill published in the GitHub repository HermeticOrmus/LibreEmbed-Claude-Code (44 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,295 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

hardware-iot-bus

Low-level I2C and SPI bus peripheral control for embedded Linux boards (Orange Pi, Raspberry Pi, RISC-V).

AbdullahMalik17/malikclaw · 31 tokens

aether-iot-query

Use this skill when the user asks about a live AetherEdge runtime: channels, points, real-time values, history, alarms, rules, models, instances, routing, SHM health, service health, or system status. Use aether CLI commands to answer — do NOT inspect source code, local database files, or config YAMLs to answer…

EvanL1/AetherEdge · 82 tokens

aether-iot

Build, integrate, diagnose, or generate applications for the AetherEdge AI-native edge kernel. Use for AetherEdge onboarding, SDK compositions, device and topology clients, read-only operations UIs, MCP integration, Domain Packs, or governed IoT commands where live-state authority and physical-device safety must be…

EvanL1/AetherEdge · 68 tokens

ha-integration-knowledge

Everything you need to know to build, test and review Home Assistant Integrations. If you're looking at an integration, you must use this as your primary reference.

home-assistant/core · 38 tokens

driver-review

Review and implement hardware driver code — DMA safety, interrupt correctness, timing constraints, peripheral register usage, channel drivers, and peripheral mock implementations. Use when writing, modifying, or reviewing LED drivers, SPI/I2S/RMT/UART/PARLIO/LCDCAM peripherals, GPIO configuration, or peripheral mock…

FastLED/FastLED · 67 tokens

esp32-arch-review

Review ESP32 FastLED firmware architecture for RTOS safety, DMA correctness, LED driver patterns, memory management, and peripheral safety. Use before merging significant driver changes, new platform ports, or when auditing existing ESP32 FastLED code.

FastLED/FastLED · 53 tokens