common: build.sh: add command check building environment

read configure files from:
    device/rockchip/common/build-depend-tools.txt
    device/rockchip/$RK_TARGET_PRODUCT/build-depend-tools.txt
configure format:
    test_command,package_name

Signed-off-by: Weiwen Chen <cww@rock-chips.com>
Change-Id: I0d6d34b87285414ee393a3f40a4aeee933b21c51
This commit is contained in:
Weiwen Chen
2020-10-22 15:28:31 +08:00
parent f19461d007
commit 223ce5ea36

View File

@ -165,10 +165,33 @@ function usage()
echo "otapackage -pack ab update otapackage image"
echo "save -save images, patches, commands used to debug"
echo "allsave -build all & firmware & updateimg & save"
echo "check -check the environment of building"
echo ""
echo "Default option is 'allsave'."
}
function build_check(){
local build_depend_cfg="build-depend-tools.txt"
common_product_build_tools="$TOP_DIR/device/rockchip/common/$build_depend_cfg"
target_product_build_tools="$TOP_DIR/device/rockchip/$RK_TARGET_PRODUCT/$build_depend_cfg"
cat $common_product_build_tools $target_product_build_tools 2>/dev/null | while read chk_item
do
chk_item=${chk_item###*}
if [ -z "$chk_item" ]; then
continue
fi
dst=${chk_item%%,*}
src=${chk_item##*,}
eval $dst 1>/dev/null 2>&1
if [ $? -ne 0 ];then
echo "**************************************"
echo "Please install ${dst%% *} first"
echo " sudo apt-get install $src"
fi
done
}
function build_uboot(){
if [ -z $RK_UBOOT_DEFCONFIG ]; then
return;