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
[ROCm/rocm-core commit: f2208f6452]
이 커밋은 다음에 포함됨:
커밋한 사람
Nirmal Unnikrishnan
부모
e94b0f6f8b
커밋
1e018ec3aa
@@ -34,13 +34,22 @@ do_update_alternatives(){
|
||||
altscore=$((altscore*1000000+(now-1600000000)/60))
|
||||
|
||||
# Update the /opt/rocm symlink
|
||||
update-alternatives --install "/opt/rocm" "rocm" "@CPACK_PACKAGING_INSTALL_PREFIX@" "$altscore"
|
||||
# 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
|
||||
update-alternatives --install "/opt/rocm" "rocm" "@CPACK_PACKAGING_INSTALL_PREFIX@" "$altscore"
|
||||
fi
|
||||
|
||||
for loc in "/usr/share/modules/modulefiles" "/usr/local/Modules/modulefiles" "/usr/share/Modules/modulefiles"
|
||||
do
|
||||
if [ -d "$loc" ]
|
||||
then
|
||||
mkdir -p "$loc/rocm"
|
||||
update-alternatives --install "$loc/rocm/@ROCM_VERSION@" "rocmmod@ROCM_VERSION@" "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/rocmmod" "$altscore"
|
||||
if [[ "$DISTRIB_ID" == "Ubuntu" ]] ; 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"
|
||||
fi
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -4,8 +4,15 @@ do_update_alternatives(){
|
||||
# skip update if program doesn't exist
|
||||
command -v update-alternatives >/dev/null || return 0
|
||||
# Update the /opt/rocm symlink
|
||||
update-alternatives --remove "rocm" "@CPACK_PACKAGING_INSTALL_PREFIX@"
|
||||
update-alternatives --remove "rocmmod@ROCM_VERSION@" "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/rocmmod"|| true
|
||||
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" ]
|
||||
|
||||
새 이슈에서 참조
사용자 차단