common: support package update_sdcard.img

Configure:
RK_PACKAGE_FILE_AB to build update_ab.img
RK_PACKAGE_FILE_SDCARD_UPDATE to build update_sdcard.img
RK_PACKAGE_FILE_OTA to build update_ota.img

Signed-off-by: Weiwen Chen <cww@rock-chips.com>
Change-Id: I8beec81e55d22547d8902f36b84317680b7e94c6
This commit is contained in:
Weiwen Chen
2021-02-05 16:51:19 +08:00
parent cfed386191
commit 5c02c954b2
4 changed files with 67 additions and 12 deletions

View File

@ -219,6 +219,7 @@ function usage()
echo "firmware -pack all the image we need to boot up system" echo "firmware -pack all the image we need to boot up system"
echo "updateimg -pack update image" echo "updateimg -pack update image"
echo "otapackage -pack ab update otapackage image" echo "otapackage -pack ab update otapackage image"
echo "sdpackage -pack update sdcard package image (sdupdate.img-data)"
echo "save -save images, patches, commands used to debug" echo "save -save images, patches, commands used to debug"
echo "allsave -build all & firmware & updateimg & save" echo "allsave -build all & firmware & updateimg & save"
echo "check -check the environment of building" echo "check -check the environment of building"
@ -605,22 +606,24 @@ function build_updateimg(){
IMAGE_PATH=$TOP_DIR/rockdev IMAGE_PATH=$TOP_DIR/rockdev
PACK_TOOL_DIR=$TOP_DIR/tools/linux/Linux_Pack_Firmware PACK_TOOL_DIR=$TOP_DIR/tools/linux/Linux_Pack_Firmware
if [ "$RK_LINUX_AB_ENABLE" == "true" ];then cd $PACK_TOOL_DIR/rockdev
echo "Make Linux a/b update.img."
if [ -f "$RK_PACKAGE_FILE_AB" ]; then
build_sdcard_package
build_otapackage build_otapackage
cd $PACK_TOOL_DIR/rockdev
cd $PACK_TOOL_DIR/rockdev
echo "Make Linux a/b update_ab.img."
source_package_file_name=`ls -lh package-file | awk -F ' ' '{print $NF}'` source_package_file_name=`ls -lh package-file | awk -F ' ' '{print $NF}'`
ln -fs "$RK_PACKAGE_FILE"-ab package-file ln -fs "$RK_PACKAGE_FILE_AB" package-file
./mkupdate.sh ./mkupdate.sh
mv update.img $IMAGE_PATH/update_ab.img mv update.img $IMAGE_PATH/update_ab.img
ln -fs $source_package_file_name package-file ln -fs $source_package_file_name package-file
else else
echo "Make update.img" echo "Make update.img"
cd $PACK_TOOL_DIR/rockdev
if [ -f "$RK_PACKAGE_FILE" ]; then if [ -f "$RK_PACKAGE_FILE" ]; then
source_package_file_name=`ls -lh package-file | awk -F ' ' '{print $NF}'` source_package_file_name=`ls -lh package-file | awk -F ' ' '{print $NF}'`
ln -fs "$RK_PACKAGE_FILE" package-file ln -fs "$RK_PACKAGE_FILE" package-file
./mkupdate.sh ./mkupdate.sh
ln -fs $source_package_file_name package-file ln -fs $source_package_file_name package-file
@ -637,13 +640,32 @@ function build_otapackage(){
IMAGE_PATH=$TOP_DIR/rockdev IMAGE_PATH=$TOP_DIR/rockdev
PACK_TOOL_DIR=$TOP_DIR/tools/linux/Linux_Pack_Firmware PACK_TOOL_DIR=$TOP_DIR/tools/linux/Linux_Pack_Firmware
echo "Make ota ab update.img" echo "Make ota ab update_ota.img"
source_package_file_name=`ls -lh $PACK_TOOL_DIR/rockdev/package-file | awk -F ' ' '{print $NF}'`
cd $PACK_TOOL_DIR/rockdev cd $PACK_TOOL_DIR/rockdev
ln -fs "$RK_PACKAGE_FILE"-ota package-file if [ -f "$RK_PACKAGE_FILE_OTA" ]; then
./mkupdate.sh source_package_file_name=`ls -lh $PACK_TOOL_DIR/rockdev/package-file | awk -F ' ' '{print $NF}'`
mv update.img $IMAGE_PATH/update_ota.img ln -fs "$RK_PACKAGE_FILE_OTA" package-file
ln -fs $source_package_file_name package-file ./mkupdate.sh
mv update.img $IMAGE_PATH/update_ota.img
ln -fs $source_package_file_name package-file
fi
finish_build
}
function build_sdcard_package(){
IMAGE_PATH=$TOP_DIR/rockdev
PACK_TOOL_DIR=$TOP_DIR/tools/linux/Linux_Pack_Firmware
echo "Make sdcard update update_sdcard.img"
cd $PACK_TOOL_DIR/rockdev
if [ -f "$RK_PACKAGE_FILE_SDCARD_UPDATE" ]; then
source_package_file_name=`ls -lh $PACK_TOOL_DIR/rockdev/package-file | awk -F ' ' '{print $NF}'`
ln -fs "$RK_PACKAGE_FILE_SDCARD_UPDATE" package-file
./mkupdate.sh
mv update.img $IMAGE_PATH/update_sdcard.img
ln -fs $source_package_file_name package-file
fi
finish_build finish_build
} }
@ -730,6 +752,7 @@ for option in ${OPTIONS}; do
firmware) build_firmware ;; firmware) build_firmware ;;
updateimg) build_updateimg ;; updateimg) build_updateimg ;;
otapackage) build_otapackage ;; otapackage) build_otapackage ;;
sdpackage) build_sdcard_package ;;
toolchain) build_toolchain ;; toolchain) build_toolchain ;;
spl) build_spl ;; spl) build_spl ;;
uboot) build_uboot ;; uboot) build_uboot ;;

