Skip to content

Commit 84df820

Browse files
committed
Update the readme to cover the current patch acceptance policies
Patches will be moved into separate folders in a later commit. Signed-off-by: Saikrishna Arcot <[email protected]>
1 parent 1398567 commit 84df820

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

README.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
1-
[![Build Status](https://sonic-jenkins.westus2.cloudapp.azure.com/job/common/job/linux-kernel-build/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/common/job/linux-kernel-build/)
1+
[![Build Status](https://dev.azure.com/mssonic/build/_apis/build/status%2FAzure.sonic-linux-kernel?branchName=master)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=13&branchName=master)
22

33
# SONiC - Kernel
44

55
## Description
6-
This repository contains the scripts and patches to build the kernel for SONiC. SONiC uses the same kernel for all platforms. We prefer to out-of-tree kernel platform modules. We accept kernel patches on following conditions:
6+
This repository contains the scripts and patches to build the kernel for SONiC. SONiC uses the same kernel for all amd64 platforms (armhf and arm64 platforms currently have platform-specific kernels). We accept kernel patches on following conditions:
77

88
- Existing kernel modules need to be enabled.
9-
- Existing kernel modules need to be patched and those patches are available in upstream.
10-
- Please include the original upstream commit id and message in the patch. This allows the maintainer to remove upstream patches during the kernel upgrade.
11-
- New kernel modules which are common to all platforms.
9+
- Existing kernel modules/code need to be patched, or new kernel modules which are common to all platforms. In addition:
10+
- Those patches are available in upstream.
11+
- Please include the original upstream commit ID and message in the patch or the PR description. This allows the maintainer to remove upstream patches during the kernel upgrade.
12+
- Those patches will be upstreamed or are in the process of being upstreamed.
13+
- If being upstreamed, please include a link to the mail thread in the patch or PR description.
14+
- Those patches don't make sense to be upstreamed, either because they're applicable only within SONiC or they would break some general use case.
1215
- Platform specific kernel modules which are impossible or very difficult to be built out of kernel tree.
1316

14-
Platform specific kernel modules are expected to develop out-of-tree kernel modules, provide them in debian packages to be embedded into SONiC ONE image and installed on their platforms.
17+
Platform specific kernel modules are expected to develop out-of-tree kernel modules, provide them in debian packages to be embedded into SONiC image and installed on their platforms.
1518

16-
For all patches, please ensure you have run the patch with `checkpatch.pl` and pass it.
19+
Patches must be placed into one of three folders:
20+
21+
- `backports`: For patches that have already been upstreamed into the mainline Linux kernel
22+
- `toBeUpstreamed`: For patches that will be upstreamed or are in the process of being upstreamed
23+
- `sonicOnly`: For patches that will not be upstreamed
24+
- For organizational purposes, this folder will contain multiple folders, one per platform/vendor.
25+
26+
For all patches, please ensure you have run the patch with `scripts/checkpatch.pl` (available within the kernel source code).
1727

1828
Usage:
1929

@@ -23,24 +33,22 @@ If DEST is not set, package will stay in current directory.
2333

2434
## Kernel Configuration Changes
2535

26-
The Debian kernel used with SONiC includes almost all available hardware that can be found on a system using Linux. This increases considerably the time needed to build the kernel Debian image. Since there are many drivers, protocols or filesystems which will never be used on a switch, there is a simple mechanism to remove kernel options which does not require creating a kernel configuration patch. The options which need to be excluded from the kernel are simply listed in a flat text file:
27-
patch/kconfig-exclusions
36+
The Debian kernel used with SONiC includes almost all available hardware that can be found on a system using Linux. This increases considerably the time needed to build the kernel Debian image. Since there are many drivers, protocols or filesystems which will never be used on a switch, there is a simple mechanism to remove kernel options which does not require creating a kernel configuration patch. The options which need to be excluded from the kernel are simply listed in a flat text file, `patch/kconfig-exclusions`.
2837

2938
Example:
3039

3140
CONFIG_REISERFS_FS
3241
CONFIG_JFS_FS
3342
CONFIG_XFS_FS
3443

35-
Similarly, there is a mechanism to include some kernel options by listing these options into the flat text file:
36-
patch/kconfig-inclusions
44+
Similarly, there is a mechanism to include some kernel options by listing these options into the flat text file `patch/kconfig-inclusions`.
3745

3846
Example:
3947

4048
CONFIG_INT340X_THERMAL=m
4149
CONFIG_LOG_BUF_SHIFT=18
4250

43-
If the files patch/kconfig-exclusions and patch/kconfig-inclusions exist, they will be processed after all the kernel patches described in the patch directory have been applied, exclusions being done before inclusions.
51+
If the files `patch/kconfig-exclusions` and `patch/kconfig-inclusions` exist, they will be processed after all the kernel patches described in the patch directory have been applied, exclusions being done before inclusions.
4452

4553
Also, the final kernel configuration will be checked to verify that:
4654
- all options asked to be excluded are effectively not present in the kernel,

0 commit comments

Comments
 (0)