src/compare_command.sh: formatting fixes/improvements

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
This commit is contained in:
Sergii Dmytruk
2025-08-06 21:12:27 +03:00
parent ea8f758a0f
commit 36f6217a70
2 changed files with 24 additions and 8 deletions
+12 -4
View File
@@ -298,7 +298,7 @@ romscope_compare_command() {
rm -r $WORKDIR
fi
if [ ! -f "$ROM1_FILE" ]; then
if [ ! -f "$ROM1_FILE" ]; then
echo "File $ROM1_FILE does not exist. Please input a valid ROM file path."
return 1
fi
@@ -331,7 +331,13 @@ romscope_compare_command() {
pushd $WORKDIR > /dev/null
files=$(cat a/manifest \
| cut -d ' ' -f 2 \
| grep -v -e "regions/fmap/FW_MAIN_A.bin" -e "regions/fmap/FW_MAIN_B.bin" -e "regions/fmap/COREBOOT.bin" -e "regions/fmap/VBLOCK_A.bin" -e "regions/fmap/VBLOCK_B.bin" -e "regions/fmap/GBB.bin" -e "regions/ifd/flashregion" \
| grep -v -e "regions/fmap/FW_MAIN_A.bin" \
-e "regions/fmap/FW_MAIN_B.bin" \
-e "regions/fmap/COREBOOT.bin" \
-e "regions/fmap/VBLOCK_A.bin" \
-e "regions/fmap/VBLOCK_B.bin" \
-e "regions/fmap/GBB.bin" \
-e "regions/ifd/flashregion" \
)
files_match=1
for file in $files; do
@@ -343,7 +349,9 @@ romscope_compare_command() {
done
vblocks=$(cat a/manifest \
| cut -d ' ' -f 2 \
| grep -e "regions/fmap/VBLOCK_A.bin" -e "regions/fmap/VBLOCK_B.bin" -e "regions/fmap/GBB.bin" \
| grep -e "regions/fmap/VBLOCK_A.bin" \
-e "regions/fmap/VBLOCK_B.bin" \
-e "regions/fmap/GBB.bin" \
)
vblocks_match=1
for vblock in $vblocks; do
@@ -365,7 +373,7 @@ romscope_compare_command() {
else
echo "Not all files match. Check report for detailed information."
if [ -z "$OUTPUT_DIR" ]; then
OUTPUT_DIR="report"
OUTPUT_DIR="report"
fi
mkdir -p $OUTPUT_DIR
cp $WORKDIR/*.html $OUTPUT_DIR/
+12 -4
View File
@@ -13,7 +13,7 @@ main () {
rm -r $WORKDIR
fi
if [ ! -f "$ROM1_FILE" ]; then
if [ ! -f "$ROM1_FILE" ]; then
echo "File $ROM1_FILE does not exist. Please input a valid ROM file path."
return 1
fi
@@ -46,7 +46,13 @@ main () {
pushd $WORKDIR > /dev/null
files=$(cat a/manifest \
| cut -d ' ' -f 2 \
| grep -v -e "regions/fmap/FW_MAIN_A.bin" -e "regions/fmap/FW_MAIN_B.bin" -e "regions/fmap/COREBOOT.bin" -e "regions/fmap/VBLOCK_A.bin" -e "regions/fmap/VBLOCK_B.bin" -e "regions/fmap/GBB.bin" -e "regions/ifd/flashregion" \
| grep -v -e "regions/fmap/FW_MAIN_A.bin" \
-e "regions/fmap/FW_MAIN_B.bin" \
-e "regions/fmap/COREBOOT.bin" \
-e "regions/fmap/VBLOCK_A.bin" \
-e "regions/fmap/VBLOCK_B.bin" \
-e "regions/fmap/GBB.bin" \
-e "regions/ifd/flashregion" \
)
files_match=1
for file in $files; do
@@ -58,7 +64,9 @@ main () {
done
vblocks=$(cat a/manifest \
| cut -d ' ' -f 2 \
| grep -e "regions/fmap/VBLOCK_A.bin" -e "regions/fmap/VBLOCK_B.bin" -e "regions/fmap/GBB.bin" \
| grep -e "regions/fmap/VBLOCK_A.bin" \
-e "regions/fmap/VBLOCK_B.bin" \
-e "regions/fmap/GBB.bin" \
)
vblocks_match=1
for vblock in $vblocks; do
@@ -80,7 +88,7 @@ main () {
else
echo "Not all files match. Check report for detailed information."
if [ -z "$OUTPUT_DIR" ]; then
OUTPUT_DIR="report"
OUTPUT_DIR="report"
fi
mkdir -p $OUTPUT_DIR
cp $WORKDIR/*.html $OUTPUT_DIR/