From: Jonathan Liu <net147@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] boot-directdisk: use awk instead of echo -ne for dash compatibility
Date: Sat, 20 Jul 2013 22:11:20 +1000 [thread overview]
Message-ID: <1374322280-1792-1-git-send-email-net147@gmail.com> (raw)
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>
---
meta/classes/boot-directdisk.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/boot-directdisk.bbclass b/meta/classes/boot-directdisk.bbclass
index 182957b..8a55aae 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`
--
1.8.3.2
next reply other threads:[~2013-07-20 11:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-20 12:11 Jonathan Liu [this message]
2013-07-22 10:17 ` [PATCH] boot-directdisk: use awk instead of echo -ne for dash compatibility Iorga, Cristian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1374322280-1792-1-git-send-email-net147@gmail.com \
--to=net147@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox