kernel-simpleimage.bbclass: Fix do_prep_simpleimage `[[: not found`
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 <7719ada9b14d146ed279f9f1be3cbc274bfef706@nasa.gov>
Signed-off-by: Manjukumar Matha <4c64a17569570cb9f1048973bce031c402b55312@xilinx.com>

Xilinx/meta-xilinx,Xilinx/meta-xilinx,Xilinx/meta-xilinx,Xilinx/meta-xilinx,Xilinx/meta-xilinx,Xilinx/meta-xilinx