summaryrefslogtreecommitdiffstats
path: root/recipes-kernel
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel')
-rw-r--r--recipes-kernel/kern-tools/kern-tools-native-git/0001-spp-only-return-files-that-match-KMACHINE-and-KTYPE.patch85
-rw-r--r--recipes-kernel/kern-tools/kern-tools-native_git.bbappend3
2 files changed, 88 insertions, 0 deletions
diff --git a/recipes-kernel/kern-tools/kern-tools-native-git/0001-spp-only-return-files-that-match-KMACHINE-and-KTYPE.patch b/recipes-kernel/kern-tools/kern-tools-native-git/0001-spp-only-return-files-that-match-KMACHINE-and-KTYPE.patch
new file mode 100644
index 0000000..980dba2
--- /dev/null
+++ b/recipes-kernel/kern-tools/kern-tools-native-git/0001-spp-only-return-files-that-match-KMACHINE-and-KTYPE.patch
@@ -0,0 +1,85 @@
1From da7a349f731714b4a7ee98974e1d0979308b4abb Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@windriver.com>
3Date: Tue, 15 Aug 2017 16:56:45 -0400
4Subject: [PATCH] spp: only return files that match KMACHINE and KTYPE
5
6The search utility of spp was incorrect and was returning files
7that matched only a defined ktype.
8
9This leads to the system potentially building the wrong BSP, and
10not being able to report an error.
11
12We fix the search to only return files that match both ktype and
13kmachine, as well as return 0/1 for success/fail in the search.
14
15Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
16---
17 tools/spp | 26 +++++++++++++++++++-------
18 1 file changed, 19 insertions(+), 7 deletions(-)
19
20diff --git a/git/tools/spp b/git/tools/spp
21index 4345a0d..7155166 100755
22--- a/git/tools/spp
23+++ b/git/tools/spp
24@@ -178,7 +178,7 @@ search_includes_for_defines()
25 done
26
27 if [ -n "${verbose}" ]; then
28- echo "checking $scc ($score)" >&2
29+ >&2 echo "checking $scc ($score)" >&2
30 fi
31
32 if [ $score -gt $max_score ]; then
33@@ -189,11 +189,17 @@ search_includes_for_defines()
34 fi
35 done
36
37- # return the first target found (among equals)
38- rstring="$(echo $found_scc | cut -f2 -d' ')"
39+ if [ -n "${verbose}" ]; then
40+ >&2 echo "score: $max_score"
41+ fi
42
43- # .. and add the score
44- echo "$rstring:$max_score"
45+ if [ $max_score -gt 0 ]; then
46+ # return the first target found (among equals)
47+ rstring="$(echo $found_scc | cut -f2 -d' ')"
48+
49+ # .. and add the score
50+ echo "$rstring:$max_score"
51+ fi
52 }
53
54 search_include_paths()
55@@ -306,7 +312,7 @@ if [ -n "${do_find}" ]; then
56 fi
57
58 # are we looking for a machine/kernel match ?
59- if [ -n"${KMACHINE}" ] && [ -n "${KTYPE}" ]; then
60+ if [ -n "${KMACHINE}" ] && [ -n "${KTYPE}" ]; then
61 found=$(search_includes_for_defines ${KMACHINE})
62 found_file=$(echo $found | cut -d: -f1)
63 found_score=$(echo $found | cut -d: -f2)
64@@ -317,11 +323,17 @@ if [ -n "${do_find}" ]; then
65 found=$(search_includes_for_defines ${KMACHINE}:${KTYPE})
66 found_file2=$(echo $found | cut -d: -f1)
67 found_score2=$(echo $found | cut -d: -f2)
68+
69 if [ "${found_score2}" == "2" ]; then
70 found_file=${found_file2}
71 found_score=${found_score2}
72 fi
73- echo "${found_file}"
74+
75+ if [ -n "${found_file}" ]; then
76+ echo "${found_file}"
77+ else
78+ exit 1
79+ fi
80 fi
81
82 # or are we looking for a file in particular ?
83--
842.7.4
85
diff --git a/recipes-kernel/kern-tools/kern-tools-native_git.bbappend b/recipes-kernel/kern-tools/kern-tools-native_git.bbappend
new file mode 100644
index 0000000..748d52b
--- /dev/null
+++ b/recipes-kernel/kern-tools/kern-tools-native_git.bbappend
@@ -0,0 +1,3 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-git:"
2
3SRC_URI += "file://0001-spp-only-return-files-that-match-KMACHINE-and-KTYPE.patch"