-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patch policy update #318
Draft
saiarcot895
wants to merge
4
commits into
sonic-net:master
Choose a base branch
from
saiarcot895:readme-policy-update
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Patch policy update #318
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,17 +8,29 @@ | |
[![202205 Branch](https://dev.azure.com/mssonic/build/_apis/build/status%2FAzure.sonic-linux-kernel?branchName=202205&label=202205)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=13&branchName=202205) | ||
|
||
## Description | ||
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: | ||
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: | ||
|
||
- Existing kernel modules need to be enabled. | ||
- Existing kernel modules need to be patched and those patches are available in upstream. | ||
- Please include the original upstream commit id and message in the patch. This allows the maintainer to remove upstream patches during the kernel upgrade. | ||
- New kernel modules which are common to all platforms. | ||
- Existing kernel modules/code need to be patched, or new kernel modules which are common to all platforms. In addition: | ||
- Those patches are available in upstream. | ||
- 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. | ||
- Those patches will be upstreamed or are in the process of being upstreamed. | ||
- If being upstreamed, please include a link to the mail thread in the patch or PR description. | ||
- 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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe make that a separate commit with a separate discussion. In my opinion, all code needs to be upstreamed. Maybe add, that there needs to be a convincing explanation, why code cannot be upstreamed. |
||
- DTS (device tree source) files are acceptable here, as the board description in the files may be applicable to SONiC software only. | ||
- For patches added into this folder, please explain why the patch cannot be upstreamed. | ||
- Platform specific kernel modules which are impossible or very difficult to be built out of kernel tree. | ||
|
||
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. | ||
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. | ||
|
||
For all patches, please ensure you have run the patch with `checkpatch.pl` and pass it. | ||
Patches must be placed into one of three folders: | ||
|
||
- `backports`: For patches that have already been upstreamed into the mainline Linux kernel | ||
- `toBeUpstreamed`: For patches that will be upstreamed or are in the process of being upstreamed | ||
- `sonicOnly`: For patches that will not be upstreamed | ||
saiarcot895 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- For organizational purposes, this folder will contain multiple folders, one per platform/vendor. | ||
|
||
For all patches, please ensure you have run the patch with `scripts/checkpatch.pl` (available within the kernel source code). | ||
|
||
Usage: | ||
|
||
|
@@ -28,24 +40,22 @@ If DEST is not set, package will stay in current directory. | |
|
||
## Kernel Configuration Changes | ||
|
||
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 | ||
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`. | ||
|
||
Example: | ||
|
||
CONFIG_REISERFS_FS | ||
CONFIG_JFS_FS | ||
CONFIG_XFS_FS | ||
|
||
Similarly, there is a mechanism to include some kernel options by listing these options into the flat text file: | ||
patch/kconfig-inclusions | ||
Similarly, there is a mechanism to include some kernel options by listing these options into the flat text file `patch/kconfig-inclusions`. | ||
|
||
Example: | ||
|
||
CONFIG_INT340X_THERMAL=m | ||
CONFIG_LOG_BUF_SHIFT=18 | ||
|
||
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. | ||
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. | ||
|
||
Also, the final kernel configuration will be checked to verify that: | ||
- all options asked to be excluded are effectively not present in the kernel, | ||
|
@@ -55,4 +65,4 @@ Also, the final kernel configuration will be checked to verify that: | |
|
||
During Kernel Upgrades, the maintainer must update the configuration diff in the wiki of this repo. This acts as a guide for keeping track of configuration changes between Kernel upgrades. Applies for minor version upgrades as well | ||
|
||
The diff is saved as kconfig-diff-{platform}-{arch}.rst under the artifacts of Azure.sonic-linux-kernel job runs. | ||
The diff is saved as kconfig-diff-{platform}-{arch}.rst under the artifacts of Azure.sonic-linux-kernel job runs. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’d add one dot/period before after platforms before starting the ()., and move the dot/period at the end inside the (), as it’s a full sentence.