From f700584be494beeef314ab47b0403263dac88aa6 Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Tue, 26 May 2026 14:52:00 +0300 Subject: [PATCH] scripts: Add Rocky Linux kernel support --- scripts/generate-kernel-patch | 2 +- scripts/kernel-functions | 6 +++--- scripts/rhel-rpm-functions | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/scripts/generate-kernel-patch b/scripts/generate-kernel-patch index e54b65ab2..59458daca 100755 --- a/scripts/generate-kernel-patch +++ b/scripts/generate-kernel-patch @@ -113,7 +113,7 @@ function specialize_patch { local releasevermajor="$1" local releaseverminor="$2" case "$distro" in - CentOS|AlmaLinux) + CentOS|AlmaLinux|RockyLinux|Rocky) if [ -n "$releasevermajor" ]; then ao=( -v "RHEL_MAJOR=$releasevermajor" diff --git a/scripts/kernel-functions b/scripts/kernel-functions index 21d904e5f..7d0eb9694 100644 --- a/scripts/kernel-functions +++ b/scripts/kernel-functions @@ -131,7 +131,7 @@ function extract_kernel_tree { function patch_kernel { case "$1" in *^*) - # RHEL / CentOS or UEK. + # RHEL-compatible distro or UEK. ;; *) # See also commit f153b82121b0 ("Sanitize gcc version header @@ -837,7 +837,7 @@ function download_and_extract_distro_rpm { tr '\n' ' ')" for url in "${urls[@]}"; do case "$distro" in - CentOS|AlmaLinux) + CentOS|AlmaLinux|RockyLinux|Rocky) wget -q -nc "${url}/kernel-${kver}.src.rpm" && break ;; UEK) @@ -852,7 +852,7 @@ function download_and_extract_distro_rpm { ( cd "${tmpdir}" && case "$distro" in - CentOS|AlmaLinux) + CentOS|AlmaLinux|RockyLinux|Rocky) rpm2cpio "${kernel_downloads}/kernel-${kver}.src.rpm" | cpio -i --make-directories --quiet && tar xaf "linux-${kver}"*.tar.* && diff --git a/scripts/rhel-rpm-functions b/scripts/rhel-rpm-functions index b7f535f7f..e88409d12 100644 --- a/scripts/rhel-rpm-functions +++ b/scripts/rhel-rpm-functions @@ -41,6 +41,15 @@ function get_srpm_urls() { echo "https://repo.almalinux.org/vault/${releasever}/BaseOS/Source/Packages/";; esac ;; + "RockyLinux"|"Rocky") + case $releasever in + [89]*|10*) + echo "https://dl.rockylinux.org/pub/rocky/${releasever}/BaseOS/source/tree/Packages/k/" + echo "https://dl.rockylinux.org/pub/rocky/${releasever}/BaseOS/source/tree/Packages/" + echo "https://dl.rockylinux.org/vault/rocky/${releasever}/BaseOS/source/tree/Packages/k/" + echo "https://dl.rockylinux.org/vault/rocky/${releasever}/BaseOS/source/tree/Packages/";; + esac + ;; "Oracle Linux Server"|"UEK") echo "http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/${releaseverminor}/base/${arch}/getPackageSource" echo "http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/latest/${arch}/getPackageSource" @@ -101,6 +110,15 @@ function get_rpm_urls() { echo "https://mirror.yandex.ru/almalinux/${releasever}/BaseOS/${arch}/os/Packages/";; esac ;; + "RockyLinux"|"Rocky") + case $releasever in + [89]*|10*) + echo "https://dl.rockylinux.org/pub/rocky/${releasever}/BaseOS/${arch}/os/Packages/k/" + echo "https://dl.rockylinux.org/pub/rocky/${releasever}/BaseOS/${arch}/os/Packages/" + echo "https://dl.rockylinux.org/vault/rocky/${releasever}/BaseOS/${arch}/os/Packages/k/" + echo "https://dl.rockylinux.org/vault/rocky/${releasever}/BaseOS/${arch}/os/Packages/";; + esac + ;; "Oracle Linux Server"|"UEK") echo "http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/${releaseverminor}/base/${arch}/getPackageSource" echo "http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/latest/${arch}/getPackageSource"