#!/usr/bin/env python3 ''' https://github.com/cirosantilli/linux-kernel-module-cheat#release-zip ''' import os import subprocess import zipfile import common from shell_helpers import LF def main(): os.makedirs(self.env['release_dir'], exist_ok=True) if os.path.exists(self.env['release_zip_file']): self.sh.rmrf(self.env['release_zip_file']) zipf = zipfile.ZipFile(self.env['release_zip_file'], 'w', zipfile.ZIP_DEFLATED) for arch in self.env['all_long_archs']: self.setup(common.get_argparse(default_args={'arch': arch})) zipf.write(self.env['qcow2_file'], arcname=os.path.relpath(self.env['qcow2_file'], self.env['root_dir'])) zipf.write(self.env['linux_image'], arcname=os.path.relpath(self.env['linux_image'], self.env['root_dir'])) zipf.close() if __name__ == '__main__': main()