scripts: fit-msg.sh: read components image message

Support get commit version of components image.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic279ed457949a98693571ec2a8ff2cfac4e0469d
This commit is contained in:
Joseph Chen 2020-11-14 08:56:46 +00:00
parent aa8e825b4b
commit ede15112c2
1 changed files with 51 additions and 0 deletions

51
scripts/fit-msg.sh Executable file
View File

@ -0,0 +1,51 @@
#!/bin/bash
#
# Copyright (c) 2020 Rockchip Electronics Co., Ltd
#
# SPDX-License-Identifier: GPL-2.0
#
set -e
function usage()
{
echo
echo "usage:"
echo " $0 -f [uboot.img]"
echo
}
function args_process()
{
if [ $# -ne 2 ]; then
usage
exit 1
fi
while [ $# -gt 0 ]; do
case $1 in
-f)
IMG=$2
shift 2
;;
*)
usage
exit 1
;;
esac
done
if [ ! -f ${IMG} ]; then
echo "ERROR: No ${IMG}"
exit 1
fi
}
function image_msg()
{
echo "[Commit version]:"
strings ${IMG} | grep '\-g[0-9,a-f][0-9,a-f][0-9,a-f][0-9,a-f][0-9,a-f][0-9,a-f][0-9,a-f]' | sort --uniq
strings ${IMG} | grep 'Built :' | sort --uniq
}
args_process $*
image_msg