-
Notifications
You must be signed in to change notification settings - Fork 1.5k
SONiC Kernel Update Process and Testing Procedures #21644
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
Comments
@saiarcot895 Can you help share some doc for kernel update? |
Sorry for the delay here.
See also this for some details on the kernel (and other applications from Debian) update. |
Thanks for the detailed explanation! That gives us a good understanding of the process. |
Hi @saiarcot895, We are interested in using an to date Linux Kernel in SONiC so we get CVE fixes. Below I have documented the process I used to bring in a later version of the kernel. Is there anything you would add? PRs for some previous Linux kernel upgrades
Locally Build SONiC KernelThese steps let you build just the SONiC Linux kernel. This lets you quickly verify the kernel build succeeds before you go onto build the rest of sonic-buildimage. Check With this information you can determine what the Linux kernel Debian package target is called by substituting those values into Run the make command to build SONiC linux kernel kernel and keep the sonic-slave build container alive
Once in slave you can navigate to the sonic-linux-kernel submodule and invoke the make command directly.
Find Kernel versionYou can find the lastest Debian Linux kernel version using the debian tracker. You can also view the Debian Linux kernel versions available by searching for To find the KVERSION_SHORT open the .dsc for the version you want. You will see linux-support-<KVERSION_SHORT> For example http://deb.debian.org/debian/pool/main/l/linux/linux_6.1.128-1.dsc KVERSION_SHORT is 6.1.0-31. Now we know for the upgrade the new values are
Build The New SONiC Linux KernelIn src/sonic-linux-kernel/Makefile update KERNEL_VERSION and KVERSION_SHORT. SONiC pulls the Debian kernel from Fixing Preconfig PatchesThe two patches in Follow the steps in "Locally Built SONiC Kernel" to build the kernel. It will fail but it will generate the directory For every patch, in the series file order: Open the file Manually modify the file by applying the changes in the first patch (packaging-update-abiname.patch). Get the md5sum of the modified file (use Fixing SONiC PatchesSONiC applies patches to the Debian Linux Kernel. Now you have changed the Debian Linux Kernel some of these SONiC patches will no longer cleanly apply (e.g. patch already included in upstream). Comment out patches or fix them. After this you should be able to locally build the SONiC Linux kernel stand alone. Update linux-kernel.mkThe makefile in the sonic-linux-kernel submodule uses the Edit Update References to Linux KernelMany parts of sonic-buildimage reference the version in the source code. Run Do a bulk change to change all references
TestingBuild the image and install it on a switch. Ensure the containers are stable using Check for kernel log messages using |
I think that covers everything! This is also basically the process that I follow for each kernel update. |
Hi Team, This may not be the right place to ask, but I am not sure of a better place to ask this related question. Can we consider a set cadence for upgrading the minor kernel version? This allows for more frequent and predicable rollout of CVE fixes/updates and helps operators who deploy SONiC in environments compliance requirements. Thoughts @saiarcot895 @qiluo-msft @bingwang-ms @xumia @lguohan A bit more context can be found below. Thank you. |
This document specifies that the kernel be updated every 6 months. However, due to a number of reasons, that cadence cannot be met. There'll be discussions related to a new cadence happening soon in the Platform/OS Working Group. |
Hello!
Could someone please clarify the process for upgrading the kernel in SONiC? Specifically:
Thanks in advance!
@saiarcot895 @qiluo-msft @bingwang-ms @xumia @lguohan
The text was updated successfully, but these errors were encountered: