From: Marcin Godzina Date: Wed, 24 Apr 2024 11:29:29 +0000 (+0000) Subject: [#3247] add rocky linux 9 X-Git-Tag: Kea-2.5.8~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f05be9d466f08cd5d14e01ac2318788b4b9a787b;p=thirdparty%2Fkea.git [#3247] add rocky linux 9 --- diff --git a/hammer.py b/hammer.py index e03012c788..c1d5a07b7d 100755 --- a/hammer.py +++ b/hammer.py @@ -73,6 +73,9 @@ SYSTEMS = { '8': True, '9': True, }, + 'rocky': { + '9': True, + }, 'ubuntu': { '16.04': False, '18.04': True, @@ -275,6 +278,8 @@ def get_system_revision(): elif system == 'redhat': system = 'rhel' revision = revision[0] + elif system == 'rocky': + revision = revision[0] elif system == 'centos': revision = revision[0] if not system or not revision: @@ -290,10 +295,14 @@ def get_system_revision(): for i in ['ID', 'ID_LIKE']: if i in vals: - system_candidate=vals[i].strip('"') - if system_candidate in SYSTEMS: - system = system_candidate - break + system_candidates=vals[i].strip('"').split() + for system_candidate in system_candidates: + if system_candidate in SYSTEMS: + system = system_candidate + break + else: + continue + break if system is None: raise Exception('cannot determine system') @@ -304,7 +313,7 @@ def get_system_revision(): if revision is None: raise Exception('cannot determine revision') - if system in ['alpine', 'rhel']: + if system in ['alpine', 'rhel', 'rocky']: revision = revision.rsplit('.', 1)[0] else: raise Exception('cannot determine system or its revision') @@ -496,8 +505,8 @@ def install_pkgs(pkgs, timeout=60, env=None, check_times=False, pkg_cache=None): pkg_cache = {} # prepare cache if needed - if not pkg_cache and system in ['centos', 'rhel', 'fedora', 'debian', 'ubuntu']:#, 'alpine']: # TODO: complete caching support for alpine - if system in ['centos', 'rhel', 'fedora']: + if not pkg_cache and system in ['centos', 'rhel', 'fedora', 'debian', 'ubuntu', 'rocky']:#, 'alpine']: # TODO: complete caching support for alpine + if system in ['centos', 'rhel', 'fedora', 'rocky']: pkg_cache.update(_prepare_installed_packages_cache_for_rpms()) elif system in ['debian', 'ubuntu']: pkg_cache.update(_prepare_installed_packages_cache_for_debs()) @@ -521,7 +530,7 @@ def install_pkgs(pkgs, timeout=60, env=None, check_times=False, pkg_cache=None): log.info('all packages already installed') return - if system in ['centos', 'fedora', 'rhel']: + if system in ['centos', 'fedora', 'rhel', 'rocky']: if system in ['centos', 'rhel'] and revision == '7': execute('sudo yum install -y dnf') cmd = 'sudo dnf -y install' @@ -892,7 +901,7 @@ class VagrantEnv(object): upload_cmd += ' -X POST -H "Content-Type: multipart/form-data" --data-binary "@%s" ' file_ext = 'deb' # include both '.deb' and '.ddeb' files - elif self.system in ['fedora', 'centos', 'rhel']: + elif self.system in ['fedora', 'centos', 'rhel', 'rocky']: upload_cmd += ' --upload-file %s ' file_ext = '.rpm' @@ -1026,7 +1035,7 @@ class VagrantEnv(object): # RPM-based distributions install libraries in /usr/local/lib64, but they # tend to not look there at runtime without explicit mention in ld.so.conf.d. - if self.system in ['centos', 'fedora', 'rhel']: + if self.system in ['centos', 'fedora', 'rhel', 'rocky']: self.execute('sudo echo /usr/local/lib64 > /etc/ld.so.conf.d/kea.conf') # ldconfig only in case the change above was not there before system startup self.execute('sudo ldconfig') @@ -1058,7 +1067,7 @@ class VagrantEnv(object): log.info('') def prepare_for_boxing(self): - if self.system in ['debian', 'ubuntu', 'fedora', 'centos', 'rhel']: + if self.system in ['debian', 'ubuntu', 'fedora', 'centos', 'rhel', 'rocky']: # setup a script that on first boot will set machine-id cmd = 'bash -c \'cat <