diff options
author | Martin Borg <martin.borg@enea.com> | 2017-12-04 11:40:35 +0100 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2017-12-04 12:54:04 +0100 |
commit | 0523369959a0858f2b3e017e10ffa2b4de428c8c (patch) | |
tree | 13aee794c8a8f033b3ec49920ecfb26892f58fb4 /recipes-kernel | |
parent | e45a3b5c4aff9a2462e32c1b3c9c94d0dfa78101 (diff) | |
download | meta-nfv-access-common-0523369959a0858f2b3e017e10ffa2b4de428c8c.tar.gz |
spp: only return files that match KMACHINE and KTYPE
The search utility of spp was incorrect and was returning files
that matched only a defined ktype.
This leads to the system potentially building the wrong BSP, and
not being able to report an error.
We fix the search to only return files that match both ktype and
kmachine, as well as return 0/1 for success/fail in the search.
Patch backported from yocto-kernel-tools master branch:
http://git.yoctoproject.org/cgit/cgit.cgi/yocto-kernel-tools/commit/?id=0571411cc033c11df7827508dd786876ce2f8c83
Signed-off-by: Martin Borg <martin.borg@enea.com>
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
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.patch | 85 | ||||
-rw-r--r-- | recipes-kernel/kern-tools/kern-tools-native_git.bbappend | 3 |
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 @@ | |||
1 | From da7a349f731714b4a7ee98974e1d0979308b4abb Mon Sep 17 00:00:00 2001 | ||
2 | From: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
3 | Date: Tue, 15 Aug 2017 16:56:45 -0400 | ||
4 | Subject: [PATCH] spp: only return files that match KMACHINE and KTYPE | ||
5 | |||
6 | The search utility of spp was incorrect and was returning files | ||
7 | that matched only a defined ktype. | ||
8 | |||
9 | This leads to the system potentially building the wrong BSP, and | ||
10 | not being able to report an error. | ||
11 | |||
12 | We fix the search to only return files that match both ktype and | ||
13 | kmachine, as well as return 0/1 for success/fail in the search. | ||
14 | |||
15 | Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
16 | --- | ||
17 | tools/spp | 26 +++++++++++++++++++------- | ||
18 | 1 file changed, 19 insertions(+), 7 deletions(-) | ||
19 | |||
20 | diff --git a/git/tools/spp b/git/tools/spp | ||
21 | index 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 | -- | ||
84 | 2.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 @@ | |||
1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-git:" | ||
2 | |||
3 | SRC_URI += "file://0001-spp-only-return-files-that-match-KMACHINE-and-KTYPE.patch" | ||