From: Jonathan Liu Date: Sat, 20 Jul 2013 12:11:20 +0000 (+1000) Subject: boot-directdisk: use awk instead of echo -ne for dash compatibility X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1d5d93101e4d4e14d37f75f8a4d2bef0a96b2a4e;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git boot-directdisk: use awk instead of echo -ne for dash compatibility The echo command is a dash shell built-in and does not support the -n and -e options so use awk instead. This fixes the partition table being corrupted when writing the MBR disk signature into the image. [YOCTO #4859] (From OE-Core rev: 1928f46e8e9f281e3e64f916048cc9314e125150) Signed-off-by: Jonathan Liu Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- diff --git a/meta/classes/boot-directdisk.bbclass b/meta/classes/boot-directdisk.bbclass index 182957b106b..8a55aae6a3a 100644 --- a/meta/classes/boot-directdisk.bbclass +++ b/meta/classes/boot-directdisk.bbclass @@ -81,7 +81,7 @@ build_boot_dd() { parted $IMAGE set 1 boot on parted $IMAGE print - echo -ne "$(echo ${DISK_SIGNATURE} | fold -w 2 | tac | paste -sd '' | sed 's/\(..\)/\\x&/g')" | \ + awk "BEGIN { printf \"$(echo ${DISK_SIGNATURE} | fold -w 2 | tac | paste -sd '' | sed 's/\(..\)/\\x&/g')\" }" | \ dd of=$IMAGE bs=1 seek=440 conv=notrunc OFFSET=`expr $END2 / 512`