src/compare_command.sh: give output a bit of structure

Indicate stages of operation so different output lines are grouped
according to their meaning.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
This commit is contained in:
Sergii Dmytruk
2025-08-23 15:46:08 +03:00
parent 661e0bbb69
commit 4752005a19
2 changed files with 20 additions and 0 deletions

View File

@@ -301,6 +301,10 @@ romscope_compare_command() {
cat a/manifest b/manifest | cut -d ' ' -f 2 | grep -e "$1" | sort -u
}
stage() {
echo "===== $1 ====="
}
main () {
if [ -e $WORKDIR ]; then
rm -r $WORKDIR
@@ -316,6 +320,8 @@ romscope_compare_command() {
return 1
fi
stage Preparation
echo "Extracting file $ROM1_FILE"
mkdir -p $WORKDIR/a
rom_extract $ROM1_FILE $WORKDIR/a > /dev/null
@@ -336,6 +342,8 @@ romscope_compare_command() {
done
popd > /dev/null
stage Comparison
pushd $WORKDIR > /dev/null
ibg_key_change=0
ibg_mixed_provisioning=0
@@ -441,6 +449,8 @@ romscope_compare_command() {
done
popd > /dev/null
stage Conclusions
if [ "$ibg_mixed_provisioning" -eq 1 ]; then
echo "Only one of the binaries seems to be provisioned for IBG."
elif [ "$ibg_key_change" -eq 1 ]; then

View File

@@ -16,6 +16,10 @@ find_file() {
cat a/manifest b/manifest | cut -d ' ' -f 2 | grep -e "$1" | sort -u
}
stage() {
echo "===== $1 ====="
}
main () {
if [ -e $WORKDIR ]; then
rm -r $WORKDIR
@@ -31,6 +35,8 @@ main () {
return 1
fi
stage Preparation
echo "Extracting file $ROM1_FILE"
mkdir -p $WORKDIR/a
rom_extract $ROM1_FILE $WORKDIR/a > /dev/null
@@ -51,6 +57,8 @@ main () {
done
popd > /dev/null
stage Comparison
pushd $WORKDIR > /dev/null
ibg_key_change=0
ibg_mixed_provisioning=0
@@ -156,6 +164,8 @@ main () {
done
popd > /dev/null
stage Conclusions
if [ "$ibg_mixed_provisioning" -eq 1 ]; then
echo "Only one of the binaries seems to be provisioned for IBG."
elif [ "$ibg_key_change" -eq 1 ]; then