From 2118210173cfad73e06cd4892691b296b9726309 Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Thu, 14 Nov 2024 03:02:45 +0300 Subject: [PATCH] import leapp-repository-0.21.0-2.el8_10 --- .gitignore | 4 +- .leapp-repository.metadata | 4 +- ...switch-to-container-mode-for-new-RHS.patch | 37 ---- ...-ARM-RHEL8-and-RHEL9-setup-entries-1.patch | 43 +++++ ...ngling-symlinks-for-containerized-RH.patch | 62 ------- SPECS/leapp-repository.spec | 165 +++++++++++++++--- 6 files changed, 192 insertions(+), 123 deletions(-) delete mode 100644 SOURCES/0001-RHSM-Adjust-the-switch-to-container-mode-for-new-RHS.patch create mode 100644 SOURCES/0001-rhui-alibaba-add-ARM-RHEL8-and-RHEL9-setup-entries-1.patch delete mode 100644 SOURCES/0002-Do-not-create-dangling-symlinks-for-containerized-RH.patch diff --git a/.gitignore b/.gitignore index c31af57..87e9389 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/deps-pkgs-9.tar.gz -SOURCES/leapp-repository-0.19.0.tar.gz +SOURCES/deps-pkgs-10.tar.gz +SOURCES/leapp-repository-0.21.0.tar.gz diff --git a/.leapp-repository.metadata b/.leapp-repository.metadata index 1597be5..0e21a29 100644 --- a/.leapp-repository.metadata +++ b/.leapp-repository.metadata @@ -1,2 +1,2 @@ -02499ccd70d4a8e6ce9ad29bd286a317d5e0b57b SOURCES/deps-pkgs-9.tar.gz -79402ad1aa427e43bdce143f4c0641dda383eb5d SOURCES/leapp-repository-0.19.0.tar.gz +d520ada12294e4dd8837c81f92d4c184ab403d51 SOURCES/deps-pkgs-10.tar.gz +9327be3720ccb3f7b285d2199463d7df0c38dfae SOURCES/leapp-repository-0.21.0.tar.gz diff --git a/SOURCES/0001-RHSM-Adjust-the-switch-to-container-mode-for-new-RHS.patch b/SOURCES/0001-RHSM-Adjust-the-switch-to-container-mode-for-new-RHS.patch deleted file mode 100644 index 241a920..0000000 --- a/SOURCES/0001-RHSM-Adjust-the-switch-to-container-mode-for-new-RHS.patch +++ /dev/null @@ -1,37 +0,0 @@ -From b6e409e1055b5d8b7f27e5df9eae096eb592a9c7 Mon Sep 17 00:00:00 2001 -From: Petr Stodulka -Date: Fri, 27 Oct 2023 13:34:38 +0200 -Subject: [PATCH] RHSM: Adjust the switch to container mode for new RHSM - -RHSM in RHEL 8.9+ & RHEL 9.3+ requires newly for the switch to the -container mode existence and content under /etc/pki/entitlement-host, -which in our case should by symlink to /etc/pki/entitlement. - -So currently we need for the correct switch 2 symlinks: - * /etc/pki/rhsm-host -> /etc/pki/rhsm - * /etc/pki/entitlement-host -> /etc/pki/entitlement - -Technically we need that only for RHEL 8.9+ but discussing it with -RHSM SST, we can do this change unconditionally for any RHEL system -as older versions of RHSM do not check /etc/pki/entitlement-host. - -jira: RHEL-14839 ---- - repos/system_upgrade/common/libraries/rhsm.py | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/repos/system_upgrade/common/libraries/rhsm.py b/repos/system_upgrade/common/libraries/rhsm.py -index 4a5b0eb0..18842021 100644 ---- a/repos/system_upgrade/common/libraries/rhsm.py -+++ b/repos/system_upgrade/common/libraries/rhsm.py -@@ -334,6 +334,7 @@ def set_container_mode(context): - return - try: - context.call(['ln', '-s', '/etc/rhsm', '/etc/rhsm-host']) -+ context.call(['ln', '-s', '/etc/pki/entitlement', '/etc/pki/entitlement-host']) - except CalledProcessError: - raise StopActorExecutionError( - message='Cannot set the container mode for the subscription-manager.') --- -2.41.0 - diff --git a/SOURCES/0001-rhui-alibaba-add-ARM-RHEL8-and-RHEL9-setup-entries-1.patch b/SOURCES/0001-rhui-alibaba-add-ARM-RHEL8-and-RHEL9-setup-entries-1.patch new file mode 100644 index 0000000..2f559b9 --- /dev/null +++ b/SOURCES/0001-rhui-alibaba-add-ARM-RHEL8-and-RHEL9-setup-entries-1.patch @@ -0,0 +1,43 @@ +From fbc38d4ad1d828e0553579e3719c0e4ed4a2a6bd Mon Sep 17 00:00:00 2001 +From: jinkangkang <1547182170@qq.com> +Date: Mon, 19 Aug 2024 18:46:08 +0800 +Subject: [PATCH] rhui(alibaba): add ARM RHEL8 and RHEL9 setup entries (#1277) + +Since leapp's RHUI mechanism filters setups based on the architecture of the source system, +it was not possible to upgrade of ARM-based RHEL systems on Alibaba cloud as there +were no ARM entries in RHUI_SETUPS. This patch adds these entries, making it possible +for EL 8 -> 9 upgrades of ARM systems on Alibaba cloud. +--- + repos/system_upgrade/common/libraries/rhui.py | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/repos/system_upgrade/common/libraries/rhui.py b/repos/system_upgrade/common/libraries/rhui.py +index 51694ac2..30de0275 100644 +--- a/repos/system_upgrade/common/libraries/rhui.py ++++ b/repos/system_upgrade/common/libraries/rhui.py +@@ -348,6 +348,22 @@ RHUI_SETUPS = { + ('content.crt', RHUI_PKI_PRODUCT_DIR) + ], + os_version='9'), ++ ], ++ RHUIFamily(RHUIProvider.ALIBABA, arch=arch.ARCH_ARM64, client_files_folder='alibaba'): [ ++ mk_rhui_setup(clients={'aliyun_rhui_rhel8'}, leapp_pkg='leapp-rhui-alibaba', ++ mandatory_files=[('leapp-alibaba.repo', YUM_REPOS_PATH)], ++ optional_files=[ ++ ('key.pem', RHUI_PKI_DIR), ++ ('content.crt', RHUI_PKI_PRODUCT_DIR) ++ ], ++ os_version='8'), ++ mk_rhui_setup(clients={'aliyun_rhui_rhel9'}, leapp_pkg='leapp-rhui-alibaba', ++ mandatory_files=[('leapp-alibaba.repo', YUM_REPOS_PATH)], ++ optional_files=[ ++ ('key.pem', RHUI_PKI_DIR), ++ ('content.crt', RHUI_PKI_PRODUCT_DIR) ++ ], ++ os_version='9'), + ] + } + +-- +2.45.2 + diff --git a/SOURCES/0002-Do-not-create-dangling-symlinks-for-containerized-RH.patch b/SOURCES/0002-Do-not-create-dangling-symlinks-for-containerized-RH.patch deleted file mode 100644 index 7739103..0000000 --- a/SOURCES/0002-Do-not-create-dangling-symlinks-for-containerized-RH.patch +++ /dev/null @@ -1,62 +0,0 @@ -From d1f28cbd143f2dce85f7f175308437954847aba8 Mon Sep 17 00:00:00 2001 -From: Petr Stodulka -Date: Thu, 2 Nov 2023 14:20:11 +0100 -Subject: [PATCH] Do not create dangling symlinks for containerized RHSM - -When setting RHSM into the container mode, we are creating symlinks -to /etc/rhsm and /etc/pki/entitlement directories. However, this -creates dangling symlinks if RHSM is not installed or user manually -removes one of these dirs. - -If any of these directories is missing, skip other actions and -log the warning. Usually it means that RHSM is not actually used -or installed at all, so in these cases we can do the skip. The -only corner case when system could use RHSM without -/etc/pki/entitlement is when RHSM is configured to put these -certificate on a different path, and we do not support nor cover -such a scenario as we are not scanning the RHSM configuration at -all. - -This also solves the problems on systems that does not have RHSM -available at all. ---- - repos/system_upgrade/common/libraries/rhsm.py | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - -diff --git a/repos/system_upgrade/common/libraries/rhsm.py b/repos/system_upgrade/common/libraries/rhsm.py -index 18842021..eb388829 100644 ---- a/repos/system_upgrade/common/libraries/rhsm.py -+++ b/repos/system_upgrade/common/libraries/rhsm.py -@@ -325,6 +325,11 @@ def set_container_mode(context): - could be affected and the generated repo file in the container could be - affected as well (e.g. when the release is set, using rhsm, on the host). - -+ We want to put RHSM into the container mode always when /etc/rhsm and -+ /etc/pki/entitlement directories exists, even when leapp is executed with -+ --no-rhsm option. If any of these directories are missing, skip other -+ actions - most likely RHSM is not installed in such a case. -+ - :param context: An instance of a mounting.IsolatedActions class - :type context: mounting.IsolatedActions class - """ -@@ -332,6 +337,17 @@ def set_container_mode(context): - api.current_logger().error('Trying to set RHSM into the container mode' - 'on host. Skipping the action.') - return -+ # TODO(pstodulk): check "rhsm identity" whether system is registered -+ # and the container mode should be required -+ if (not os.path.exists(context.full_path('/etc/rhsm')) -+ or not os.path.exists(context.full_path('/etc/pki/entitlement'))): -+ api.current_logger().warning( -+ 'Cannot set the container mode for the subscription-manager as' -+ ' one of required directories is missing. Most likely RHSM is not' -+ ' installed. Skipping other actions.' -+ ) -+ return -+ - try: - context.call(['ln', '-s', '/etc/rhsm', '/etc/rhsm-host']) - context.call(['ln', '-s', '/etc/pki/entitlement', '/etc/pki/entitlement-host']) --- -2.41.0 - diff --git a/SPECS/leapp-repository.spec b/SPECS/leapp-repository.spec index 41024aa..c972569 100644 --- a/SPECS/leapp-repository.spec +++ b/SPECS/leapp-repository.spec @@ -2,14 +2,24 @@ %global repositorydir %{leapp_datadir}/repositories %global custom_repositorydir %{leapp_datadir}/custom-repositories -%define leapp_repo_deps 9 +%define leapp_repo_deps 10 %if 0%{?rhel} == 7 %define leapp_python_sitelib %{python2_sitelib} %define lpr_name leapp-upgrade-el7toel8 + %define repo_shortname el7toel8 + %define next_major_ver 8 %else %define leapp_python_sitelib %{python3_sitelib} - %define lpr_name leapp-upgrade-el8toel9 + %if 0%{?rhel} == 8 + %define lpr_name leapp-upgrade-el8toel9 + %define repo_shortname el8toel9 + %define next_major_ver 9 + %else + %define lpr_name leapp-upgrade-el9toel10 + %define repo_shortname el9toel10 + %define next_major_ver 10 + %endif # This drops autogenerated deps on # - /usr/libexec/platform-python (rhel-8 buildroot) @@ -41,22 +51,21 @@ py2_byte_compile "%1" "%2"} # RHEL 8+ packages to be consistent with other leapp projects in future. Name: leapp-repository -Version: 0.19.0 -Release: 4%{?dist} +Version: 0.21.0 +Release: 2%{?dist} Summary: Repositories for leapp License: ASL 2.0 URL: https://oamg.github.io/leapp/ Source0: https://github.com/oamg/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz -Source1: deps-pkgs-9.tar.gz +Source1: deps-pkgs-10.tar.gz # NOTE: Our packages must be noarch. Do no drop this in any way. BuildArch: noarch ### PATCHES HERE # Patch0001: filename.patch -Patch0001: 0001-RHSM-Adjust-the-switch-to-container-mode-for-new-RHS.patch -Patch0002: 0002-Do-not-create-dangling-symlinks-for-containerized-RH.patch +Patch0001: 0001-rhui-alibaba-add-ARM-RHEL8-and-RHEL9-setup-entries-1.patch %description @@ -86,14 +95,24 @@ Obsoletes: leapp-repository-sos-plugin <= 0.10.0 Conflicts: leapp-upgrade-el8toel9 %else -######### RHEL 8 ############ +######### RHEL 8+ (and newer) ############ BuildRequires: python3-devel Requires: python3-leapp +# NOTE(pstodulk): else if / elif has been implemented quite late. as we still +# want to build on RHEL 7 too, go in the old way. Ref: +# https://github.com/rpm-software-management/rpm/issues/311 +%if 0%{?rhel} == 8 +######### RHEL 8 ############ + # Same as the conflict above - we want to be sure our packages are untouched # during the whole IPU process Conflicts: leapp-upgrade-el7toel8 - +Conflicts: leapp-upgrade-el9toel10 +%else +######### RHEL 9 ############ +Conflicts: leapp-upgrade-el8toel9 +%endif %endif # IMPORTANT: every time the requirements are changed, increment number by one @@ -151,6 +170,16 @@ Provides: leapp-repository-dependencies = %{leapp_repo_deps} ################################################## Requires: dnf >= 4 Requires: pciutils + +# required to be able to format disk images with XFS file systems (default) +Requires: xfsprogs + +# required to be able to format disk images with Ext4 file systems +# NOTE: this is not happening by default, but we can expact that many customers +# will want to / need to do this - especially on RHEL 7 now. Adding this deps +# as the best trade-off to resolve this problem. +Requires: e2fsprogs + %if 0%{?rhel} && 0%{?rhel} == 7 # Required to gather system facts about SELinux Requires: libselinux-python @@ -200,15 +229,10 @@ Requires: python3-gobject-base # APPLY PATCHES HERE # %%patch0001 -p1 %patch0001 -p1 -%patch0002 -p1 %build -%if 0%{?rhel} == 7 -cp -a leapp*deps*el8.noarch.rpm repos/system_upgrade/el7toel8/files/bundled-rpms/ -%else -cp -a leapp*deps*el9.noarch.rpm repos/system_upgrade/el8toel9/files/bundled-rpms/ -%endif +cp -a leapp*deps*el%{next_major_ver}.noarch.rpm repos/system_upgrade/%{repo_shortname}/files/bundled-rpms/ %install @@ -216,6 +240,7 @@ install -m 0755 -d %{buildroot}%{custom_repositorydir} install -m 0755 -d %{buildroot}%{repositorydir} cp -r repos/* %{buildroot}%{repositorydir}/ install -m 0755 -d %{buildroot}%{_sysconfdir}/leapp/repos.d/ +# NOTE(pstodulk): drop transaction dir and its content if replaced by config files before RHEL 10 install -m 0755 -d %{buildroot}%{_sysconfdir}/leapp/transaction/ install -m 0755 -d %{buildroot}%{_sysconfdir}/leapp/files/ install -m 0644 etc/leapp/transaction/* %{buildroot}%{_sysconfdir}/leapp/transaction @@ -228,11 +253,10 @@ rm -rf %{buildroot}%{leapp_python_sitelib}/leapp/cli/commands/tests # Remove irrelevant repositories - We don't want to ship them for the particular # RHEL version -%if 0%{?rhel} == 7 -rm -rf %{buildroot}%{repositorydir}/system_upgrade/el8toel9 -%else -rm -rf %{buildroot}%{repositorydir}/system_upgrade/el7toel8 -%endif +for i in el7toel8 el8toel9 el9toel10; +do + [ "$i" != "%{repo_shortname}" ] && rm -rf %{buildroot}%{repositorydir}/system_upgrade/$i +done # remove component/unit tests, Makefiles, ... stuff that related to testing only rm -rf %{buildroot}%{repositorydir}/common/actors/testactor @@ -278,6 +302,107 @@ done; # no files here %changelog +* Mon Aug 19 2024 Petr Stodulka - 0.21.0-2 +- Updated SPEC file to drop leapp repositories unrelated to IPU 8 -> 9 +- Resolves: RHEL-27847 + +* Fri Aug 16 2024 Toshio Kuratomi - 0.21.0-1 +- Rebase to new upstream 0.21.0 +- Updated leapp data files. +- Inhibit the upgrade to RHEL 9.5 on ARM architecture due to + incompatibility between the RHEL 8 bootloader and RHEL 9.5 kernel. +- Introduce experimental upgrades in 'live' mode for the testing. +- Resolves: RHEL-27847, RHEL-52993, RHEL-45280, RHEL-49748, RHEL-52186 + +* Wed Jul 24 2024 Toshio Kuratomi - 0.20.0-5 +- Improve set_systemd_services_states logging +- [IPU 7 -> 8] Fix detection of bootable device on RAID +- Fix detection of valid sshd config with internal-sftp subsystem in Leapp +- Handle a false positive GPG check error when TargetUserSpaceInfo is missing +- Fix failing "update-ca-trust" command caused by missing util-linux package +- Improve report when a system is unsupported +- Fix handling of versions in RHUI configuration for ELS and SAP upgrades +- Add missing RHUI GCP config info for RHEL for SAP +- Fix upgrade on aarch64 via RHUI on AWS +- Resolves: RHEL-33902, RHEL-38909, RHEL-30573, RHEL-43978, RHEL-39046, RHEL-39047, RHEL-39049 + +* Thu May 30 2024 Petr Stodulka - 0.20.0-4 +- Enable new upgrade path RHEL 8.10 -> 9.5 +- Minor updates in reports +- Add information about leapp invocation to leapp.db +- Resolves: RHEL-27847 + +* Mon May 13 2024 Toshio Kuratomi - 0.20.0-3 +- Do not terminate the upgrade dracut module execution if + /sysroot/root/tmp_leapp_py3/.leapp_upgrade_failed exists +- Several minor improvements in messages printed in console output +- Several minor improvements in report and error messages +- Fix the parsing of the lscpu output +- Fix evaluation of PES data +- Target by default always "GA" channel repositories unless a different + channel is specified for the leapp execution +- Fix creation of the post upgrade report about changes in states of systemd + services +- Update the device driver deprecation data, fixing invalid fields for some + AMD CPUs +- Update the default kernel cmdline +- Wait for the storage initialization when /usr is on separate file system - + covering SAN +- Resolves: RHEL-27847, RHEL-35240 + +* Tue Feb 20 2024 Petr Stodulka - 0.20.0-2 +- Fallback to original RHUI solution on AWS to fix issues caused by changes in RHUI client +- Resolves: RHEL-16729 + +* Tue Feb 13 2024 Toshio Kuratomi - 0.20.0-1 +- Rebase to new upstream v0.20.0. +- Fix semanage import issue +- Fix handling of libvirt's systemd services +- Add a dracut breakpoint for the pre-upgrade step. +- Drop obsoleted upgrade paths (obsoleted releases: 8.6, 8.9, 9.0, 9.3) +- Resolves: RHEL-16729 + +* Tue Jan 23 2024 Toshio Kuratomi - 0.19.0-10 +- Print nice error msg when device and driver deprecation data is malformed +- Fix another cornercase when preserving symlinks to certificates in /etc/pki +- Update the leapp upgrade data files - fixing upgrades with idm-tomcatjss +- Resolves: RHEL-16729 + +* Fri Jan 19 2024 Petr Stodulka - 0.19.0-9 +- Do not try to download data files anymore when missing as the service + is obsoleted since the data is part of installed packages +- Update error messages and reports when installed upgrade data files + are malformed or missing to instruct user how to resolve it +- Update the leapp upgrade data files - bump data stream to "3.0" +- Resolves: RHEL-16729 + +* Fri Jan 12 2024 Petr Stodulka - 0.19.0-7 +- Add detection of possible usage of OpenSSL IBMCA engine on IBM Z machines +- Add detection of modified /etc/pki/tls/openssl.cnf file +- Update the leapp upgrade data files +- Fix handling of symlinks under /etc/pki with relative paths specified +- Report custom actors and modifications of the upgrade tooling +- Requires xfsprogs and e2fsprogs to ensure that Ext4 and XFS tools are installed +- Bump leapp-repository-dependencies to 10 +- Resolves: RHEL-1774, RHEL-16729 + +* Thu Nov 16 2023 Petr Stodulka - 0.19.0-5 +- Enable new upgrade path for RHEL 8.10 -> RHEL 9.4 (including RHEL with SAP HANA) +- Introduce generic transition of systemd services states during the IPU +- Introduce possibility to upgrade with local repositories +- Improve possibilities of upgrade when a proxy is configured in DNF configutation file +- Fix handling of symlinks under /etc/pki when managing certificates +- Fix the upgrade with custom https repositories +- Default to the NO_RHSM mode when subscription-manager is not installed +- Detect customized configuration of dynamic linker +- Drop the invalid `tuv` target channel for the --channel option +- Fix the issue of going out of bounds in the isccfg parser +- Fix traceback when saving the rhsm facts results and the /etc/rhsm/facts directory doesn’t exist yet +- Load all rpm repository substitutions that dnf knows about, not just "releasever" only +- Simplify handling of upgrades on systems using RHUI, reducing the maintenance burden for cloud providers +- Detect possible unexpected RPM GPG keys has been installed during RPM transaction +- Resolves: RHEL-16729 + * Thu Nov 02 2023 Petr Stodulka - 0.19.0-4 - Fix the upgrade for systems without subscription-manager package - Resolves: RHEL-14901