Files
linux-kernel-module-cheat/zip-img
Ciro Santilli 六四事件 法轮功 ca3ec3ec2d zip-img: factor out for main() python calling
2018-09-15 01:35:31 +01:00

22 lines
652 B
Python
Executable File

#!/usr/bin/env python3
import os
import subprocess
import zipfile
import common
def main():
outfile = os.path.join(common.out_dir, 'lkmc-{}.zip'.format(common.sha))
if os.path.exists(outfile):
os.unlink(outfile)
zipf = zipfile.ZipFile(outfile, 'w', zipfile.ZIP_DEFLATED)
for arch in common.arches:
common.setup(common.get_argparse(default_args={'arch': arch}))
zipf.write(common.qcow2_file, arcname=os.path.relpath(common.qcow2_file, common.root_dir))
zipf.write(common.linux_image, arcname=os.path.relpath(common.linux_image, common.root_dir))
zipf.close()
if __name__ == '__main__':
main()