summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2014-08-21 11:14:35 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-01 14:35:41 +0100
commit9a3292efcb3e6c6555cb23a19ebd4b2bb3d36374 (patch)
tree55e1d733d50d36bbb28e2abd431190a7d79a32a9 /meta/classes
parentcf8a0ac1b097a6790b4b02a86182764e3eecf581 (diff)
downloadpoky-9a3292efcb3e6c6555cb23a19ebd4b2bb3d36374.tar.gz
kernel-yocto: convert echo statements to bb* equivalents
Use the bbinfo, bberror, bbfatal equivalents to the existing echo statements within the kernel-yocto processing. This makes us consistent with the other messages from the build system. (From OE-Core rev: 1686d69de08bcecd39942802df18c4f0ca029ffe) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/kernel-yocto.bbclass54
1 files changed, 22 insertions, 32 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 4f912bff2f..ee09769d46 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -85,8 +85,7 @@ do_patch() {
85 85
86 createme ${createme_flags} ${ARCH} ${machine_branch} 86 createme ${createme_flags} ${ARCH} ${machine_branch}
87 if [ $? -ne 0 ]; then 87 if [ $? -ne 0 ]; then
88 echo "ERROR. Could not create ${machine_branch}" 88 bbfatal "Could not create ${machine_branch}"
89 exit 1
90 fi 89 fi
91 90
92 sccs="${@" ".join(find_sccs(d))}" 91 sccs="${@" ".join(find_sccs(d))}"
@@ -119,16 +118,14 @@ do_patch() {
119 updateme ${updateme_flags} -DKDESC=${KMACHINE}:${LINUX_KERNEL_TYPE} \ 118 updateme ${updateme_flags} -DKDESC=${KMACHINE}:${LINUX_KERNEL_TYPE} \
120 ${includes} ${addon_features} ${ARCH} ${KMACHINE} ${sccs} ${patches} 119 ${includes} ${addon_features} ${ARCH} ${KMACHINE} ${sccs} ${patches}
121 if [ $? -ne 0 ]; then 120 if [ $? -ne 0 ]; then
122 echo "ERROR. Could not update ${machine_branch}" 121 bbfatal "Could not update ${machine_branch}"
123 exit 1
124 fi 122 fi
125 123
126 # executes and modifies the source tree as required 124 # executes and modifies the source tree as required
127 patchme ${KMACHINE} 125 patchme ${KMACHINE}
128 if [ $? -ne 0 ]; then 126 if [ $? -ne 0 ]; then
129 echo "ERROR. Could not apply patches for ${KMACHINE}." 127 bberror "Could not apply patches for ${KMACHINE}."
130 echo " Patch failures can be resolved in the devshell (bitbake -c devshell ${PN})" 128 bbfatal "Patch failures can be resolved in the devshell (bitbake -c devshell ${PN})"
131 exit 1
132 fi 129 fi
133 130
134 # check to see if the specified SRCREV is reachable from the final branch. 131 # check to see if the specified SRCREV is reachable from the final branch.
@@ -136,9 +133,8 @@ do_patch() {
136 if [ "${machine_srcrev}" != "AUTOINC" ]; then 133 if [ "${machine_srcrev}" != "AUTOINC" ]; then
137 git merge-base --is-ancestor ${machine_srcrev} HEAD 134 git merge-base --is-ancestor ${machine_srcrev} HEAD
138 if [ $? -ne 0 ]; then 135 if [ $? -ne 0 ]; then
139 bbnote "ERROR: SRCREV ${machine_srcrev} was specified, but is not reachable" 136 bberror "SRCREV ${machine_srcrev} was specified, but is not reachable"
140 bbnote " Check the BSP description for incorrect branch selection, or other errors." 137 bbfatal "Check the BSP description for incorrect branch selection, or other errors."
141 exit 1
142 fi 138 fi
143 fi 139 fi
144} 140}
@@ -183,9 +179,8 @@ do_kernel_checkout() {
183 179
184 cd ${S} 180 cd ${S}
185 if [ ! -f "Makefile" ]; then 181 if [ ! -f "Makefile" ]; then
186 echo "[ERROR]: S is not set to the linux source directory. Check " 182 bberror "S is not set to the linux source directory. Check "
187 echo " the recipe and set S to the proper extracted subdirectory" 183 bbfatal "the recipe and set S to the proper extracted subdirectory"
188 exit 1
189 fi 184 fi
190 git init 185 git init
191 git add . 186 git add .
@@ -207,10 +202,9 @@ do_kernel_checkout() {
207 if [ -n "${KMETA}" ]; then 202 if [ -n "${KMETA}" ]; then
208 git show-ref --quiet --verify -- "refs/heads/${KMETA}" 203 git show-ref --quiet --verify -- "refs/heads/${KMETA}"
209 if [ $? -eq 1 ]; then 204 if [ $? -eq 1 ]; then
210 echo "ERROR. The branch '${KMETA}' is required and was not" 205 bberror "The branch '${KMETA}' is required and was not found"
211 echo "found. Ensure that the SRC_URI points to a valid linux-yocto" 206 bberror "Ensure that the SRC_URI points to a valid linux-yocto"
212 echo "kernel repository" 207 bbfatal "kernel repository"
213 exit 1
214 fi 208 fi
215 fi 209 fi
216 210
@@ -231,7 +225,7 @@ addtask kernel_checkout before do_patch after do_unpack
231 225
232do_kernel_configme[dirs] += "${S} ${B}" 226do_kernel_configme[dirs] += "${S} ${B}"
233do_kernel_configme() { 227do_kernel_configme() {
234 echo "[INFO] doing kernel configme" 228 bbnote "kernel configme"
235 export KMETA=${KMETA} 229 export KMETA=${KMETA}
236 230
237 if [ -n "${KCONFIG_MODE}" ]; then 231 if [ -n "${KCONFIG_MODE}" ]; then
@@ -248,8 +242,7 @@ do_kernel_configme() {
248 PATH=${PATH}:${S}/scripts/util 242 PATH=${PATH}:${S}/scripts/util
249 configme ${configmeflags} --reconfig --output ${B} ${LINUX_KERNEL_TYPE} ${KMACHINE} 243 configme ${configmeflags} --reconfig --output ${B} ${LINUX_KERNEL_TYPE} ${KMACHINE}
250 if [ $? -ne 0 ]; then 244 if [ $? -ne 0 ]; then
251 echo "ERROR. Could not configure ${KMACHINE}-${LINUX_KERNEL_TYPE}" 245 bbfatal "Could not configure ${KMACHINE}-${LINUX_KERNEL_TYPE}"
252 exit 1
253 fi 246 fi
254 247
255 echo "# Global settings from linux recipe" >> ${B}/.config 248 echo "# Global settings from linux recipe" >> ${B}/.config
@@ -295,19 +288,18 @@ do_validate_branches() {
295 # if SRCREV is AUTOREV it shows up as AUTOINC there's nothing to 288 # if SRCREV is AUTOREV it shows up as AUTOINC there's nothing to
296 # check and we can exit early 289 # check and we can exit early
297 if [ "${machine_srcrev}" = "AUTOINC" ]; then 290 if [ "${machine_srcrev}" = "AUTOINC" ]; then
298 bbnote "INFO: SRCREV validation is not required for AUTOREV or empty/invalid settings, returning" 291 bbnote "SRCREV validation is not required for AUTOREV"
299 elif [ "${machine_srcrev}" = "" ] && [ "${SRCREV}" != "AUTOINC" ]; then 292 elif [ "${machine_srcrev}" = "" ] && [ "${SRCREV}" != "AUTOINC" ]; then
300 # SRCREV_machine_<MACHINE> was not set. This means that a custom recipe 293 # SRCREV_machine_<MACHINE> was not set. This means that a custom recipe
301 # that doesn't use the SRCREV_FORMAT "machine_meta" is being built. In 294 # that doesn't use the SRCREV_FORMAT "machine_meta" is being built. In
302 # this case, we need to reset to the give SRCREV before heading to patching 295 # this case, we need to reset to the give SRCREV before heading to patching
303 bbnote "INFO: custom recipe is being built, forcing SRCREV to ${SRCREV}" 296 bbnote "custom recipe is being built, forcing SRCREV to ${SRCREV}"
304 force_srcrev="${SRCREV}" 297 force_srcrev="${SRCREV}"
305 else 298 else
306 git cat-file -t ${machine_srcrev} > /dev/null 299 git cat-file -t ${machine_srcrev} > /dev/null
307 if [ if $? -ne 0 ]; then 300 if [ if $? -ne 0 ]; then
308 echo "ERROR ${machine_srcrev} is not a valid commit ID." 301 bberror "${machine_srcrev} is not a valid commit ID."
309 echo "The kernel source tree may be out of sync" 302 bbfatal "The kernel source tree may be out of sync"
310 exit 1
311 fi 303 fi
312 force_srcrev=${machine_srcrev} 304 force_srcrev=${machine_srcrev}
313 fi 305 fi
@@ -315,23 +307,21 @@ do_validate_branches() {
315 ## KMETA branch validation. 307 ## KMETA branch validation.
316 target_meta_head="${SRCREV_meta}" 308 target_meta_head="${SRCREV_meta}"
317 if [ "${target_meta_head}" = "AUTOINC" ] || [ "${target_meta_head}" = "" ]; then 309 if [ "${target_meta_head}" = "AUTOINC" ] || [ "${target_meta_head}" = "" ]; then
318 bbnote "INFO: SRCREV validation skipped for AUTOREV or empty meta branch" 310 bbnote "SRCREV validation skipped for AUTOREV or empty meta branch"
319 else 311 else
320 meta_head=`git show-ref -s --heads ${KMETA}` 312 meta_head=`git show-ref -s --heads ${KMETA}`
321 313
322 git cat-file -t ${target_meta_head} > /dev/null 314 git cat-file -t ${target_meta_head} > /dev/null
323 if [ $? -ne 0 ]; then 315 if [ $? -ne 0 ]; then
324 echo "ERROR ${target_meta_head} is not a valid commit ID" 316 bberror "${target_meta_head} is not a valid commit ID"
325 echo "The kernel source tree may be out of sync" 317 bbfatal "The kernel source tree may be out of sync"
326 exit 1
327 fi 318 fi
328 if [ "$meta_head" != "$target_meta_head" ]; then 319 if [ "$meta_head" != "$target_meta_head" ]; then
329 echo "[INFO] Setting branch ${KMETA} to ${target_meta_head}" 320 bbnote "Setting branch ${KMETA} to ${target_meta_head}"
330 git branch -m ${KMETA} ${KMETA}-orig 321 git branch -m ${KMETA} ${KMETA}-orig
331 git checkout -q -b ${KMETA} ${target_meta_head} 322 git checkout -q -b ${KMETA} ${target_meta_head}
332 if [ $? -ne 0 ];then 323 if [ $? -ne 0 ];then
333 echo "ERROR: could not checkout ${KMETA} branch from known hash ${target_meta_head}" 324 bbfatal "Could not checkout ${KMETA} branch from known hash ${target_meta_head}"
334 exit 1
335 fi 325 fi
336 fi 326 fi
337 fi 327 fi