diff options
author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2012-04-13 16:55:44 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-04-13 22:44:46 +0100 |
commit | ee71422b9893f9f77173fb2612d1ffbbc68643c3 (patch) | |
tree | 2e46e78892f6f194a105451816b636168dd0b893 /meta/classes/kernel-yocto.bbclass | |
parent | 25b48c68df688e96c6b82c8144d9543d51a8ba1f (diff) | |
download | poky-ee71422b9893f9f77173fb2612d1ffbbc68643c3.tar.gz |
linux-yocto: allow .cfg, .scc, .patch and defconfigs to be processed in order
During testing/extension of the linux-yocto-tiny kernel it was found that
defconfigs were not always properly applied. This was due to two issues:
- not being able to fully control the order of objects applied to the
git tree on the SRC_URI
- defconfigs triggering --allnoconfig before being applied
To fix this, the recipe space code that previously detected and generated
automatic features moves back to the kernel tools (where it was before) and
is updated to also process .cfg and defconfigs. Moving this back to the
tools allow other recipes to automatically benefit from the additional
support.
The second issue is addressed by allowing configme to take --alldefconfig
when a recipe wishes to pass a defconfig and override the default
behaviour.
Fixes [YOCTO: 2250]
(From OE-Core rev: 08c368b9980716e459d846dd7183940a5bf8bea4)
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel-yocto.bbclass')
-rw-r--r-- | meta/classes/kernel-yocto.bbclass | 74 |
1 files changed, 7 insertions, 67 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass index b7e8b3243f..0caf6a67f0 100644 --- a/meta/classes/kernel-yocto.bbclass +++ b/meta/classes/kernel-yocto.bbclass | |||
@@ -20,7 +20,9 @@ def find_sccs(d): | |||
20 | sources_list=[] | 20 | sources_list=[] |
21 | for s in sources: | 21 | for s in sources: |
22 | base, ext = os.path.splitext(os.path.basename(s)) | 22 | base, ext = os.path.splitext(os.path.basename(s)) |
23 | if ext and ext in ('.scc'): | 23 | if ext and ext in ('.scc' '.cfg' '.patch'): |
24 | sources_list.append(s) | ||
25 | elif base and base in 'defconfig': | ||
24 | sources_list.append(s) | 26 | sources_list.append(s) |
25 | 27 | ||
26 | return sources_list | 28 | return sources_list |
@@ -73,72 +75,9 @@ do_patch() { | |||
73 | fi | 75 | fi |
74 | 76 | ||
75 | sccs="${@" ".join(find_sccs(d))}" | 77 | sccs="${@" ".join(find_sccs(d))}" |
76 | patches_and_dirs="${@" ".join(find_urls(d))}" | 78 | patches="${@" ".join(find_patches(d))}" |
77 | |||
78 | # This loops through all patches, and looks for directories that do | ||
79 | # not already have feature descriptions. If a directory doesn't have | ||
80 | # a feature description, we switch to the ${WORKDIR} variant of the | ||
81 | # feature (so we can write to it) and generate a feature for those | ||
82 | # patches. The generated feature will respect the patch order. | ||
83 | # | ||
84 | # By leaving source patch directories that already have .scc files | ||
85 | # as-is it means that a SRC_URI can only contain a .scc file, and all | ||
86 | # patches that the .scc references will be picked up, without having | ||
87 | # to be repeated on the SRC_URI line .. which is more intutive | ||
88 | set +e | ||
89 | patch_dirs= | ||
90 | for pp in ${patches_and_dirs}; do | ||
91 | p=`echo $pp | cut -f1 -d:` | ||
92 | wp=`echo $pp | cut -f2 -d:` | ||
93 | pdir=`dirname ${p}` | ||
94 | pname=`basename ${p}` | ||
95 | scc=`find ${pdir} -maxdepth 1 -name '*.scc'` | ||
96 | if [ -z "${scc}" ]; then | ||
97 | # there is no scc file. We need to switch to someplace that we know | ||
98 | # we can create content (the workdir) | ||
99 | workdir_subdir=`dirname ${wp}` | ||
100 | suggested_dir="${WORKDIR}/${workdir_subdir}" | ||
101 | echo ${gen_feature_dirs} | grep -q ${suggested_dir} | ||
102 | if [ $? -ne 0 ]; then | ||
103 | gen_feature_dirs="${gen_feature_dirs} ${suggested_dir}" | ||
104 | fi | ||
105 | # we call the file *.scc_tmp, so the test above will continue to find | ||
106 | # that patches from a common subdirectory don't have a scc file and | ||
107 | # they'll be placed in order, into this file. We'll rename it later. | ||
108 | gen_feature_name="gen_`echo ${workdir_subdir} | sed 's%/%%g'`_desc.scc_tmp" | ||
109 | echo "patch ${pname}" >> ${WORKDIR}/${workdir_subdir}/${gen_feature_name} | ||
110 | else | ||
111 | suggested_dir="${pdir}" | ||
112 | fi | ||
113 | echo ${patch_dirs} | grep -q ${suggested_dir} | ||
114 | if [ $? -ne 0 ]; then | ||
115 | patch_dirs="${patch_dirs} ${suggested_dir}" | ||
116 | fi | ||
117 | done | ||
118 | |||
119 | # look for any found scc files, and ensure they are added to the list | ||
120 | # of directories passsed to updateme | ||
121 | for s in ${sccs}; do | ||
122 | sdir=`dirname ${s}` | ||
123 | echo ${patch_dirs} | grep -q ${sdir} | ||
124 | if [ $? -ne 0 ]; then | ||
125 | patch_dirs="${patch_dirs} ${sdir}" | ||
126 | fi | ||
127 | done | ||
128 | |||
129 | # go through the patch directories and look for any scc feature files | ||
130 | # that were constructed above. If one is found, rename it to ".scc" so | ||
131 | # the kernel patching can see it. | ||
132 | for pdir in ${patch_dirs}; do | ||
133 | scc=`find ${pdir} -maxdepth 1 -name '*.scc_tmp'` | ||
134 | if [ -n "${scc}" ]; then | ||
135 | new_scc=`echo ${scc} | sed 's/_tmp//'` | ||
136 | mv -f ${scc} ${new_scc} | ||
137 | fi | ||
138 | done | ||
139 | |||
140 | patch_dirs="${patch_dirs} ${WORKDIR}" | ||
141 | 79 | ||
80 | set +e | ||
142 | # add any explicitly referenced features onto the end of the feature | 81 | # add any explicitly referenced features onto the end of the feature |
143 | # list that is passed to the kernel build scripts. | 82 | # list that is passed to the kernel build scripts. |
144 | if [ -n "${KERNEL_FEATURES}" ]; then | 83 | if [ -n "${KERNEL_FEATURES}" ]; then |
@@ -146,9 +85,10 @@ do_patch() { | |||
146 | addon_features="$addon_features --feature $feat" | 85 | addon_features="$addon_features --feature $feat" |
147 | done | 86 | done |
148 | fi | 87 | fi |
88 | |||
149 | # updates or generates the target description | 89 | # updates or generates the target description |
150 | updateme --branch ${kbranch} -DKDESC=${KMACHINE}:${LINUX_KERNEL_TYPE} \ | 90 | updateme --branch ${kbranch} -DKDESC=${KMACHINE}:${LINUX_KERNEL_TYPE} \ |
151 | ${addon_features} ${ARCH} ${KMACHINE} ${patch_dirs} | 91 | ${addon_features} ${ARCH} ${KMACHINE} ${sccs} ${patches} |
152 | if [ $? -ne 0 ]; then | 92 | if [ $? -ne 0 ]; then |
153 | echo "ERROR. Could not update ${kbranch}" | 93 | echo "ERROR. Could not update ${kbranch}" |
154 | exit 1 | 94 | exit 1 |