sonic-linux-kernel icon indicating copy to clipboard operation
sonic-linux-kernel copied to clipboard

Kernel configuration changes

Open olivier-singla opened this issue 5 years ago • 11 comments

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

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.

Also, the final kernel configuration will be checked to verify that:

  • all options asked to be excluded are effectively not present in the kernel,
  • and all options asked to be included are effectively present in the kernel, using the exact type (module or buit-in) or string or number.

olivier-singla avatar Oct 04 '19 01:10 olivier-singla

Will this change ABI of the kernel?

pavel-shirshov avatar Oct 04 '19 17:10 pavel-shirshov

Will this change ABI of the kernel?

We only remove a few options in the kernel configuration (such as CONFIG_INPUT_JOYSTICK, etc.), so AFAIK this will not change the ABI of the kernel.

olivier-singla avatar Oct 04 '19 17:10 olivier-singla

Can somebody take a look at this PR?

olivier-singla avatar Nov 25 '19 14:11 olivier-singla

retest this please

olivier-singla avatar Apr 16 '20 14:04 olivier-singla

Can somebody take a look at this PR?

A friendly reminder: if somebody could look at this patch that would be appreciated,

olivier-singla avatar Apr 16 '20 18:04 olivier-singla

retest this please

lguohan avatar Apr 16 '20 19:04 lguohan

retest this please

lguohan avatar Apr 17 '20 05:04 lguohan

[2020-06-03T13:27:52.659Z] debian/bin/buildcheck.py debian/build/build_amd64_none_amd64 amd64 none amd64 [2020-06-03T13:27:53.611Z] ABI has changed! Refusing to continue.

lguohan avatar Jun 03 '20 13:06 lguohan

@olivier-singla , ABI changed, need to fix the build. here is my plan, i think we can first merge the infrastructure in, and then, we can move the existing config patch into kconfig-inclusion and kconfig-exclusion, and then we can add additional trim from you.

the infrastructure change is in pr #143

lguohan avatar Jun 03 '20 13:06 lguohan

/easycla

jarias-lfx avatar Jul 19 '23 19:07 jarias-lfx

CLA Not Signed

  • :white_check_mark: login: lguohan / name: Guohan Lu (2c527ed74e5589b4aef91c9730629a2c08e20c0b)
  • :x: - login: @olivier-singla / name: Olivier Singla . The commit (dafefa05a7a1c3ab196fc4266fea21aafe6aa131, 2e81a98e35e6aae43c4b3478cb67632627aad4b9, 1e01f21017a7aec3c060e7a259ba2a1aad8fcd81) is not authorized under a signed CLA. Please click here to be authorized. For further assistance with EasyCLA, please submit a support request ticket.