Before you start
Dev Mailing List
patches@openwrt.org — the primary submission channel for patches to the main tree.
GitHub Mirror
github.com/openwrt/openwrt — pull requests are accepted and triaged here.
IRC / Matrix
#openwrt-devel on OFTC (irc.oftc.net) and the bridged Matrix room.
Bug Tracker
bugs.openwrt.org — file bugs and track issues.
Git workflow
Make your changes
Make one logical change per commit. Keep commits focused — reviewers evaluate each commit independently.
Write a good commit message
Follow the subject line format used throughout the tree:For a new package:For an update:For a fix:The full message format:The
Signed-off-by line is required. It certifies that you have the right to submit the contribution under the project’s license (the Developer Certificate of Origin). Add it automatically:Patch format requirements
OpenWrt usescheckpatch.pl (adapted from the Linux kernel) to check patches:
checkpatch.pl:
| Requirement | Detail |
|---|---|
| Signed-off-by | Every patch must have at least one Signed-off-by line. |
| Subject line | Must follow component: description format. No trailing period. |
| Line length | Lines in commit message body should not exceed 72 characters. |
| SPDX identifiers | New files must include an SPDX license header. |
| No trailing whitespace | Patches must not introduce trailing whitespace. |
| Blank line after subject | A blank line must separate the subject from the body. |
SPDX license headers
All new Makefiles must include an SPDX identifier. For GPL-2.0-only (the most common OpenWrt license):PKG_LICENSE accordingly:
Submitting via the mailing list
The mailing list is the authoritative submission channel for patches to the core tree.Generate patches with git format-patch
.patch files: 0001-component-description.patch.Submitting via GitHub pull request
For contributors who prefer a web-based workflow, pull requests on the GitHub mirror are reviewed and merged by maintainers.openwrt/openwrt:main on GitHub. Apply the same commit message standards — the PR title and description do not replace a proper commit message.
GitHub PRs are triaged and merged by maintainers. For time-sensitive security fixes or large patch series, the mailing list is preferred as it reaches the widest audience of reviewers.
Patch checklist
Before submitting, verify:Coding style
Coding style
- Makefile indentation uses tabs, not spaces.
- No trailing whitespace on any line.
- Variable assignments use
:=for immediate expansion and=for deferred expansion — follow the pattern of surrounding code. INSTALL_BIN,INSTALL_DATA,INSTALL_DIR,INSTALL_CONFmacros used instead of rawinstallorcpcommands.
Package metadata
Package metadata
PKG_NAME,PKG_VERSION,PKG_RELEASEare set.PKG_HASHorPKG_MIRROR_HASHis set and correct.PKG_LICENSEandPKG_LICENSE_FILESare set.PKG_MAINTAINERis set to your name and email.TITLEis a concise single-line description.URLpoints to the upstream project homepage.DEPENDSlists all required runtime libraries.
Build correctness
Build correctness
- The package builds cleanly for at least one target:
make package/<name>/compile V=s. - The package builds with
make -j$(nproc)(parallel build). - No host tools or paths are hardcoded — use
$(STAGING_DIR),$(TARGET_CROSS), etc. - Files are installed using the correct macros (
INSTALL_BINfor executables,INSTALL_DATAfor data files).
Licensing
Licensing
- The Makefile has an SPDX header:
# SPDX-License-Identifier: GPL-2.0-only. PKG_LICENSEuses a valid SPDX expression.PKG_LICENSE_FILESnames the actual license file(s) within the upstream source.- The package license is compatible with distribution in OpenWrt images.
The review and merge process
Once a patch is submitted:- Review — maintainers and community members review the patch on the mailing list or GitHub. Address feedback by sending a revised patch with a version suffix:
[PATCH v2]. - Staging tree — accepted patches are merged into a maintainer’s staging tree first.
- openwrt.git — after sufficient testing, patches are merged from the staging tree into the main
openwrt.gitrepository. - Notification — you receive an email when the patch is applied.
--- separator in the patch: