Files
rocm-systems/rocm-core.prerm
T
Ranjith Ramakrishnan f2208f6452 SWDEV-489527 - Create /opt/rocm softlink only for prefix paths that starts with /opt/rocm-
USE $RPM_INSTALL_PREFIX0 rather than hard coded paths in the post/pre install scripts for rpm use case

Change-Id: I56c66f0befd5502fd2a4218f0b661661259436ed
2024-10-23 16:21:23 -05:00

33 行
963 B
Bash
可執行檔

#!/bin/bash
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
update-alternatives --remove "rocm" "@CPACK_PACKAGING_INSTALL_PREFIX@"
fi
if [[ "$DISTRIB_ID" == "Ubuntu" ]] ; 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" ]
then
case "$1" in
(remove | upgrade)
do_update_alternatives
;;
(purge)
;;
(*)
exit 0
;;
esac
else
do_update_alternatives
fi