diff options
author | 2019-07-30 23:43:25 +0000 | |
---|---|---|
committer | 2019-08-15 17:27:54 -0700 | |
commit | a0cec9bc3ea52c373a93ddd5d3356927a121f9b4 (patch) | |
tree | b73c7774316bb471f0881627107d8f301a11a317 | |
parent | 16b536092def8b567681e1519cdb786e51a33610 (diff) | |
download | meta-xilinx-a0cec9bc3ea52c373a93ddd5d3356927a121f9b4.tar.gz meta-xilinx-a0cec9bc3ea52c373a93ddd5d3356927a121f9b4.tar.bz2 meta-xilinx-a0cec9bc3ea52c373a93ddd5d3356927a121f9b4.zip |
kernel-simpleimage.bbclass: Fix do_prep_simpleimage `[[: not found`
While developing a custom MicroBlaze machine configuration with
meta-xilinx-bsp, the linux-xlnx recipe would fail when configured to use
the “simpleImage.devicetree-name” kernel image type.
Though the do_prep_simpleimage task does not fail, messages were left in
the log indicating the “[[“ bash extension could not be found.
DEBUG: Executing shell function do_prep_simpleimage
temp/run.do_prep_simpleimage.66740:
[[: not found
DEBUG: Shell function do_prep_simpleimage finished
The two offending lines are in kernel-simpleimage.bbclass. Here's one of
them for reference.
if [[ "${type}" =~ "simpleImage" ]] && [ ${ARCH} = "microblaze" ]; then
The problem is that “[[“ will return -1 since the extension is not found
and the if statement will simply interpret the error as false causing
the task to continue, even if the image type was "simpleImage"!
Testing was done using the official crops/poky docker image. The
crops/poky system shell was confirmed to include the “[[“ extension
however, it appears that the extension is disabled within the recipe
shell scripts. In addition, "[[" does not appear to be used by any
openembedded-core recipes so I made this patch to convert the two
instances of "[[" to "[". The patch was created for master, but the
problem appears to exist on all branches of meta-xilinx.
Signed-off-by: Michael Monaghan <michael.l.monaghan@nasa.gov>
Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
-rw-r--r-- | meta-xilinx-bsp/classes/kernel-simpleimage.bbclass | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/meta-xilinx-bsp/classes/kernel-simpleimage.bbclass b/meta-xilinx-bsp/classes/kernel-simpleimage.bbclass index 348d0a73..6da28f36 100644 --- a/meta-xilinx-bsp/classes/kernel-simpleimage.bbclass +++ b/meta-xilinx-bsp/classes/kernel-simpleimage.bbclass @@ -13,7 +13,7 @@ do_prep_simpleimage[dirs] += "${B}" do_prep_simpleimage () { install -d ${B}/arch/${ARCH}/boot/dts for type in ${KERNEL_IMAGETYPES} ; do - if [[ "${type}" =~ "simpleImage" ]] && [ ${ARCH} = "microblaze" ]; then + if [ -z "${type##*simpleImage*}" ] && [ ${ARCH} = "microblaze" ]; then ext="${type##*.}" # Microblaze simpleImage only works with dts file cp ${RECIPE_SYSROOT}/boot/devicetree/${ext}.dts ${B}/arch/${ARCH}/boot/dts/ @@ -23,7 +23,7 @@ do_prep_simpleimage () { do_deploy_append () { for type in ${KERNEL_IMAGETYPES} ; do - if [[ "${type}" =~ "simpleImage" ]] && [ ${ARCH} = "microblaze" ]; then + if [ -z "${type##*simpleImage*}" ] && [ ${ARCH} = "microblaze" ]; then base_name=${imageType}-${KERNEL_IMAGE_NAME} install -m 0644 ${KERNEL_OUTPUT_DIR}/${type}.strip $deployDir/${base_name}.strip install -m 0644 ${KERNEL_OUTPUT_DIR}/${type}.unstrip $deployDir/${base_name}.unstrip |