1
0
mirror of https://github.com/gryf/boxpy.git synced 2025-12-19 05:30:18 +01:00

Bump Debian, Fedora and Ubuntu versions.

Also, set Ubuntu latest LTS as default.
This commit is contained in:
2024-04-30 15:10:03 +02:00
parent 2a1a4cf40a
commit 3d840de3ee
2 changed files with 14 additions and 7 deletions

View File

@@ -36,10 +36,12 @@ Tested distros
- 18.04 - 18.04
- 20.04 - 20.04
- 22.04 - 22.04
- 24.04
- Fedora - Fedora
- 37 - 37
- 38 - 38
- 39 - 39
- 40
- Centos Stream - Centos Stream
- 8 - 8
- 9 - 9
@@ -47,6 +49,7 @@ Tested distros
- 10 (buster) - 10 (buster)
- 11 (bullseye) - 11 (bullseye)
- 12 (bookworm) - 12 (bookworm)
- 13 (trixie) - prerelease
There is possibility to use whatever OS image which supports cloud-init. Use There is possibility to use whatever OS image which supports cloud-init. Use
the ``--image`` param for ``create`` command to pass image filename, although the ``--image`` param for ``create`` command to pass image filename, although

16
box.py
View File

@@ -22,8 +22,9 @@ __version__ = "1.9.2"
CACHE_DIR = os.environ.get('XDG_CACHE_HOME', os.path.expanduser('~/.cache')) CACHE_DIR = os.environ.get('XDG_CACHE_HOME', os.path.expanduser('~/.cache'))
CLOUD_IMAGE = "ci.iso" CLOUD_IMAGE = "ci.iso"
FEDORA_RELEASE_MAP = {'37': '1.7', '38': '1.6', '39': '1.5'} FEDORA_RELEASE_MAP = {'37': '1.7', '38': '1.6', '39': '1.5', '40': '1.14'}
DEBIAN_CODENAME_MAP = {'12': 'bookworm', '11': 'bullseye', '10': 'buster'} DEBIAN_CODENAME_MAP = {'13': 'trixie', '12': 'bookworm', '11': 'bullseye',
'10': 'buster'}
TYPE_MAP = {'HardDisk': 'disk', 'DVD': 'dvd', 'Floppy': 'floppy'} TYPE_MAP = {'HardDisk': 'disk', 'DVD': 'dvd', 'Floppy': 'floppy'}
DISTRO_MAP = {'ubuntu': 'Ubuntu', 'fedora': 'Fedora', DISTRO_MAP = {'ubuntu': 'Ubuntu', 'fedora': 'Fedora',
'centos': 'Centos Stream', 'debian': 'Debian'} 'centos': 'Centos Stream', 'debian': 'Debian'}
@@ -1047,8 +1048,7 @@ class Image:
return True return True
fname = os.path.join(CACHE_DIR, self._img_fname) fname = os.path.join(CACHE_DIR, self._img_fname)
LOG.header('Downloading image %s from %s', self._img_fname, LOG.header('Downloading image %s', self._img_url)
self._img_url)
Run(['wget', '-q', self._img_url, '-O', fname]) Run(['wget', '-q', self._img_url, '-O', fname])
if not self._checksum(): if not self._checksum():
@@ -1118,6 +1118,10 @@ class Fedora(Image):
def __init__(self, vbox, version, arch, release, fname=None): def __init__(self, vbox, version, arch, release, fname=None):
super().__init__(vbox, version, arch, release) super().__init__(vbox, version, arch, release)
if int(version) > 39:
self.IMG = "Fedora-Cloud-Base-Generic.%s-%s-%s.qcow2"
self._img_fname = self.IMG % (arch, version, release)
else:
self._img_fname = self.IMG % (version, release, arch) self._img_fname = self.IMG % (version, release, arch)
self._img_url = self.URL % (version, arch, self._img_fname) self._img_url = self.URL % (version, arch, self._img_fname)
self._checksum_file = self.CHKS % (version, release, arch) self._checksum_file = self.CHKS % (version, release, arch)
@@ -1198,12 +1202,12 @@ DISTROS = {'ubuntu': {'username': 'ubuntu',
'realname': 'ubuntu', 'realname': 'ubuntu',
'img_class': Ubuntu, 'img_class': Ubuntu,
'amd64': 'amd64', 'amd64': 'amd64',
'default_version': '22.04'}, 'default_version': '24.04'},
'fedora': {'username': 'fedora', 'fedora': {'username': 'fedora',
'realname': 'fedora', 'realname': 'fedora',
'img_class': Fedora, 'img_class': Fedora,
'amd64': 'x86_64', 'amd64': 'x86_64',
'default_version': '39'}, 'default_version': '40'},
'centos': {'username': 'centos', 'centos': {'username': 'centos',
'realname': 'centos', 'realname': 'centos',
'img_class': CentosStream, 'img_class': CentosStream,