Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions board/common/image/image-itb-qcow/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion buildroot
Submodule buildroot updated 1 files
+8 −1 boot/edk2/edk2.mk
Loading