diff --git a/board/common/image/image-itb-qcow/generate.sh b/board/common/image/image-itb-qcow/generate.sh index 3969d5547..c85a8f514 100755 --- a/board/common/image/image-itb-qcow/generate.sh +++ b/board/common/image/image-itb-qcow/generate.sh @@ -7,11 +7,15 @@ G=30 size2int() { - # Use truncate's error message to convert input like "1K to "1024" - # for us. - # - # - What do you mean by "fragile"?! - truncate -s $1 /dev/null 2>&1 | awk '{ print($7); }' + local _num=$(echo $1 | sed -e 's/[KkMmGg]//') + + case $1 in + *[Kk]) _num=$((_num << K)) ;; + *[Mm]) _num=$((_num << M)) ;; + *[Gg]) _num=$((_num << G)) ;; + esac + + echo $_num } dimension() diff --git a/buildroot b/buildroot index 1345b40b2..04ebd60f8 160000 --- a/buildroot +++ b/buildroot @@ -1 +1 @@ -Subproject commit 1345b40b2ce56be344c876db3b7a27c6b29eab3c +Subproject commit 04ebd60f8d68497970b72db06f31b7d18037cead