Skip to main content
OpenWrt is a Linux operating system for embedded devices. Rather than shipping a single static firmware, it provides a fully writable filesystem with package management — giving you complete control over what runs on the device.

System Layers

1

Hardware

The physical device: CPU, flash storage, RAM, network interfaces, and peripherals. OpenWrt targets a wide range of architectures including ARM, MIPS, x86, and RISC-V.
2

Bootloader

Typically U-Boot. Responsible for initializing hardware, loading the kernel from flash into RAM, and passing device tree information to the kernel.
3

Linux Kernel

A cross-compiled Linux kernel tuned for the target device. Handles hardware abstraction, networking, filesystems, and device drivers (loaded via kmodloader).
4

Core Libraries

musl libc — a lightweight, standards-compliant C library used instead of glibc to minimize footprint on constrained devices. Supplemented by libubox, a core utility library used by most OpenWrt daemons.
5

OpenWrt Daemons

The essential userspace layer:
  • procd — PID 1, service supervisor, and watchdog
  • ubusd — the inter-process communication (IPC) bus daemon
  • uci — the Unified Configuration Interface
These three subsystems underpin every other service on the system.
6

Packages

Additional software installed via opkg (or apk). This includes network daemons (netifd, dnsmasq, firewall4), VPN clients, monitoring tools, and any user-installed software.
7

LuCI Web Interface

An optional web-based management UI built in Lua. LuCI communicates with the underlying system via ubus and UCI, and is itself installed as an opkg package.

Boot Sequence

After the bootloader hands off to the kernel, the following sequence occurs:
Kernel
  └─ mounts OverlayFS (squashfs base + jffs2/ext4 overlay)
  └─ spawns /sbin/init (procd)
        └─ procd starts ubusd (IPC bus)
        └─ /etc/inittab → /etc/init.d/rcS S boot
              └─ boot (START=10): mounts filesystems, loads kernel modules
              └─ system (START=10): applies hostname, timezone via UCI
              └─ network services, firewall, daemons (ordered by START priority)
        └─ procd supervises all running services
        └─ hotplug events dispatched to /etc/hotplug.d/
Service start order is controlled by the START variable in each /etc/init.d/ script. Lower numbers start earlier. The rcS script walks /etc/rc.d/S* symlinks created by enable.

Build System vs. Runtime

OpenWrt has two distinct operational modes:
ContextDescription
Build systemRuns on a Linux/macOS host. Uses make menuconfig, cross-compiles the kernel and packages, and produces flashable firmware images (.bin, .img).
RuntimeRuns on the target device. Uses opkg to install/remove packages, uci to configure services, and /etc/init.d/ scripts to manage running daemons.
Packages can be baked into the firmware image at build time (for space efficiency) or installed at runtime via opkg (for flexibility).

Core Subsystems

Package Manager (opkg)

Install, remove, and query software packages with opkg.

UCI — Unified Configuration Interface

Centralized configuration system for all OpenWrt services.

Init System (procd)

PID 1, service supervision, and hotplug event handling.

Filesystem Layout

OverlayFS, directory structure, and firmware upgrades.