diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-08-03 08:30:27 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-06 15:12:39 +0100 |
commit | 2b44ac076c7068aa0316d15fff49f02491eccb69 (patch) | |
tree | 287dd45c9853911f96c8189070d566247b068a8b /meta | |
parent | bb983b8f80c0dd33ae00a75b91a4cc5a10120aa9 (diff) | |
download | poky-2b44ac076c7068aa0316d15fff49f02491eccb69.tar.gz |
kernel/yocto: allow dangling KERNEL_FEATURES
KERNEL_FEATURES are explicitly checked by the kern-tools, and trigger
and error when not present. This is since the KERNEL_FEATURES are
specified by layers or BSPs as elements that are requied for correct
operation.
That being said, in order to support more kernel recipes that are using
fragments, but not necessarily the yocto kernel-cache for meta-data,
this change introduces: KERNEL_DANGLING_FEATURES_WARN_ONLY
As you'd expect, when set, missing kernel features only print a
message and warn that runtime issues may occur, but otherwise allow
the kernel configuration and build process to continue.
This was noticed/required when meta-virtualization adopted a more
generic kernel bbappend (to serve the needs of more layers in the
ecosystem), but also specifies some KERNEL_FEATURES. If layers using
a recipe derived from kernel-yocto, but not the main kernel-cache,
used meta-virtualization and error would be thrown due to missing
features. We now can both allow them to continue, and also provide
a more useful message to resolve the issue.
(From OE-Core rev: 8d44ea9fbb1ee7bec1062505a9bb1e2d7b360094)
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/kernel-yocto.bbclass | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass index 3311f6e84e..70818cc01c 100644 --- a/meta/classes/kernel-yocto.bbclass +++ b/meta/classes/kernel-yocto.bbclass | |||
@@ -212,11 +212,36 @@ do_kernel_metadata() { | |||
212 | fi | 212 | fi |
213 | meta_dir=$(kgit --meta) | 213 | meta_dir=$(kgit --meta) |
214 | 214 | ||
215 | KERNEL_FEATURES_FINAL="" | ||
216 | if [ -n "${KERNEL_FEATURES}" ]; then | ||
217 | for feature in ${KERNEL_FEATURES}; do | ||
218 | feature_found=f | ||
219 | for d in $includes; do | ||
220 | path_to_check=$(echo $d | sed 's/-I//g') | ||
221 | if [ "$feature_found" = "f" ] && [ -e "$path_to_check/$feature" ]; then | ||
222 | feature_found=t | ||
223 | fi | ||
224 | done | ||
225 | if [ "$feature_found" = "f" ]; then | ||
226 | if [ -n "${KERNEL_DANGLING_FEATURES_WARN_ONLY}" ]; then | ||
227 | bbwarn "Feature '$feature' not found, but KERNEL_DANGLING_FEATURES_WARN_ONLY is set" | ||
228 | bbwarn "This may cause runtime issues, dropping feature and allowing configuration to continue" | ||
229 | else | ||
230 | bberror "Feature '$feature' not found, this will cause configuration failures." | ||
231 | bberror "Check the SRC_URI for meta-data repositories or directories that may be missing" | ||
232 | bbfatal_log "Set KERNEL_DANGLING_FEATURES_WARN_ONLY to ignore this issue" | ||
233 | fi | ||
234 | else | ||
235 | KERNEL_FEATURES_FINAL="$KERNEL_FEATURES_FINAL $feature" | ||
236 | fi | ||
237 | done | ||
238 | fi | ||
239 | |||
215 | # run1: pull all the configuration fragments, no matter where they come from | 240 | # run1: pull all the configuration fragments, no matter where they come from |
216 | elements="`echo -n ${bsp_definition} $sccs_defconfig ${sccs} ${patches} ${KERNEL_FEATURES}`" | 241 | elements="`echo -n ${bsp_definition} $sccs_defconfig ${sccs} ${patches} $KERNEL_FEATURES_FINAL`" |
217 | if [ -n "${elements}" ]; then | 242 | if [ -n "${elements}" ]; then |
218 | echo "${bsp_definition}" > ${S}/${meta_dir}/bsp_definition | 243 | echo "${bsp_definition}" > ${S}/${meta_dir}/bsp_definition |
219 | scc --force -o ${S}/${meta_dir}:cfg,merge,meta ${includes} $sccs_defconfig $bsp_definition $sccs $patches ${KERNEL_FEATURES} | 244 | scc --force -o ${S}/${meta_dir}:cfg,merge,meta ${includes} $sccs_defconfig $bsp_definition $sccs $patches $KERNEL_FEATURES_FINAL |
220 | if [ $? -ne 0 ]; then | 245 | if [ $? -ne 0 ]; then |
221 | bbfatal_log "Could not generate configuration queue for ${KMACHINE}." | 246 | bbfatal_log "Could not generate configuration queue for ${KMACHINE}." |
222 | fi | 247 | fi |
@@ -230,9 +255,9 @@ do_kernel_metadata() { | |||
230 | fi | 255 | fi |
231 | 256 | ||
232 | # run2: only generate patches for elements that have been passed on the SRC_URI | 257 | # run2: only generate patches for elements that have been passed on the SRC_URI |
233 | elements="`echo -n ${sccs} ${patches} ${KERNEL_FEATURES}`" | 258 | elements="`echo -n ${sccs} ${patches} $KERNEL_FEATURES_FINAL`" |
234 | if [ -n "${elements}" ]; then | 259 | if [ -n "${elements}" ]; then |
235 | scc --force -o ${S}/${meta_dir}:patch --cmds patch ${includes} ${sccs} ${patches} ${KERNEL_FEATURES} | 260 | scc --force -o ${S}/${meta_dir}:patch --cmds patch ${includes} ${sccs} ${patches} $KERNEL_FEATURES_FINAL |
236 | if [ $? -ne 0 ]; then | 261 | if [ $? -ne 0 ]; then |
237 | bbfatal_log "Could not generate configuration queue for ${KMACHINE}." | 262 | bbfatal_log "Could not generate configuration queue for ${KMACHINE}." |
238 | fi | 263 | fi |