Skip to content

Instantly share code, notes, and snippets.

View r0x0d's full-sized avatar
:shipit:
Working from home

Rodolfo Olivieri r0x0d

:shipit:
Working from home
View GitHub Profile
diff --git a/convert2rhel/backup/packages.py b/convert2rhel/backup/packages.py
index 47f70c5b..df69b361 100644
--- a/convert2rhel/backup/packages.py
+++ b/convert2rhel/backup/packages.py
@@ -136,10 +136,10 @@ class RestorablePackage(RestorableChange):
loggerinst.info("Backing up the packages: %s." % ",".join(self.pkgs))
loggerinst.debug("Using repository files stored in %s." % self.reposdir)
- if self.reposdir:
+ if self.reposdir and os.path.exists(self.reposdir):
[General]
Name=God Tier Equalizer
[Eq_Bands]
Eq_Band_1=5
Eq_Band_2=-4
Eq_Band_3=5
Eq_Band_4=-5
Eq_Band_5=4
Eq_Freq_Band_1=80
@r0x0d
r0x0d / actions---__init__.diff
Last active January 15, 2024 14:44
extending the action framework
diff --git a/convert2rhel/actions/__init__.py b/convert2rhel/actions/__init__.py
index ce8c06f..1ae7375 100644
--- a/convert2rhel/actions/__init__.py
+++ b/convert2rhel/actions/__init__.py
@@ -691,7 +691,7 @@ def resolve_action_order(potential_actions, previously_resolved_actions=None):
)
-def run_actions():
+def run_pre_actions():
diff --git a/convert2rhel/data/7/x86_64/configs/centos-7-x86_64.cfg b/convert2rhel/data/7/x86_64/configs/centos-7-x86_64.cfg
index 0153c9cd..f0438b10 100644
--- a/convert2rhel/data/7/x86_64/configs/centos-7-x86_64.cfg
+++ b/convert2rhel/data/7/x86_64/configs/centos-7-x86_64.cfg
@@ -23,6 +23,12 @@ excluded_pkgs =
yum-rhn-plugin
gnome-documents-libs
+# Mapping of packages that need to be swapped during the transaction
+# The format of the mapping is as follow: old_package | new_pakcage
import yum
from convert2rhel.pkgmanager.handlers.yum.callback import PackageDownloadCallback, TransactionDisplayCallback
base = yum.YumBase()
base.conf.yumvar["releasever"] = "7Server"
base.repos.disableRepo("*")
base.repos.enableRepo("rhel-7-server-rpms")
base.repos.setProgressBar(PackageDownloadCallback())
can_update = base.update(pattern="httpd")
print(can_update)
@r0x0d
r0x0d / parsing.py
Last active November 30, 2023 12:40
no_errors = """
Successfully validated the yum transaction set.
VALIDATE_PACKAGE_MANAGER_TRANSACTION has succeeded
Writing breadcrumbs to '/etc/migration-results'.
Writing RHSM custom facts to '/etc/rhsm/facts/convert2rhel.facts'.
WARNING - Abnormal exit! Performing rollback ...
[2023-11-29T17:56:54+0000] TASK - [Rollback: Remove installed packages] ******************************
No package to remove
@r0x0d
r0x0d / check.py
Last active December 20, 2023 19:41
CLEANUP_MODULES_ON_EXIT_REGEX = re.compile(r"(?i)CleanupModulesOnExit\s*=\s*(yes|true)")
def _is_modules_cleanup_enabled():
"""Verify firewalld modules cleanup config is enabled.
:returns: Whether or not the CleanupModulesOnExit is set to true in
firewalld config.
:rtype: bool
"""
# Return false if the config file does not exist. Either it means that
diff --git a/convert2rhel/actions/system_checks/eus.py b/convert2rhel/actions/system_checks/eus.py
index 8a617e29..2abe736d 100644
--- a/convert2rhel/actions/system_checks/eus.py
+++ b/convert2rhel/actions/system_checks/eus.py
@@ -17,7 +17,7 @@ __metaclass__ = type
import logging
-from datetime import datetime
+import datetime
========== Error (Must fix before conversion) ==========
(ERROR) IS_LOADED_KERNEL_LATEST.INVALID_KERNEL_VERSION: The version of the loaded kernel is different from the latest version in the enabled system repositories
Description: [No further information given]
Diagnosis: The version of the loaded kernel is different from the
latest version in the enabled system repositories.
Latest kernel version available in ol7_latest: 3.10.0-1160.95.1.0.1.el7
Loaded kernel version: 5.4.17-2136.307.3.1.el7uek
To proceed with the conversion, update the kernel version by executing the following step:
1. yum install kernel-3.10.0-1160.95.1.0.1.el7 -y
.TH CONVERT2RHEL "1" "2023\-08\-14" "Convert2RHEL" "General Commands Manual"
.SH NAME
convert2rhel \- Automates the conversion of Red Hat Enterprise Linux derivative distributions to Red Hat Enterprise Linux.
.SH SYNOPSIS
.B convert2rhel
[--version] [--debug] [-h] [--config_file CONFIG_FILE] {analyze,convert} ...
.SH DESCRIPTION
The Convert2RHEL utility automates converting Red Hat Enterprise Linux derivative distributions to Red Hat Enterprise Linux. The whole conversion procedure is performed on the running RHEL derivative OS installation and a restart is needed at the end of the conversion to boot into the RHEL kernel. The utility replaces the original OS packages with the RHEL ones. Available are conversions of CentOS Linux 6/7/8, Oracle Linux 6/7/8, Scientific Linux 7, Alma Linux 8, and Rocky Linux 8 to the respective major version of RHEL.
.SH OPTIONS