2022-03-08 12:04:17 +08:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import shutil
|
2024-10-01 06:50:15 +08:00
|
|
|
import urllib.request
|
2022-03-08 12:04:17 +08:00
|
|
|
out_path='./'
|
|
|
|
bin_file_name='rtthread.bin'
|
|
|
|
pack_path='./pack'
|
|
|
|
out_file='./rtthread_air105'
|
|
|
|
|
|
|
|
cwd_path = os.getcwd()
|
|
|
|
if __name__=='__main__':
|
|
|
|
|
|
|
|
print(cwd_path)
|
|
|
|
if os.path.exists(out_file+'.soc'):
|
|
|
|
os.remove(out_file+'.soc')
|
|
|
|
|
|
|
|
if not os.path.exists(pack_path+'/bootloader.bin'):
|
2024-10-01 06:50:15 +08:00
|
|
|
urllib.request.urlretrieve("http://cdndownload.openluat.com/rt-thread/airm2m/air105/bootloader.bin", pack_path + '/bootloader.bin')
|
2022-03-08 12:04:17 +08:00
|
|
|
|
|
|
|
if not os.path.exists(pack_path+'/soc_download.exe'):
|
2024-10-01 06:50:15 +08:00
|
|
|
urllib.request.urlretrieve("http://cdndownload.openluat.com/rt-thread/airm2m/air105/bootloader.bin", pack_path + '/bootloader.bin')
|
2022-03-08 12:04:17 +08:00
|
|
|
|
|
|
|
shutil.copy(out_path+bin_file_name, pack_path+'/'+bin_file_name)
|
|
|
|
shutil.make_archive(out_file, 'zip', root_dir=pack_path)
|
|
|
|
os.remove(pack_path+'/'+bin_file_name)
|
|
|
|
os.rename(out_file+'.zip',out_file+'.soc')
|
2024-10-01 06:50:15 +08:00
|
|
|
|
2022-03-08 12:04:17 +08:00
|
|
|
print('end')
|