From: Bruce Ashfield Date: Tue, 30 Aug 2016 16:49:05 +0000 (-0400) Subject: kernel-yocto: test for empty artifacts X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbb3ea811665d3af10f883816043f79ee7d6df21;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git kernel-yocto: test for empty artifacts With the updated kernel tools, we generate a list of sccs, patches, configs and BSP definitions as part of the meta data generation. It is valid if there aren't any of these artifacts found (i.e. you are just building a branch and a default config), but invoking the tools with no inputs isn't a good idea. To avoid this issue, we generate a string based on the artifacts and skip calling the tools if there's nothing to do. Signed-off-by: Bruce Ashfield Signed-off-by: Richard Purdie --- diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass index 8650e55de72..9b8bab63ca0 100644 --- a/meta/classes/kernel-yocto.bbclass +++ b/meta/classes/kernel-yocto.bbclass @@ -139,10 +139,16 @@ do_kernel_metadata() { meta_dir=$(kgit --meta) # run1: pull all the configuration fragments, no matter where they come from - scc --force -o ${S}/${meta_dir}:cfg,meta ${includes} ${bsp_definition} ${sccs} ${patches} ${KERNEL_FEATURES} + elements="`echo -n ${bsp_definition} ${sccs} ${patches} ${KERNEL_FEATURES}`" + if [ -n "${elements}" ]; then + scc --force -o ${S}/${meta_dir}:cfg,meta ${includes} ${bsp_definition} ${sccs} ${patches} ${KERNEL_FEATURES} + fi # run2: only generate patches for elements that have been passed on the SRC_URI - scc --force -o ${S}/${meta_dir}:patch --cmds patch ${includes} ${sccs} ${patches} ${KERNEL_FEATURES} + elements="`echo -n ${sccs} ${patches} ${KERNEL_FEATURES}`" + if [ -n "${elements}" ]; then + scc --force -o ${S}/${meta_dir}:patch --cmds patch ${includes} ${sccs} ${patches} ${KERNEL_FEATURES} + fi } do_patch() {