#!/usr/bin/env python3 # # Copyright 2023, Rockchip Electronics Co., Ltd # hisping lin, # # SPDX-License-Identifier: GPL-2.0+ # def get_args(): import argparse parser = argparse.ArgumentParser() parser.add_argument('--out', required=True, \ help='Name of image for the TA') parser.add_argument('--tadir', required=True, help='Path of TA director') return parser.parse_args() def main(): import os import array import glob import struct import uuid try: from Cryptodome.Hash import SHA256 except ImportError: from Crypto.Hash import SHA256 args = get_args(); path = args.tadir + "/*.ta" files = glob.glob(path) for f in files: print(f) fimg = open(args.out, 'wb') magic = 0x524B5441 #RKTA img_ver = 0x00000001 ta_num = len(files) reserve = 0 header = struct.pack('