target/linux/<target>/, writing a target Makefile, providing kernel configuration fragments, Device Tree Sources, and defining image generation rules.
Required Files
At minimum, a new target needs:| File | Purpose |
|---|---|
target/linux/<target>/Makefile | Declares architecture, features, subtargets, default packages |
target/linux/<target>/config-<version> | Kernel config fragment for the target |
target/linux/<target>/image/Makefile | Image generation rules |
target/linux/<target>/dts/*.dts | Device Tree Sources for individual boards |
| File | Purpose |
|---|---|
target/linux/<target>/base-files/ | Overlay files copied into the rootfs |
target/linux/<target>/patches-<version>/ | Kernel patches specific to this target |
target/linux/<target>/modules.mk | Additional kernel module selections |
Step-by-Step
Create a kernel config fragment
Create This fragment is merged on top of the generic kernel config during the build.
target/linux/mytarget/config-6.12 with the kernel options required by your SoC:Add Device Tree Sources
Place
.dts files for each board variant in target/linux/mytarget/dts/. These follow the upstream Linux DTS format.Define image generation
Create
target/linux/mytarget/image/Makefile to define how firmware images are built for each device:Target Makefile Variables
| Variable | Description | Example |
|---|---|---|
ARCH | CPU architecture name (used by GCC) | mips, arm, aarch64, x86_64 |
BOARD | Short target identifier used in path names | ath79, x86, mediatek |
BOARDNAME | Human-readable name shown in menuconfig | Atheros ATH79 |
CPU_TYPE | CPU type passed to -march= | 24kc, cortex-a53 |
SUBTARGETS | Space-separated list of subtarget names | generic nand tiny |
FEATURES | Supported image/filesystem features | squashfs ext4 ramdisk |
KERNEL_PATCHVER | Linux kernel version to use | 6.12 |
DEFAULT_PACKAGES | Packages included in every image for this target | kmod-ath9k uboot-envtools |
FEATURES Values
Common values for theFEATURES variable:
| Feature | Meaning |
|---|---|
squashfs | Build SquashFS rootfs images |
ext4 | Build ext4 rootfs images |
ramdisk | Support initramfs images |
vdi | Build VirtualBox disk images |
vmdk | Build VMware disk images |
fpu | Target has hardware floating-point unit |
usbgadget | USB gadget / device-mode support |
boot-part | Separate boot partition for kernel |
rootfs-part | Separate rootfs partition |
Kernel Config Fragments
Kernel configuration is assembled by merging multiple fragments in order:target/linux/generic/config-<version>— base config shared across all targetstarget/linux/<target>/config-<version>— target-specific additionstarget/linux/<target>/<subtarget>/config-<version>— subtarget-specific additions (if present)
Submitting Upstream
New target submissions should:- Follow the OpenWrt contribution guidelines
- Include at minimum one working device definition with tested factory and sysupgrade images
- Pass CI build checks
- Be sent as a patch series to the openwrt-devel mailing list or as a GitHub pull request