Skip to content

Commit ac05e73

Browse files
committed
feat: add EL9-specific package removal support
- Add REMOVE_PKGS_EL9 array for EL9-specific packages (udisks2-btrfs) - Extend remove_os_specific_packages_before_migration() to accept os_version parameter - Automatically merge REMOVE_PKGS_EL9 into REMOVE_PKGS when migrating EL9 systems - Improve custom kernel removal command output for better usability
1 parent c1e6621 commit ac05e73

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

almalinux-deploy.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ REMOVE_PKGS=("centos-linux-release" "centos-gpg-keys" "centos-linux-repos" \
5454
"vzlinux-release" "vzlinux-gpg-keys" "vzlinux-repos" "vzlinux-obsolete-packages" \
5555
"evolution-data-server-ui" "epel-next-release" "openssl-fips-provider" "openssl-fips-provider-so" \
5656
"fips-provider-next")
57+
REMOVE_PKGS_EL9=("udisks2-btrfs")
5758
REDHAT_DNF_PLUGINS=("product-id" "subscription-manager" "upload-profile")
5859
REDHAT_REPO_FILES=("/etc/yum.repos.d/redhat.repo" "/etc/yum.repos.d/ubi.repo")
5960
REDHAT_RHSM_RPMS=("subscription-manager" "subscription-manager-cockpit" "cockpit" "rhc")
@@ -745,6 +746,13 @@ remove_os_specific_packages_before_migration() {
745746
if get_status_of_stage "remove_os_specific_packages_before_migration"; then
746747
return 0
747748
fi
749+
local -r os_version="${1}"
750+
751+
# Extend REMOVE_PKGS with EL9-specific packages if migrating EL9
752+
if [[ "${os_version}" == 9* ]]; then
753+
REMOVE_PKGS+=("${REMOVE_PKGS_EL9[@]}")
754+
fi
755+
748756
for i in "${!REMOVE_PKGS[@]}"; do
749757
if ! rpm -q "${REMOVE_PKGS[i]}" &> /dev/null; then
750758
# remove an erased package from the list if it isn't installed
@@ -865,7 +873,7 @@ migrate_from_centos() {
865873
esac
866874
# replace OS packages with almalinux-release
867875
# and OS centos-specific packages
868-
remove_os_specific_packages_before_migration
876+
remove_os_specific_packages_before_migration "${os_version}"
869877
remove_not_needed_redhat_dirs
870878
install_almalinux_release_package "${release_path}"
871879
case "${os_version}" in
@@ -1009,8 +1017,8 @@ that won't boot in Secure Boot mode anymore:\n"
10091017
# shellcheck disable=SC2001,SC2086
10101018
echo "$output" | sed 's# #\n#'
10111019
echo ""
1012-
echo "If you don't need them, you can remove them by using the 'dnf remove" \
1013-
"${output}' command"
1020+
echo "If you don't need them, you can remove them by using the command:" \
1021+
"sudo dnf remove $(echo "${output}" | xargs) "
10141022
fi
10151023
report_step_done "Check custom kernel"
10161024
save_status_of_stage "check_custom_kernel"

0 commit comments

Comments
 (0)