diff options
author | Stefan Berger <stefanb@linux.ibm.com> | 2023-05-10 10:51:24 -0400 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2023-05-13 06:06:29 -0400 |
commit | 504f402ac5332d554ae38ac3381b153b3b640c3c (patch) | |
tree | 4bbeef09b5cf7b2975f06208cfc3207fd2e8184b | |
parent | 5dff4e47af3996ea4c4fbbaaae1c9358cce67d1d (diff) | |
download | meta-security-504f402ac5332d554ae38ac3381b153b3b640c3c.tar.gz |
integrity: Fix the do_configure function
Append ':append' to do_configure so it does not replace all existing
do_configure's.
Only run 'sed' when DISTRO_FEATURES contains 'ima' and the .config file
exists.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r-- | meta-integrity/recipes-kernel/linux/linux_ima.inc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/meta-integrity/recipes-kernel/linux/linux_ima.inc b/meta-integrity/recipes-kernel/linux/linux_ima.inc index 0b6f530..7016800 100644 --- a/meta-integrity/recipes-kernel/linux/linux_ima.inc +++ b/meta-integrity/recipes-kernel/linux/linux_ima.inc | |||
@@ -4,8 +4,10 @@ SRC_URI += " \ | |||
4 | ${@bb.utils.contains('DISTRO_FEATURES', 'ima', 'file://ima.scc', '', d)} \ | 4 | ${@bb.utils.contains('DISTRO_FEATURES', 'ima', 'file://ima.scc', '', d)} \ |
5 | " | 5 | " |
6 | 6 | ||
7 | do_configure() { | 7 | do_configure:append() { |
8 | sed -i "s|^CONFIG_SYSTEM_TRUSTED_KEYS=.*|CONFIG_SYSTEM_TRUSTED_KEYS=\"${IMA_EVM_ROOT_CA}\"|" .config | 8 | if [ "${@bb.utils.contains('DISTRO_FEATURES', 'ima', 'yes', '', d)}" = "yes" ] && [ -f .config ] ; then |
9 | sed -i "s|^CONFIG_SYSTEM_TRUSTED_KEYS=.*|CONFIG_SYSTEM_TRUSTED_KEYS=\"${IMA_EVM_ROOT_CA}\"|" .config | ||
10 | fi | ||
9 | } | 11 | } |
10 | 12 | ||
11 | KERNEL_FEATURES:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'modsign', ' features/ima/modsign.scc', '', d)}" | 13 | KERNEL_FEATURES:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'modsign', ' features/ima/modsign.scc', '', d)}" |