Files
luban-lite-t3e-pro/tools/scripts/mkcpio.py

18 lines
496 B
Python
Raw Normal View History

2023-11-09 20:19:51 +08:00
import os
import sys
aic_system = sys.argv[1]
2023-11-30 19:48:02 +08:00
aic_root = os.path.normpath(sys.argv[2])
aic_pack_dir = os.path.normpath(sys.argv[3])
prj_out_dir = os.path.normpath(sys.argv[4])
2023-11-09 20:19:51 +08:00
os.chdir(prj_out_dir)
if aic_system == 'Linux':
os.system('cat ota-subimgs.cfg | cpio -ov -H crc > ota.cpio')
elif aic_system == 'Windows':
cpio_tool_dir = os.path.join(aic_root, 'tools\scripts\cpio.exe')
os.system('type ota-subimgs.cfg | ' + cpio_tool_dir + ' -ov -H crc > ota.cpio')
os.chdir(aic_root)