]> code.ossystems Code Review - openembedded-core.git/commitdiff
boot-directdisk: use awk instead of echo -ne for dash compatibility
authorJonathan Liu <net147@gmail.com>
Sat, 20 Jul 2013 12:11:20 +0000 (22:11 +1000)
committerSaul Wold <sgw@linux.intel.com>
Tue, 23 Jul 2013 14:22:38 +0000 (07:22 -0700)
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]

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/classes/boot-directdisk.bbclass

index 182957b106b8b436d431e0f756fc4842df4e37e8..8a55aae6a3a26f82864c4db98acf438212e9ae53 100644 (file)
@@ -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`