build-disk2 659 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env python3
  2. import common
  3. class Main(common.BuildCliFunction):
  4. def __init__(self):
  5. super().__init__(
  6. description='''\
  7. https://cirosantilli.com/linux-kernel-module-cheat#secondary-disk
  8. '''
  9. )
  10. def build(self):
  11. # We must clean first because mksquashfs tries to avoid overwrites
  12. # by renaming images on the target.
  13. self.clean()
  14. self.sh.run_cmd([
  15. 'mksquashfs',
  16. self.env['out_rootfs_overlay_dir'],
  17. self.env['disk_image_2']
  18. ])
  19. def clean(self):
  20. self.sh.rmrf(self.env['disk_image_2'])
  21. if __name__ == '__main__':
  22. Main().cli()