We have recently enabled several new kconfig options that not only require the typical config changes but also some new dependencies and workarounds due to bugs and kernel size increases. Due to the quantity of changes needed this post exists as a reference with consolidated information.
New makedepends
You'll have to add the following new makedepends to your kernel:
- elfutils-dev
- linux-headers
- python3
- pahole (to satisfy the
CONFIG_PAHOLE_VERSIONkconfig option)
Workaround for segfaults during kernel build
Enabling CONFIG_DEBUG_INFO_BTF (which now is required by the kconfig check) on Linux kernel releases 7.0 and 7.1 triggers a bug where the build sometimes, particularly on musl, fails with a segfault like so:
Segmentation fault (core dumped)
Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
Disabling the config option is of course not an option in our case as we require it because it allows running things like systemd-nspawn and systemd-dissect as an unprivileged user, which has some nice security benefits.
Fortunately it has been fixed upstream as of Linux 7.2-rc1 and the patch can be backported to older kernels that enable this option. Note that some kernel packages use an older alternative to this patch at the time of writing.
Size increases
We are currently investigating how to combat this. It is chiefly relevant to devices that boot their kernels from the Android boot partition that also happen to have a very small boot partition. Generally, these are devices released before or around 2018, as newer devices have sufficiently big boot partitions. Additionally, devices using UEFI boot via e.g. U-Boot aren't affected.
See #4673 for current discussions about how this can be improved. Suggestions are always welcome!
Related
- #4655: Work item where these issues initially were discussed.