397908aa59
- Why I did it
Facilitate Automatic integration of new hw-mgmt version into SONiC.
Inputs to the Script:
MLNX_HW_MANAGEMENT_VERSION Eg: 7.0040.5202
CREATE_BRANCH: (y|n) Creates a branch instead of a commit (optional, default: n)
BRANCH_SONIC: Only relevant when CREATE_BRANCH is y. Default: master.
Note: These should be provided through SONIC_OVERRIDE_BUILD_VARS parameter
Output:
Script creates a commit (in each of sonic-buildimage, sonic-linux-kernel) with all the changes required for upgrading the hw-management version to a version provided by MLNX_HW_MANAGEMENT_VERSION
Brief Summary of the changes made:
MLNX_HW_MANAGEMENT_VERSION flag in the hw-management.mk file
hw-mgmt submodule is updated to the corresponding version
Updates are made to non-upstream-patches/patches and series.patch file
series, kconfig-inclusion and kconfig-exclusion files can be updated in the sonic-linux-kernel repo
sonic-linux-kernel/patches folder is updated with the corresponding upstream patches
Based on the inputs, there could be a branch seen in the local for each of the repo's. Branch is named as <branch>_<parent_commit>_integrate_<hw_mgmt_version>
- How I did it
Added a new make target which can be invoked by calling make integrate-mlnx-hw-mgmt
user@server:/sonic-buildimage$ git rev-parse --abbrev-ref HEAD
master_23193446a_integrate_7.0020.5052
user@server:/sonic-buildimage$ git log --oneline -n 2
f66e01867 (HEAD -> master_23193446a_integrate_V.7.0020.5052, show) Intgerate HW-MGMT V.7.0020.5052 Changes
|
||
---|---|---|
.. | ||
patches | ||
README.md | ||
series.patch |
Mellanox non-upstream linux kernel patches
To include non-upstream patches into the sonic-linux image during build time, the INCLUDE_EXTERNAL_PATCHES=y
flag has to be provided. By default, the directory pointed by EXTERNAL_KERNEL_PATCH_LOC will be used and it must follow the following structure. To use a publicly accessible tar of the non-upstream patches, also provide the EXTERNAL_KERNEL_PATCH_URL
variable
Directory Structure
EXTERNAL_KERNEL_PATCH_LOC/
├──── patches/
├── 0001-mlx5-Refactor-module-EEPROM-query.patch.patch
├── 0002-mlx5-Implement-get_module_eeprom_by_page.patch.patch
├── 0005-mlx5-Add-support-for-DSFP-module-EEPROM-dumps.patch
├── .............
├──── series.patch
- It should contain a file named series.patch. This should contain a diff that is applied on the sonic-linux-kernel/patch/series file. The diff should include all the non-upstream patches.
- All the patches should be present in the patches folder
- Developers should make sure patches apply cleanly over the existing patches present in the src/sonic-linux-kernel .
Include the non upstream patches while building sonic linux kernel
Set INCLUDE_EXTERNAL_PATCHES=y
using SONIC_OVERRIDE_BUILD_VARS
to include these changes before building the kernel.
- Eg:
NOJESSIE=1 NOSTRETCH=1 NOBUSTER=1 make SONIC_OVERRIDE_BUILD_VARS=' INCLUDE_EXTERNAL_PATCHES=y ' target/debs/bullseye/linux-headers-5.10.0-12-2-common_5.10.103-1_all.deb