Skip to content

Commit

Permalink
Fix older kernel installation on Alma and Rocky
Browse files Browse the repository at this point in the history
* we installed a kernel too old, so RHEL incompatible kmods got inserted
* install the kernel from less distant minor (8.8 - 8.6, 8.10 - 8.8)

Signed-off-by: Daniel Diblik <[email protected]>
  • Loading branch information
danmyway committed May 30, 2024
1 parent b2ec65c commit 88af501
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
24 changes: 18 additions & 6 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,13 @@ def _create_old_repo(distro: str, repo_name: str):
"""
baseurl = None
if distro == "alma":
baseurl = "https://repo.almalinux.org/vault/8.6/BaseOS/$basearch/os/"
baseurl = "https://repo.almalinux.org/vault/8.8/BaseOS/$basearch/os/"
if "8.8" in SYSTEM_RELEASE_ENV:
baseurl = "https://repo.almalinux.org/vault/8.6/BaseOS/$basearch/os/"
elif distro == "rocky":
baseurl = "https://download.rockylinux.org/vault/rocky/8.6/BaseOS/$basearch/os/"
baseurl = "https://download.rockylinux.org/vault/rocky/8.8/BaseOS/$basearch/os/"
if "8.8" in SYSTEM_RELEASE_ENV:
baseurl = "https://download.rockylinux.org/vault/rocky/8.6/BaseOS/$basearch/os/"
else:
pytest.fail(f"Unsupported distro ({distro}) provided.")
with open(f"/etc/yum.repos.d/{repo_name}.repo", "w") as f:
Expand Down Expand Up @@ -681,13 +685,21 @@ def kernel(shell):
elif "alma-8" in SYSTEM_RELEASE_ENV:
repo_name = "alma_old"
_create_old_repo(distro="alma", repo_name=repo_name)
assert shell(f"yum install kernel-4.18.0-372.13.1.el8_6.x86_64 -y --enablerepo {repo_name}")
shell("grub2-set-default 'AlmaLinux (4.18.0-372.13.1.el8_6.x86_64) 8.6 (Sky Tiger)'")
if "8.8" in SYSTEM_RELEASE_ENV:
assert shell(f"yum install kernel-4.18.0-372.13.1.el8_6.x86_64 -y --enablerepo {repo_name}")
shell("grub2-set-default 'AlmaLinux (4.18.0-372.13.1.el8_6.x86_64) 8.6 (Sky Tiger)'")
else:
assert shell(f"yum install kernel-4.18.0-477.27.2.el8_8.x86_64 -y --enablerepo {repo_name}")
shell("grub2-set-default 'AlmaLinux (4.18.0-477.27.2.el8_8.x86_64) 8.8 (Sapphire Caracal)'")
elif "rocky-8" in SYSTEM_RELEASE_ENV:
repo_name = "rocky_old"
_create_old_repo(distro="rocky", repo_name=repo_name)
assert shell(f"yum install kernel-4.18.0-372.13.1.el8_6.x86_64 -y --enablerepo {repo_name}")
shell("grub2-set-default 'Rocky Linux (4.18.0-372.13.1.el8_6.x86_64) 8.6 (Green Obsidian)'")
if "8.8" in SYSTEM_RELEASE_ENV:
assert shell(f"yum install kernel-4.18.0-372.13.1.el8_6.x86_64 -y --enablerepo {repo_name}")
shell("grub2-set-default 'Rocky Linux (4.18.0-372.13.1.el8_6.x86_64) 8.6 (Green Obsidian)'")
else:
assert shell(f"yum install kernel-4.18.0-477.27.1.el8_8.x86_64 -y --enablerepo {repo_name}")
shell("grub2-set-default 'Rocky Linux (4.18.0-477.27.1.el8_8.x86_64) 8.8 (Green Obsidian)'")
elif "stream-8" in SYSTEM_RELEASE_ENV:
# Given the CentOS Stream rolling release, we are able to just downgrade the kernel
assert shell("yum downgrade kernel -y").returncode == 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ tag+:
CONVERT2RHEL_ALLOW_UNAVAILABLE_KMODS: 1
when: distro == oracle-8
because: |
When we install the older kernel, RHEL incompatible kernel modules are inserted in as well,
When we install the older kernel, RHEL incompatible kernel modules are inserted in as well,
raising an inhibitor during the conversion.
environment+:
CONVERT2RHEL_SKIP_KERNEL_CURRENCY_CHECK: 1
Expand Down

0 comments on commit 88af501

Please sign in to comment.