[openwrt/openwrt] generic: improve patches documentation
LEDE Commits
lede-commits at lists.infradead.org
Wed Jun 11 06:10:09 PDT 2025
noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/f9ea340288f82d410e0a48882a93a5691da187f5
commit f9ea340288f82d410e0a48882a93a5691da187f5
Author: Álvaro Fernández Rojas <noltari at gmail.com>
AuthorDate: Wed Jun 11 08:15:35 2025 +0200
generic: improve patches documentation
It's time to give the patches documentation some love by:
- Using Markdown.
- Differentiating between generic and specific target patches.
- Adding deeper explanation about patch numbering.
Link: https://github.com/openwrt/openwrt/pull/19092
Signed-off-by: Álvaro Fernández Rojas <noltari at gmail.com>
---
target/linux/generic/PATCHES | 20 ----------
target/linux/generic/PATCHES.md | 84 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 84 insertions(+), 20 deletions(-)
diff --git a/target/linux/generic/PATCHES b/target/linux/generic/PATCHES
deleted file mode 100644
index 86ced46804..0000000000
--- a/target/linux/generic/PATCHES
+++ /dev/null
@@ -1,20 +0,0 @@
-The patches-* subdirectories contain the kernel patches applied for every
-OpenWrt target. All patches should be named 'NNN-lowercase_shortname.patch'
-and sorted into the following categories:
-
-0xx - upstream backports
-1xx - code awaiting upstream merge
-2xx - kernel build / config / header patches
-3xx - architecture specific patches
-4xx - mtd related patches (subsystem and drivers)
-5xx - filesystem related patches
-6xx - generic network patches
-7xx - network / phy driver patches
-8xx - other drivers
-9xx - uncategorized other patches
-
-ALL patches must be in a way that they are potentially upstreamable, meaning:
-
-- they must contain a proper subject
-- they must contain a proper commit message explaining what they change
-- they must contain a valid Signed-off-by line
diff --git a/target/linux/generic/PATCHES.md b/target/linux/generic/PATCHES.md
new file mode 100644
index 0000000000..0462a59f92
--- /dev/null
+++ b/target/linux/generic/PATCHES.md
@@ -0,0 +1,84 @@
+# OpenWrt kernel patches
+
+All patches must be in a way that they are potentially upstreamable, meaning:
+
+* They must contain a proper subject.
+* They must contain a proper commit message explaining what they change and why.
+* They must contain a valid Signed-off-by line.
+
+The build system applies the patches in the following order:
+
+1. target/linux/generic/backport-*/
+2. target/linux/generic/pending-*/
+3. target/linux/generic/hack-*/
+4. target/linux/`<target name>`/patches-*/
+
+## OpenWrt generic
+
+The generic target patches are applied to every OpenWrt target before any of the specific target patches are applied.
+
+### backport
+
+The `backport-*` subdirectories contain the kernel patches backported from newer kernels.
+
+In order to save naming space for newer patches to come, when adding a new subset of patches which are related between them the following naming convention shall be used: `NNN-SS-vX.Y-lowercase_shortname.patch`.
+For single patches, the following naming convention shall be used instead: `NNN-vX.Y-lowercase_shortname.patch`.
+
+| Item | Description |
+| ----- |:------------------------:|
+| NNN | Main patch number. |
+| SS | Subset patch number. |
+| vX.Y | Upstream kernel version. |
+
+### hack
+
+The `hack-*` subdirectories contain the downstream kernel patches that are less likely to be accepted upstream but are still needed in OpenWrt.
+Some of these patches are potentially upstreamable if properly reworked and others aren't simply worth the effort.
+
+All patches should be named `NNN-lowercase_shortname.patch`.
+
+### pending
+
+The `pending-*` subdirectories contain the kernel patches awaiting upstream merge.
+
+All patches should be named `NNN-lowercase_shortname.patch`.
+
+### Patch number guidelines
+
+The following patch numbering guidelines shall be followed:
+
+| NNN | Description |
+| ---- |:-------------------------------:|
+| 0xx | - |
+| 1xx | - |
+| 2xx | Kernel build / config / header |
+| 3xx | Architecture specific |
+| 4xx | MTD |
+| 5xx | Filesystem |
+| 6xx | Generic network |
+| 7xx | Network / PHY |
+| 8xx | Other drivers |
+| 9xx | Uncategorized |
+
+## OpenWrt targets
+
+The `patches-*` subdirectories contain the kernel patches applied for every OpenWrt target.
+
+All patches should be named `NNN-lowercase_shortname.patch`.
+
+### Patch number guidelines
+
+The following patch numbering guidelines shall be followed:
+
+| NNN | Description |
+| ---- |:-------------------------------:|
+| 0xx | Upstream backports |
+| 1xx | Awaiting upstream merge |
+| 2xx | Kernel build / config / header |
+| 3xx | Architecture specific |
+| 4xx | MTD |
+| 5xx | Filesystem |
+| 6xx | Generic network |
+| 7xx | Network / PHY |
+| 8xx | Other drivers |
+| 9xx | Uncategorized |
More information about the lede-commits
mailing list