View File

@ -18,6 +18,7 @@ unset_board_config_all
source $TOP_DIR/device/rockchip/.BoardConfig.mk source $TOP_DIR/device/rockchip/.BoardConfig.mk
ROCKDEV=$TOP_DIR/rockdev ROCKDEV=$TOP_DIR/rockdev
PARAMETER=$TOP_DIR/device/rockchip/$RK_TARGET_PRODUCT/$RK_PARAMETER PARAMETER=$TOP_DIR/device/rockchip/$RK_TARGET_PRODUCT/$RK_PARAMETER
PARAMETER_SDUPDATE=$TOP_DIR/device/rockchip/rockimg/$RK_PARAMETER_SDUPDATE
if [ "${RK_OEM_DIR}x" != "x" ];then if [ "${RK_OEM_DIR}x" != "x" ];then
OEM_DIR=$TOP_DIR/device/rockchip/oem/$RK_OEM_DIR OEM_DIR=$TOP_DIR/device/rockchip/oem/$RK_OEM_DIR
else else
@ -25,6 +26,7 @@ else
fi fi
USER_DATA_DIR=$TOP_DIR/device/rockchip/userdata/$RK_USERDATA_DIR USER_DATA_DIR=$TOP_DIR/device/rockchip/userdata/$RK_USERDATA_DIR
MISC_IMG=$TOP_DIR/device/rockchip/rockimg/$RK_MISC MISC_IMG=$TOP_DIR/device/rockchip/rockimg/$RK_MISC
SDUPDATE_AB_MISC_IMG=$TOP_DIR/device/rockchip/rockimg/$RK_SDUPDATE_AB_MISC
ROOTFS_IMG=$TOP_DIR/$RK_ROOTFS_IMG ROOTFS_IMG=$TOP_DIR/$RK_ROOTFS_IMG
ROOTFS_IMG_SOURCE=$TOP_DIR/buildroot/output/$RK_CFG_BUILDROOT/images/rootfs.$RK_ROOTFS_TYPE ROOTFS_IMG_SOURCE=$TOP_DIR/buildroot/output/$RK_CFG_BUILDROOT/images/rootfs.$RK_ROOTFS_TYPE
RAMBOOT_IMG=$TOP_DIR/buildroot/output/$RK_CFG_RAMBOOT/images/ramboot.img RAMBOOT_IMG=$TOP_DIR/buildroot/output/$RK_CFG_RAMBOOT/images/ramboot.img
@ -190,6 +192,12 @@ else
exit -1 exit -1
fi fi
if [ -f $PARAMETER_SDUPDATE ]; then
echo -n "create sdcard update image parameter..."
ln -rsf $PARAMETER_SDUPDATE $ROCKDEV/
echo "done."
fi
get_partition_size get_partition_size
if [ $RK_CFG_RECOVERY ] if [ $RK_CFG_RECOVERY ]
@ -216,6 +224,18 @@ then
fi fi
fi fi
if [ $RK_SDUPDATE_AB_MISC ]
then
if [ -f $SDUPDATE_AB_MISC_IMG ]
then
echo -n "create sdupdate ab misc.img..."
ln -rsf $SDUPDATE_AB_MISC_IMG $ROCKDEV/
echo "done."
else
echo "warning: $SDUPDATE_AB_MISC_IMG not found!"
fi
fi
if [ "${RK_OEM_BUILDIN_BUILDROOT}x" != "YESx" ] if [ "${RK_OEM_BUILDIN_BUILDROOT}x" != "YESx" ]
then then
if [ -d "$OEM_DIR" ] if [ -d "$OEM_DIR" ]

View File

@ -0,0 +1,12 @@
FIRMWARE_VER: 8.1
MACHINE_MODEL: RV1126
MACHINE_ID: 007
MANUFACTURER: RV1126
MAGIC: 0x5041524B
ATAG: 0x00200800
MACHINE: 0xffffffff
CHECK_MASK: 0x80
PWR_HLD: 0,0,A,0,1
TYPE: GPT
CMDLINE: mtdparts=rk29xxnand:0x00002000@0x00004000(uboot_a),0x00002000@0x00006000(misc),0x00010000@0x00008000(recovery),0x00008000@0x00018000(system_a),0x00008000@0x00020000(system_b),-@0x00028000(media:grow)
uuid:rootfs=614e0000-0000-4b53-8000-1d28000054a9

Binary file not shown.