Skip to content

Commit 35bba96

Browse files
authored
linux-qcom-next: Added security hardening.config to kernel config (#1214)
This PR introduces support for conditionally including `hardening.config` during kernel configuration for linux-qcom-next. The inclusion is based on DISTRO_FEATURES containing **sec-hardening**. Uses merge_config.sh to combine the base .config, hardening.config, and any additional fragments. Default it's not enabled for all build and only for production builds with "sec-hardening" is enabled. Changes: Added logic in `do_configure:prepend` to merge `hardening.config` when `sec-hardening` is present in DISTRO_FEATURES. No changes for distros without this feature. Verified build on QCS9100 with DISTRO_FEATURES += "sec-hardening". Kernel config includes hardening options as expected.
2 parents e950c56 + 73e11c0 commit 35bba96

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

recipes-kernel/linux/linux-qcom-next_git.bb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,13 @@ S = "${UNPACKDIR}/${BP}"
3636
KBUILD_DEFCONFIG ?= "defconfig"
3737
KBUILD_DEFCONFIG:qcom-armv7a = "qcom_defconfig"
3838

39+
CONFIG_LIST = "${@" ".join(find_cfgs(d))}"
40+
CONFIG_LIST += "${@bb.utils.contains('DISTRO_FEATURES', 'hardened', '${S}/kernel/configs/hardening.config', '', d)}"
41+
3942
do_configure:prepend() {
4043
# Use a copy of the 'defconfig' from the actual repo to merge fragments
4144
cp ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${B}/.config
4245

4346
# Merge fragment for QCOM value add features
44-
${S}/scripts/kconfig/merge_config.sh -m -O ${B} ${B}/.config ${@" ".join(find_cfgs(d))}
47+
${S}/scripts/kconfig/merge_config.sh -m -O ${B} ${B}/.config ${CONFIG_LIST}
4548
}

0 commit comments

Comments
 (0)