Enable distro id based checks in rocm-core post/pre scripts

Change-Id: I1970dc3a36b8bd47d238b032afe5714c3e7f8e57
Этот коммит содержится в:
AravindanC
2024-12-04 21:52:39 -08:00
коммит произвёл Nirmal Unnikrishnan
родитель d11f5c20d5
Коммит 61ad6381aa
2 изменённых файлов: 6 добавлений и 6 удалений
+3 -3
Просмотреть файл
@@ -36,7 +36,7 @@ do_update_alternatives(){
# Update the /opt/rocm symlink
# For custom location installation of rpm package, /opt/rocm symlink is not required
# TBD: For custom location installation of deb package.
if [[ "$DISTRIB_ID" == "Ubuntu" ]] || [[ "$RPM_INSTALL_PREFIX0" == "/opt/rocm-"* ]] ; then
if [[ ${ID_LIKE:-$ID} == "debian" ]] || [[ "$RPM_INSTALL_PREFIX0" == "/opt/rocm-"* ]] ; then
update-alternatives --install "/opt/rocm" "rocm" "@CPACK_PACKAGING_INSTALL_PREFIX@" "$altscore"
fi
@@ -45,7 +45,7 @@ do_update_alternatives(){
if [ -d "$loc" ]
then
mkdir -p "$loc/rocm"
if [[ "$DISTRIB_ID" == "Ubuntu" ]] ; then
if [[ ${ID_LIKE:-$ID} == "debian" ]] ; then
update-alternatives --install "$loc/rocm/@ROCM_VERSION@" "rocmmod@ROCM_VERSION@" "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/rocmmod" "$altscore"
else
update-alternatives --install "$loc/rocm/@ROCM_VERSION@" "rocmmod@ROCM_VERSION@" "$RPM_INSTALL_PREFIX0/@CMAKE_INSTALL_LIBDIR@/rocmmod" "$altscore"
@@ -56,7 +56,7 @@ do_update_alternatives(){
true
}
if [ -e /etc/lsb-release ] && source /etc/lsb-release && [ "$DISTRIB_ID" = "Ubuntu" ]
if [ -e /etc/os-release ] && source /etc/os-release && [[ ${ID_LIKE:-$ID} == "debian" ]]
then
case "$1" in
(configure)
+3 -3
Просмотреть файл
@@ -4,18 +4,18 @@ do_update_alternatives(){
# skip update if program doesn't exist
command -v update-alternatives >/dev/null || return 0
# Update the /opt/rocm symlink
if [[ "$DISTRIB_ID" == "Ubuntu" ]] || [[ "$RPM_INSTALL_PREFIX0" == "/opt/rocm-"* ]] ; then
if [[ ${ID_LIKE:-$ID} == "debian" ]] || [[ "$RPM_INSTALL_PREFIX0" == "/opt/rocm-"* ]] ; then
update-alternatives --remove "rocm" "@CPACK_PACKAGING_INSTALL_PREFIX@"
fi
if [[ "$DISTRIB_ID" == "Ubuntu" ]] ; then
if [[ ${ID_LIKE:-$ID} == "debian" ]] ; then
update-alternatives --remove "rocmmod@ROCM_VERSION@" "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/rocmmod"|| true
else
update-alternatives --remove "rocmmod@ROCM_VERSION@" "$RPM_INSTALL_PREFIX0/@CMAKE_INSTALL_LIBDIR@/rocmmod"|| true
fi
}
if [ -e /etc/lsb-release ] && source /etc/lsb-release && [ "$DISTRIB_ID" = "Ubuntu" ]
if [ -e /etc/os-release ] && source /etc/os-release && [[ ${ID_LIKE:-$ID} == "debian" ]]
then
case "$1" in
(remove | upgrade)