rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | MTDVERITY_TOOL_DIR="${TOPDIR}/../src/devtools/nfsb/mtd_verity" |
| 2 | MTDVERITY_TOOL="${MTDVERITY_TOOL_DIR}/mtd_verity" |
| 3 | MTDVERITY_WORKING_PATH="${DEPLOY_DIR_IMAGE}" |
| 4 | OLD_ROOTFS_NAME="${IMAGE_NAME}.rootfs.${IMAGE_FSTYPES}" |
| 5 | NEW_ROOTFS_NAME="mtdverity_system.${IMAGE_FSTYPES}" |
| 6 | IMG_KEY_FILE = "${MTK_KEY_DIR}/${VERIFIED_KEY}.pem" |
| 7 | |
| 8 | do_mtdverity_for_rootfs() { |
| 9 | |
| 10 | if [ "${SECURE_BOOT_ENABLE}" = "yes" ] && [ "${ENABLE_ROOTFS_CHECK}" = "yes" ]; then |
| 11 | if [ "${STANDALONE_SIGN_PREPARE}" = "yes" ];then |
| 12 | exit 0 |
| 13 | fi |
| 14 | if [ ! -f ${MTDVERITY_WORKING_PATH}/${OLD_ROOTFS_NAME} ]; then |
| 15 | cp ${MTDVERITY_WORKING_PATH}/${IMAGE_BASENAME}-${MACHINE}.${IMAGE_FSTYPES} ${MTDVERITY_WORKING_PATH}/${OLD_ROOTFS_NAME} |
| 16 | fi |
| 17 | ${MTDVERITY_TOOL} ${MTDVERITY_WORKING_PATH}/${OLD_ROOTFS_NAME} 1048576 1048576 10 ${IMG_KEY_FILE} ${MTDVERITY_WORKING_PATH}/${NEW_ROOTFS_NAME} |
| 18 | rm -f ${MTDVERITY_WORKING_PATH}/${OLD_ROOTFS_NAME} |
| 19 | mv ${MTDVERITY_WORKING_PATH}/${NEW_ROOTFS_NAME} ${MTDVERITY_WORKING_PATH}/${OLD_ROOTFS_NAME} |
| 20 | else |
| 21 | exit 0 |
| 22 | fi |
| 23 | } |
| 24 | |
| 25 | addtask mtdverity_for_rootfs after do_image_complete before do_packing_images_post_funcs |
| 26 | do_rootfs[nostamp] = "1" |
| 27 | |
| 28 | #IMAGE_POSTPROCESS_COMMAND += " add_mtdverity_for_rootfs;" |