49 lines
1.6 KiB
Python
Executable File
49 lines
1.6 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
#
|
|
# Copyright (C) 2021 Amlogic, Inc. All rights reserved.
|
|
#
|
|
# This source code is subject to the terms and conditions defined in the
|
|
# file 'LICENSE' which is part of this source code package.
|
|
|
|
import sys
|
|
|
|
sys.dont_write_bytecode = True
|
|
import soc
|
|
|
|
TARGET_NAME = 'dac'
|
|
SCRIPT_PATH = sys.path[0] + '/../dependents/dac_derive.py'
|
|
GENERATOR_PATH = sys.path[0] + '/../dependents/pfpk-hmac-generator/pfpk_hmac_generator'
|
|
|
|
def get_args():
|
|
from argparse import ArgumentParser
|
|
|
|
parser = ArgumentParser()
|
|
parser.add_argument('--dgpk2', type = str, default = '', help = 'dgpk2 file or directory')
|
|
parser.add_argument('--pfid', type = str, default = '', help = 'pfid file or directory')
|
|
parser.add_argument('--pfpk_hmac', type = str, default = '', help = 'pfpk_hmac file or directory')
|
|
parser.add_argument('--nonce', type = str, default = '', help = 'nonce file or nonce hex string')
|
|
parser.add_argument('--out_dir', type = str, default = './' + soc.SOC + '-' + TARGET_NAME + '/', help = 'output directory')
|
|
return parser.parse_args()
|
|
|
|
def main():
|
|
import os
|
|
import sys
|
|
import subprocess
|
|
|
|
args = get_args()
|
|
|
|
cmd = [sys.executable, SCRIPT_PATH]
|
|
cmd.extend(['--soc=' + soc.SOC])
|
|
cmd.extend(['--key_tool=' + soc.KEY_TOOL_PATH])
|
|
cmd.extend(['--pfpk_hmac_generator=' + GENERATOR_PATH])
|
|
cmd.extend(['--dgpk2=' + args.dgpk2])
|
|
cmd.extend(['--pfid=' + args.pfid])
|
|
cmd.extend(['--pfpk_hmac=' + args.pfpk_hmac])
|
|
cmd.extend(['--nonce=' + args.nonce])
|
|
cmd.extend(['--out_dir=' + args.out_dir])
|
|
sub = subprocess.Popen(cmd)
|
|
sub.communicate()
|
|
|
|
if __name__ == '__main__':
|
|
main()
|