Skip to contentSkip to conversation

kernel/yocto: fix search for defconfig from src_uri

PATCH In review Andrey Zhizhikin 3 participants 5 messages Jul 1, 2020 – Jul 5, 2020 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 kernel/yocto: fix search for defconfig from src_uri

Fetcher provides full paths to defconfig and scc files, which awk comparison operator does not catch during construction of src_uri_defconfig and sccs_from_src_uri lists. This causes the src_uri_defconfig variable to come out empty, and fails further validation if defconfig is only supplied via SRC_URI.

Replace comparison operator with awk match function which searches for sub-string during filtering, effectively placing defconfig from SRC_URI into src_uri_defconfig and scc files in sccs_from_src_uri respectively.

Fixes 23dcff0d396c (kernel/yocto: ensure that defconfigs are processed first)
Cc Bruce Ashfield <[email protected]>
---
 meta/classes/kernel-yocto.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/classes/kernel-yocto.bbclass +3 -2
index 41d8620e67..54a1a1627a 100644
@@ -156,9 +156,10 @@ 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 '(match($0, "defconfig") != 0) { 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 '(match($0, "defconfig") == 0) { print $0 }' RS=' ')
+
 	if [ -n "$in_tree_defconfig" ]; then
 		sccs_defconfig=$in_tree_defconfig
 		if [ -n "$src_uri_defconfig" ]; then
Signature · 1 line
2.17.1
Acked-by on v2 1/1
#1 lore raw
Quoted 7 lines · Andrey Zhizhikin

Fetcher provides full paths to defconfig and scc files, which awk comparison operator does not catch during construction of src_uri_defconfig and sccs_from_src_uri lists. This causes the src_uri_defconfig variable to come out empty, and fails further validation if defconfig is only supplied via SRC_URI.

Quoted 5 lines

Replace comparison operator with awk match function which searches for sub-string during filtering, effectively placing defconfig from SRC_URI into src_uri_defconfig and scc files in sccs_from_src_uri respectively.

Fixes 23dcff0d396c (kernel/yocto: ensure that defconfigs are processed first)

v2 passes my testing as well. The autobuilder gets the final say, but I can't see this causing any issues.

Quoted 26 lines
---
 meta/classes/kernel-yocto.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/classes/kernel-yocto.bbclass +3 -3
index 41d8620e67..54a1a1627a 100644
@@ -156,9 +156,10 @@ 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 '(match($0, "defconfig") != 0) { 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 '(match($0, "defconfig") == 0) { print $0 }' RS=' ')
+
        if [ -n "$in_tree_defconfig" ]; then
                sccs_defconfig=$in_tree_defconfig
                if [ -n "$src_uri_defconfig" ]; then
--

2.17.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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 13 lines · Bruce Ashfield via lists.openembedded.org
Quoted 11 lines · Andrey Zhizhikin

Fetcher provides full paths to defconfig and scc files, which awk comparison operator does not catch during construction of src_uri_defconfig and sccs_from_src_uri lists. This causes the src_uri_defconfig variable to come out empty, and fails further validation if defconfig is only supplied via SRC_URI.

Replace comparison operator with awk match function which searches for sub-string during filtering, effectively placing defconfig from SRC_URI into src_uri_defconfig and scc files in sccs_from_src_uri respectively.

Quoted 6 lines
Quoted 1 line
Fixes 23dcff0d396c (kernel/yocto: ensure that defconfigs are processed first)

v2 passes my testing as well. The autobuilder gets the final say, but I can't see this causing any issues.

Richard,

I didn't see this on master-next, and we got a different patch for this on the list .. this is the preferred fix for readabilty.

I just wanted to make sure you weren't waiting for me to send it in my next pull request. I can absolutely do that if you want.

Cheers,

Bruce

Quoted 35 lines
Quoted 24 lines
---
 meta/classes/kernel-yocto.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/classes/kernel-yocto.bbclass +3 -3
index 41d8620e67..54a1a1627a 100644
@@ -156,9 +156,10 @@ 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 '(match($0, "defconfig") != 0) { 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 '(match($0, "defconfig") == 0) { print $0 }' RS=' ')
+
        if [ -n "$in_tree_defconfig" ]; then
                sccs_defconfig=$in_tree_defconfig
                if [ -n "$src_uri_defconfig" ]; then
--
Quoted 2 lines

2.17.1

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

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
#4 lore raw
Quoted 26 lines · Bruce Ashfield
Quoted 15 lines · Bruce Ashfield via lists.openembedded.org
Quoted 13 lines · Andrey Zhizhikin

Fetcher provides full paths to defconfig and scc files, which awk comparison operator does not catch during construction of src_uri_defconfig and sccs_from_src_uri lists. This causes the src_uri_defconfig variable to come out empty, and fails further validation if defconfig is only supplied via SRC_URI.

Replace comparison operator with awk match function which searches for
sub-string during filtering, effectively placing defconfig from SRC_URI
into src_uri_defconfig and scc files in sccs_from_src_uri respectively.

Quoted 7 lines
Quoted 2 lines
Fixes 23dcff0d396c (kernel/yocto: ensure that defconfigs are

processed first)

v2 passes my testing as well. The autobuilder gets the final say, but
I can't see this causing any issues.

Quoted 8 lines

Richard,

I didn't see this on master-next, and we got a different patch for this on the list .. this is the preferred fix for readabilty.

I just wanted to make sure you weren't waiting for me to send it in my
next pull request. I can absolutely do that if you want.

I was waiting for some indication on your thoughts, I'll queue it :)

Cheers,

Richard

#5 lore raw
Quoted 30 lines · Richard Purdie
Quoted 28 lines · Bruce Ashfield
Quoted 15 lines · Bruce Ashfield via lists.openembedded.org
Quoted 13 lines · Andrey Zhizhikin

Fetcher provides full paths to defconfig and scc files, which awk comparison operator does not catch during construction of src_uri_defconfig and sccs_from_src_uri lists. This causes the src_uri_defconfig variable to come out empty, and fails further validation if defconfig is only supplied via SRC_URI.

Replace comparison operator with awk match function which searches for
sub-string during filtering, effectively placing defconfig from SRC_URI
into src_uri_defconfig and scc files in sccs_from_src_uri respectively.

Quoted 7 lines
Quoted 2 lines
Fixes 23dcff0d396c (kernel/yocto: ensure that defconfigs are

processed first)

v2 passes my testing as well. The autobuilder gets the final say, but
I can't see this causing any issues.

Richard,

Quoted 8 lines
Quoted 6 lines

I didn't see this on master-next, and we got a different patch for this on the list .. this is the preferred fix for readabilty.

I just wanted to make sure you weren't waiting for me to send it in my
next pull request. I can absolutely do that if you want.

I was waiting for some indication on your thoughts, I'll queue it :)

cool. I do appreciate that .. I realized you probably were waiting when I wasn't super clear on my last reply.

It isn't that it was urgent, I just wanted to make sure I hadn't dropped the ball on it.

Bruce

Quoted 5 lines

Cheers,

Richard

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