From: Daan De Meyer Date: Tue, 17 Jan 2023 12:23:52 +0000 (+0100) Subject: centos: Add extras repo on centos stream 9 X-Git-Tag: v15~361^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d42ffeebae069b343c0de50cdd62f4c47ee1e00;p=thirdparty%2Fmkosi.git centos: Add extras repo on centos stream 9 We already add the extras repository on centos stream 8, let's do the same on centos stream 9. --- diff --git a/mkosi/distributions/alma.py b/mkosi/distributions/alma.py index 4c54de895..9e08f6c87 100644 --- a/mkosi/distributions/alma.py +++ b/mkosi/distributions/alma.py @@ -13,6 +13,13 @@ class AlmaInstaller(CentosInstaller): "https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux-$releasever", ) + @staticmethod + def _extras_gpg_locations(epel_release: int) -> tuple[Path, str]: + return ( + Path("/etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-$releasever"), + "https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux-$releasever", + ) + @classmethod def _mirror_directory(cls) -> str: return "almalinux" diff --git a/mkosi/distributions/centos.py b/mkosi/distributions/centos.py index f55e86122..4a67577ae 100644 --- a/mkosi/distributions/centos.py +++ b/mkosi/distributions/centos.py @@ -111,6 +111,13 @@ class CentosInstaller(DistributionInstaller): "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-$releasever", ) + @staticmethod + def _extras_gpg_locations(epel_release: int) -> tuple[Path, str]: + return ( + Path("/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512"), + "https://www.centos.org/keys/RPM-GPG-KEY-CentOS-SIG-Extras" + ) + @classmethod def _mirror_directory(cls) -> str: return "centos" @@ -173,24 +180,29 @@ class CentosInstaller(DistributionInstaller): gpgpath, gpgurl = cls._gpg_locations(epel_release) epel_gpgpath, epel_gpgurl = cls._epel_gpg_locations() + extras_gpgpath, extras_gpgurl = cls._extras_gpg_locations(epel_release) if config.local_mirror: appstream_url = f"baseurl={config.local_mirror}" - baseos_url = crb_url = epel_url = None + baseos_url = extras_url = crb_url = epel_url = None elif config.mirror: appstream_url = f"baseurl={config.mirror}/centos-stream/$stream/AppStream/$basearch/os" baseos_url = f"baseurl={config.mirror}/centos-stream/$stream/BaseOS/$basearch/os" + extras_url = f"baseurl={config.mirror}/centos-stream/SIGS/$stream/extras/$basearch/extras-common" crb_url = f"baseurl={config.mirror}/centos-stream/$stream/CRB/$basearch/os" epel_url = f"baseurl={config.mirror}/epel/$stream/Everything/$basearch" else: appstream_url = "metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-$stream&arch=$basearch&protocol=https,http" baseos_url = "metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-$stream&arch=$basearch&protocol=https,http" + extras_url = "metalink=https://mirrors.centos.org/metalink?repo=centos-extras-sig-extras-common-$stream&arch=$basearch&protocol=https,http" crb_url = "metalink=https://mirrors.centos.org/metalink?repo=centos-crb-$stream&arch=$basearch&protocol=https,http" epel_url = "mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=epel-$releasever&arch=$basearch&protocol=https,http" repos = [Repo("appstream", appstream_url, gpgpath, gpgurl)] if baseos_url is not None: repos += [Repo("baseos", baseos_url, gpgpath, gpgurl)] + if extras_url is not None: + repos += [Repo("extras", extras_url, extras_gpgpath, extras_gpgurl)] if crb_url is not None: repos += [Repo("crb", crb_url, gpgpath, gpgurl)] if epel_url is not None: diff --git a/mkosi/distributions/rocky.py b/mkosi/distributions/rocky.py index fba7c4700..d41813038 100644 --- a/mkosi/distributions/rocky.py +++ b/mkosi/distributions/rocky.py @@ -14,6 +14,14 @@ class RockyInstaller(CentosInstaller): f"https://download.rockylinux.org/pub/rocky/RPM-GPG-KEY-{keyname}" ) + @staticmethod + def _extras_gpg_locations(epel_release: int) -> tuple[Path, str]: + keyname = "Rocky-$releasever" if epel_release >= 9 else "rockyofficial" + return ( + Path(f"/etc/pki/rpm-gpg/RPM-GPG-KEY-{keyname}"), + f"https://download.rockylinux.org/pub/rocky/RPM-GPG-KEY-{keyname}" + ) + @classmethod def _mirror_directory(cls) -> str: return "rocky"