Yocto generate_28nm_sdcard "echo" issue with Linux Mint

When building an SDcard image for the cylone V the partition type for the boot partition was not correctly set. (yocto Krogoth)

It turned out thet the following command dit not work as expected:

set part 3 to type a2 for spl / uboot image

echo -ne “\xa2” | dd of=${SDCARD} bs=1 count=1 seek=482 conv=notrunc

Instead of 0xa2 the ‘-’ was written into the image file. It seems ‘echo’ is internally handled by bitbake and does not process the “/xa2” as expected.

Changing “echo -ne” into “/bin/echo -ne” did solve the problem.

I only wonder if this is related to the fact that I use Linux Mint, or is this a Bitbake issue ?

I had the same problem which resulted in non-booting sd-card images. My (hopefully generic) solution was to replace the line you already named by:
ECHO_BINARY=$(which echo)
$ECHO_BINARY -ne “\xa2” | dd of=${SDCARD} bs=1 count=1 seek=482 conv=notrunc
The problem seems to be that bitbake sets environment variables or something else that forces echo into POSIX mode.
I’m using Debian by the way.