summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Zeh <werner.zeh@siemens.com>2020-04-21 11:16:10 +0200
committerPatrick Georgi <pgeorgi@google.com>2020-04-22 17:33:58 +0000
commit5171960b2367d8eb34247b9e609a5573f55b8ba1 (patch)
tree9f0513dfa00a0937eba62770a68be04c20066829
parent21530bd421ed286939c32edc8c8cc451ede2e3a7 (diff)
downloadcoreboot-5171960b2367d8eb34247b9e609a5573f55b8ba1.tar.xz
util/scripts/ucode_h_to_bin.sh: Fix .inc-lines with just comment
There are microcodes in .inc format out in the wild which contains lines with just a comment. So these files look like the following example: ; External header dd 000000001h dd 00000001bh ... ; Data dd 000000000h ... The lines with just a comment starts with a ';' and will break the current awk formatting which is performed to reformat the content into C code style. As we are just interested in the data we can simply drop all lines that start with a ';' which sed can do pretty easy. Change-Id: I9ff5db51667672cffd9d776fb9497962b4a6083a Signed-off-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/40566 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
-rwxr-xr-xutil/scripts/ucode_h_to_bin.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/scripts/ucode_h_to_bin.sh b/util/scripts/ucode_h_to_bin.sh
index 2010c48e36..cb403a4978 100755
--- a/util/scripts/ucode_h_to_bin.sh
+++ b/util/scripts/ucode_h_to_bin.sh
@@ -42,7 +42,7 @@ EOF
include_file() {
if [ "${1: -4}" == ".inc" ]; then
- awk '{gsub( /h.*$/, "", $2 ); print "0x" $2 ","; }' "$1" \
+ sed '/^;/d' <"$1" | awk '{gsub( /h.*$/, "", $2 ); print "0x" $2 ","; }' \
>> "${TMPFILE}.c"
else
echo "#include \"$1\"" >> "${TMPFILE}.c"