From bf6ed25a6ab9da8504b4571d6f1a704e4efc442d Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Mon, 14 Aug 2023 21:23:38 -0500 Subject: [PATCH] hss-payload-generator: make sure src.bin/u-boot.bin are the same, when generating payload.bin Signed-off-by: Robert Nelson --- 05_generate_payload.bin.sh | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/05_generate_payload.bin.sh b/05_generate_payload.bin.sh index 7067b42..9c692a0 100755 --- a/05_generate_payload.bin.sh +++ b/05_generate_payload.bin.sh @@ -1,7 +1,36 @@ #!/bin/bash cd ./deploy/ -./hss-payload-generator -c config.yaml -v ./input/payload.bin -sha256sum ./input/payload.bin + +if [ -f ./src.bin ] ; then + + if [ -f ./input/payload.bin ] ; then + rm -rf ./input/payload.bin || true + fi + + tree -s ./input/ + + ./hss-payload-generator -vv -c config.yaml ./input/payload.bin + + unset test_var + test_var=$(strings ./u-boot.bin | grep 'U-Boot 20' | head -n1 || true) + if [ ! "x${test_var}" = "x" ] ; then + echo "[u-boot.bin: ${test_var}]" + fi + + unset test_var + test_var=$(strings ./src.bin | grep 'U-Boot 20' | head -n1 || true) + if [ ! "x${test_var}" = "x" ] ; then + echo "[src.bin: ${test_var}]" + fi + + unset test_var + test_var=$(strings ./input/payload.bin | grep 'U-Boot 20' | head -n1 || true) + if [ ! "x${test_var}" = "x" ] ; then + echo "[payload.bin:${test_var}]" + fi + + tree -s ./input/ +fi #