release 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env python3
  2. '''
  3. https://upload.com/cirosantilli/linux-kernel-module-cheat#release
  4. '''
  5. import imp
  6. import os
  7. import subprocess
  8. import time
  9. import common
  10. release_zip = imp.load_source('release_zip', os.path.join(kwargs['root_dir'], 'release-zip'))
  11. release_upload = imp.load_source('release_upload', os.path.join(kwargs['root_dir'], 'release-upload'))
  12. start_time = time.time()
  13. # TODO factor those out so we don't redo the same thing multiple times.
  14. # subprocess.check_call([os.path.join(kwargs['root_dir'], 'test')])
  15. # subprocess.check_call([os.path.join(kwargs['root_dir'], ''bench-all', '-A', '-u'])
  16. # A clean release requires a full rebuild unless we hack it :-(
  17. # We can't just use our current build as it contains packages we've
  18. # installed in random experiments. And with EXT2: we can't easily
  19. # know what the smallest root filesystem size is and use it either...
  20. # https://stackoverflow.com/questions/47320800/how-to-clean-only-target-in-buildroot
  21. subprocess.check_call([os.path.join(kwargs['root_dir'], 'configure'), '--all'])
  22. subprocess.check_call([os.path.join(kwargs['root_dir'], 'build'), '--all-archs', 'release'])
  23. release_zip.main()
  24. subprocess.check_call(['git', 'push'])
  25. release_upload.main()
  26. end_time = time.time()
  27. self.print_time(end_time - start_time)