Skip to contentSkip to conversation

kernel-yocto.bbclass: fix failure to find defconfig

PATCH In review S. Lockwood-Childs 2 participants 2 messages Jul 4, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel-yocto.bbclass: fix failure to find defconfig

Fix build failure in do_kernel_metadata

do_kernel_metadata: Could not locate BSP definition for $MACHINE/standard
and no defconfig was provided

The original awk statements looking for the current MACHINE's defconfig expected to find an entry from SRC_URI that exactly matched 'defconfig'. In fact, the actual defconfig entry in SRC_URI had been resolved to a full path inside the working dir, e.g. '/path/to/workdir/defconfig'

Instead of an exact match, use a looser criteria of matching (or not matching) 'defconfig' as a word in the current record, which still works if there is a path in front of it. This should achieve the intended objective of splitting the list into defconfig and non-defconfig entries.

---
 meta/classes/kernel-yocto.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/kernel-yocto.bbclass +2 -2
index 41d8620e67..97d6f61850 100644
@@ -156,9 +156,9 @@ do_kernel_metadata() {
 	# a quick check to make sure we don't have duplicate defconfigs If
 	# there's a defconfig in the SRC_URI, did we also have one from the
 	# KBUILD_DEFCONFIG processing above ?
-	src_uri_defconfig=$(echo $sccs_from_src_uri | awk '{ if ($0=="defconfig") { print $0 } }' RS=' ')
+	src_uri_defconfig=$(echo $sccs_from_src_uri | awk '/\<defconfig\>/ { print $0 }' RS=' ')
 	# drop and defconfig's from the src_uri variable, we captured it just above here if it existed
-	sccs_from_src_uri=$(echo $sccs_from_src_uri | awk '{ if ($0!="defconfig") { print $0 } }' RS=' ')
+	sccs_from_src_uri=$(echo $sccs_from_src_uri | awk '!/\<defconfig\>/ { print $0 }' RS=' ')
 	if [ -n "$in_tree_defconfig" ]; then
 		sccs_defconfig=$in_tree_defconfig
 		if [ -n "$src_uri_defconfig" ]; then
Signature · 1 line
2.20.1
#1 lore raw
Quoted 11 lines · S. Lockwood-Childs

Fix build failure in do_kernel_metadata

do_kernel_metadata: Could not locate BSP definition for $MACHINE/standard
and no defconfig was provided

The original awk statements looking for the current MACHINE's defconfig expected to find an entry from SRC_URI that exactly matched 'defconfig'. In fact, the actual defconfig entry in SRC_URI had been resolved to a full path inside the working dir, e.g. '/path/to/workdir/defconfig'

Quoted 5 lines

Instead of an exact match, use a looser criteria of matching (or not matching) 'defconfig' as a word in the current record, which still works if there is a path in front of it. This should achieve the intended objective of splitting the list into defconfig and non-defconfig entries.

We already have a patch on the list for this.

Cheers,

Bruce

Quoted 26 lines
---
 meta/classes/kernel-yocto.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/kernel-yocto.bbclass +2 -3
index 41d8620e67..97d6f61850 100644
@@ -156,9 +156,9 @@ do_kernel_metadata() {
        # a quick check to make sure we don't have duplicate defconfigs If
        # there's a defconfig in the SRC_URI, did we also have one from the
        # KBUILD_DEFCONFIG processing above ?
-       src_uri_defconfig=$(echo $sccs_from_src_uri | awk '{ if ($0=="defconfig") { print $0 } }' RS=' ')
+       src_uri_defconfig=$(echo $sccs_from_src_uri | awk '/\<defconfig\>/ { print $0 }' RS=' ')
        # drop and defconfig's from the src_uri variable, we captured it just above here if it existed
-       sccs_from_src_uri=$(echo $sccs_from_src_uri | awk '{ if ($0!="defconfig") { print $0 } }' RS=' ')
+       sccs_from_src_uri=$(echo $sccs_from_src_uri | awk '!/\<defconfig\>/ { print $0 }' RS=' ')
        if [ -n "$in_tree_defconfig" ]; then
                sccs_defconfig=$in_tree_defconfig
                if [ -n "$src_uri_defconfig" ]; then
--

2.20.1

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II