mb/[google/intel/lenovo]/*: fix posix shell bug with SPD files
FreeBSD's sh (basic posix shell) did not interpret the '\%o' escape in the same way bash/zsh do. As a result, the decoded files ended up with ASCII numbers instead of the decoded binary data. Change-Id: I95b414d959e5cd4479fcf100adcf390562032c68 Signed-off-by: Greg V <greg@unrelenting.technology> Reviewed-on: https://review.coreboot.org/c/coreboot/+/35867 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
@@ -41,7 +41,7 @@ SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/variants/
|
||||
$(SPD_BIN): $(SPD_DEPS)
|
||||
for f in $+; \
|
||||
do for c in $$(cat $$f | grep -v ^#); \
|
||||
do printf $$(printf '\%o' 0x$$c); \
|
||||
do printf $$(printf '\\%o' 0x$$c); \
|
||||
done; \
|
||||
done > $@
|
||||
|
||||
|
@@ -41,7 +41,7 @@ SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/variants/
|
||||
$(SPD_BIN): $(SPD_DEPS)
|
||||
for f in $+; \
|
||||
do for c in $$(cat $$f | grep -v ^#); \
|
||||
do printf $$(printf '\%o' 0x$$c); \
|
||||
do printf $$(printf '\\%o' 0x$$c); \
|
||||
done; \
|
||||
done > $@
|
||||
|
||||
|
@@ -33,7 +33,7 @@ SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/variants/
|
||||
$(SPD_BIN): $(SPD_DEPS)
|
||||
for f in $+; \
|
||||
do for c in $$(cat $$f | grep -v ^#); \
|
||||
do printf $$(printf '\%o' 0x$$c); \
|
||||
do printf $$(printf '\\%o' 0x$$c); \
|
||||
done; \
|
||||
done > $@
|
||||
|
||||
|
@@ -42,7 +42,7 @@ SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/variants/
|
||||
$(SPD_BIN): $(SPD_DEPS)
|
||||
for f in $+; \
|
||||
do for c in $$(cat $$f | grep -v ^#); \
|
||||
do printf $$(printf '\%o' 0x$$c); \
|
||||
do printf $$(printf '\\%o' 0x$$c); \
|
||||
done; \
|
||||
done > $@
|
||||
|
||||
|
@@ -41,7 +41,7 @@ SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/variants/
|
||||
$(SPD_BIN): $(SPD_DEPS)
|
||||
for f in $+; \
|
||||
do for c in $$(cat $$f | grep -v ^#); \
|
||||
do printf $$(printf '\%o' 0x$$c); \
|
||||
do printf $$(printf '\\%o' 0x$$c); \
|
||||
done; \
|
||||
done > $@
|
||||
|
||||
|
@@ -30,7 +30,7 @@ endif
|
||||
$(SPD_BIN): $(SPD_DEPS)
|
||||
for f in $+; \
|
||||
do for c in $$(cat $$f | grep -v ^#); \
|
||||
do printf $$(printf '\%o' 0x$$c); \
|
||||
do printf $$(printf '\\%o' 0x$$c); \
|
||||
done; \
|
||||
done > $@
|
||||
|
||||
|
@@ -25,7 +25,7 @@ endif
|
||||
$(SPD_BIN): $(SPD_DEPS)
|
||||
for f in $+; \
|
||||
do for c in $$(cat $$f | grep -v ^#); \
|
||||
do printf $$(printf '\%o' 0x$$c); \
|
||||
do printf $$(printf '\\%o' 0x$$c); \
|
||||
done; \
|
||||
done > $@
|
||||
|
||||
|
@@ -32,7 +32,7 @@ SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/spd/$(f).
|
||||
$(SPD_BIN): $(SPD_DEPS)
|
||||
for f in $+; \
|
||||
do for c in $$(cat $$f | grep -v ^#); \
|
||||
do printf $$(printf '\%o' 0x$$c); \
|
||||
do printf $$(printf '\\%o' 0x$$c); \
|
||||
done; \
|
||||
done > $@
|
||||
|
||||
|
@@ -25,7 +25,7 @@ endif
|
||||
$(SPD_BIN): $(SPD_DEPS)
|
||||
for f in $+; \
|
||||
do for c in $$(cat $$f | grep -v ^#); \
|
||||
do printf $$(printf '\%o' 0x$$c); \
|
||||
do printf $$(printf '\\%o' 0x$$c); \
|
||||
done; \
|
||||
done > $@
|
||||
|
||||
|
@@ -5,7 +5,7 @@ SEC_SPD_BIN = $(obj)/sec-spd.bin
|
||||
define gen_spd_bin
|
||||
for f in $2; \
|
||||
do for c in $$(cat $$f | grep -v ^#); \
|
||||
do printf $$(printf '\%o' 0x$$c); \
|
||||
do printf $$(printf '\\%o' 0x$$c); \
|
||||
done; \
|
||||
done > $1
|
||||
endef
|
||||
|
@@ -43,7 +43,7 @@ SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/spd/$(f).
|
||||
$(SPD_BIN): $(SPD_DEPS)
|
||||
for f in $+; \
|
||||
do for c in $$(cat $$f | grep -v ^#); \
|
||||
do printf $$(printf '\%o' 0x$$c); \
|
||||
do printf $$(printf '\\%o' 0x$$c); \
|
||||
done; \
|
||||
done > $@
|
||||
|
||||
|
@@ -22,7 +22,7 @@ SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/variants/
|
||||
$(SPD_BIN): $(SPD_DEPS)
|
||||
for f in $+; \
|
||||
do for c in $$(cat $$f | grep -v ^#); \
|
||||
do printf $$(printf '\%o' 0x$$c); \
|
||||
do printf $$(printf '\\%o' 0x$$c); \
|
||||
done; \
|
||||
done > $@
|
||||
|
||||
|
@@ -24,7 +24,7 @@ SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/spd/$(f))
|
||||
$(SPD_BIN): $(SPD_DEPS)
|
||||
for f in $+; \
|
||||
do for c in $$(cat $$f | grep -v ^#); \
|
||||
do printf $$(printf '\%o' 0x$$c); \
|
||||
do printf $$(printf '\\%o' 0x$$c); \
|
||||
done; \
|
||||
done > $@
|
||||
|
||||
|
Reference in New Issue
Block a user