From 7a7d90a057147a5eedf5eb63f5273d5d52d975fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Correa=20Rodr=C3=ADguez?= Date: Mon, 22 Jan 2024 17:28:44 +0100 Subject: [PATCH] Avoid removing systemd in WIA --- .../install_functions/installCommon.sh | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/unattended_installer/install_functions/installCommon.sh b/unattended_installer/install_functions/installCommon.sh index 7702b87844..62250751c2 100644 --- a/unattended_installer/install_functions/installCommon.sh +++ b/unattended_installer/install_functions/installCommon.sh @@ -812,14 +812,16 @@ function installCommon_yumRemoveWIADependencies(){ if [ "${#wia_dependencies_installed[@]}" -gt 0 ]; then common_logger "--- Dependencies ---" for dep in "${wia_dependencies_installed[@]}"; do - common_logger "Removing $dep." - yum_output=$(yum remove ${dep} -y 2>&1) - yum_code="${PIPESTATUS[0]}" - - eval "echo \${yum_output} ${debug}" - if [ "${yum_code}" != 0 ]; then - common_logger -e "Cannot remove dependency: ${dep}." - exit 1 + if [ "${dep}" != "systemd" ]; then + common_logger "Removing $dep." + yum_output=$(yum remove ${dep} -y 2>&1) + yum_code="${PIPESTATUS[0]}" + + eval "echo \${yum_output} ${debug}" + if [ "${yum_code}" != 0 ]; then + common_logger -e "Cannot remove dependency: ${dep}." + exit 1 + fi fi done fi @@ -831,14 +833,16 @@ function installCommon_aptRemoveWIADependencies(){ if [ "${#wia_dependencies_installed[@]}" -gt 0 ]; then common_logger "--- Dependencies ----" for dep in "${wia_dependencies_installed[@]}"; do - common_logger "Removing $dep." - apt_output=$(apt-get remove --purge ${dep} -y 2>&1) - apt_code="${PIPESTATUS[0]}" - - eval "echo \${apt_output} ${debug}" - if [ "${apt_code}" != 0 ]; then - common_logger -e "Cannot remove dependency: ${dep}." - exit 1 + if [ "${dep}" != "systemd" ]; then + common_logger "Removing $dep." + apt_output=$(apt-get remove --purge ${dep} -y 2>&1) + apt_code="${PIPESTATUS[0]}" + + eval "echo \${apt_output} ${debug}" + if [ "${apt_code}" != 0 ]; then + common_logger -e "Cannot remove dependency: ${dep}." + exit 1 + fi fi done fi