Merge "common: mkfirmware: pack image only if needed"

This commit is contained in:
Eddie.Cai
2018-09-13 18:14:33 +08:00
committed by Gerrit Code Review

View File

@ -15,7 +15,7 @@ ROCKDEV=$TOP_DIR/rockdev
PARAMETER=$TOP_DIR/device/rockchip/$RK_TARGET_PRODUCT/$RK_PARAMETER
OEM_DIR=$TOP_DIR/device/rockchip/oem/$RK_OEM_DIR
USER_DATA_DIR=$TOP_DIR/device/rockchip/userdata/$RK_USERDATA_DIR
MISC_IMG=$TOP_DIR/device/rockchip/rockimg/wipe_all-misc.img
MISC_IMG=$TOP_DIR/device/rockchip/rockimg/$RK_MISC
ROOTFS_IMG=$TOP_DIR/$RK_ROOTFS_IMG
RECOVERY_IMG=$TOP_DIR/buildroot/output/$RK_CFG_RECOVERY/images/recovery.img
TRUST_IMG=$TOP_DIR/u-boot/trust.img
@ -27,13 +27,16 @@ MKOEM=$TOP_DIR/device/rockchip/common/mk-oem.sh
MKUSERDATA=$TOP_DIR/device/rockchip/common/mk-userdata.sh
mkdir -p $ROCKDEV
if [ $RK_ROOTFS_IMG ]
then
if [ -f $ROOTFS_IMG ]
then
echo -n "create rootfs.img..."
ln -s -f $ROOTFS_IMG $ROCKDEV/rootfs.img
echo "done."
else
echo -e "\e[31m error: $ROOTFS_IMG not found! \e[0m"
echo "warning: $ROOTFS_IMG not found!"
fi
fi
if [ -f $PARAMETER ]
@ -42,43 +45,55 @@ then
ln -s -f $PARAMETER $ROCKDEV/parameter.txt
echo "done."
else
echo -e "\e[31m error: $PARAMETER not found! \e[0m"
echo "warning: $PARAMETER not found!"
fi
if [ $RK_CFG_RECOVERY ]
then
if [ -f $RECOVERY_IMG ]
then
echo -n "create recovery.img..."
ln -s -f $RECOVERY_IMG $ROCKDEV/recovery.img
echo "done."
else
echo -e "\e[31m error: $RECOVERY_IMG not found! \e[0m"
echo "warning: $RECOVERY_IMG not found!"
fi
fi
if [ $RK_MISC ]
then
if [ -f $MISC_IMG ]
then
echo -n "create misc.img..."
ln -s -f $MISC_IMG $ROCKDEV/misc.img
echo "done."
else
echo -e "\e[31m error: $MISC_IMG not found! \e[0m"
echo "warning: $MISC_IMG not found!"
fi
fi
if [ $RK_OEM_DIR ]
then
if [ -d $OEM_DIR ]
then
echo -n "create oem.img..."
$MKOEM $OEM_DIR $ROCKDEV/oem.img $RK_OEM_FS_TYPE
echo "done."
else
echo -e "\e[31m error: create oem image fail! \e[0m"
echo "warning: $OEM_DIR not found!"
fi
fi
if [ $RK_USERDATA_DIR ]
then
if [ -d $USER_DATA_DIR ]
then
echo -n "create userdata.img..."
$MKUSERDATA $USER_DATA_DIR $ROCKDEV/userdata.img $RK_USERDATA_FS_TYPE
echo "done."
else
echo -e "\e[31m error: $USER_DATA_DIR not found! \e[0m"
echo "warning: $USER_DATA_DIR not found!"
fi
fi
if [ -f $UBOOT_IMG ]
@ -118,13 +133,16 @@ fi
# rm $SPINOR_LOADER_PATH 2>/dev/null
#fi
if [ -f $BOOT_PATH ]
if [ $RK_BOOT_IMG ]
then
if [ -f $BOOT_IMG ]
then
echo -n "create boot.img..."
ln -s -f $BOOT_IMG $ROCKDEV/boot.img
echo "done."
else
echo -e "\e[31m error: $BOOT_IMG not found! \e[0m"
echo "warning: $BOOT_IMG not found!"
fi
fi
echo -e "\e[36m Image: image in rockdev is ready \e[0m"