IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

12345678910111213141516171819202122
  1. import subprocess
  2. import hashlib
  3. from .misc import find_prefix
  4. from .zfs import zfs_poolname, \
  5. zfs_mountpoint, \
  6. zfs_tag
  7. def command_bootstrap(args):
  8. version = subprocess.check_output(['freebsd-version']).decode('utf-8')
  9. print('FreeBSD version:', version)
  10. tags = [ 'freebsd-' + version.split('-')[0], 'freebsd-latest' ]
  11. sha256 = hashlib.sha256(('FreeBSD ' + version).encode('utf-8')).hexdigest()
  12. poolname = zfs_poolname()
  13. name = find_prefix(poolname + '/focker/images/', sha256)
  14. subprocess.check_output(['zfs', 'create', '-o', 'focker:sha256=' + sha256, name])
  15. zfs_tag(name, tags)
  16. res = subprocess.run(['bsdinstall', 'jail', zfs_mountpoint(name)])
  17. if res.returncode != 0:
  18. raise ValueError('bsdinstall failed')
  19. subprocess.check_output(['zfs', 'set', 'rdonly=on', name])
  20. subprocess.check_output(['zfs', 'snapshot', name + '@1'])