SWDEV-340761 - Limit the removal of opencl conf file to package removal and provide unique name to icd file

While upgrading packaging in SLES/RHEL, the package to be upgraded is installed first, followed by cleanup of the older one
During upgrade 10-rocm-opencl.conf and icd file is getting removed as part of clean up, since the file name and path is same in different package versions.
Limit the removal of opencl conf file to  uninstall/removal of package and not during upgrade.
Used unique name for icd file

Change-Id: Ib34a78ce53e6b7d95adb70ccfd56474a297b64ca


[ROCm/clr commit: 3d350393d8]
Цей коміт міститься в:
Ranjith Ramakrishnan committed 2022-09-16 00:48:37 -07:00
1 джерело ae3d266843
коміт b2e30b6ffa
2 files changed
+18 -5

No files matched your search

+14 -1
Переглянути файл
@@ -60,7 +60,20 @@ endif()
#set a name for icd file
set(OPENCL_AMD_ICD_FILE "amdocl64.icd")
if (DEFINED ROCM_PATCH_VERSION)
set(OPENCL_AMD_ICD_FILE "amdocl64_${ROCM_PATCH_VERSION}.icd")
# set unique name for ICD file for each jenkins build
# Use ENV variable CPACK_RPM_PACKAGE_RELEASE, which is having build number
set(PACKAGE_RELEASE_VERSION "")
if(DEFINED ENV{CPACK_RPM_PACKAGE_RELEASE})
set(PACKAGE_RELEASE_VERSION $ENV{CPACK_RPM_PACKAGE_RELEASE})
endif()
if(PACKAGE_RELEASE_VERSION)
# Replace "." to "_" in package version string. So file name will have .icd as extension
string(REPLACE "." "_" PACKAGE_RELEASE_VERSION ${PACKAGE_RELEASE_VERSION})
else()
# set a default value
set(PACKAGE_RELEASE_VERSION "9999")
endif()
set(OPENCL_AMD_ICD_FILE "amdocl64_${ROCM_PATCH_VERSION}_${PACKAGE_RELEASE_VERSION}.icd")
endif()
if(BUILD_ICD)
+4 -4
Переглянути файл
@@ -1,8 +1,8 @@
if [ $1 -le 1 ]; then
# Below files will be removed during remove | upgrade operation
if [ $1 -eq 0 ]; then
# Remove rocm-opencl.conf during remove/uninstall operation
rm -f /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig
rm -f /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@
fi
# Remove icd file for uninstall and upgrade operation
rm -f /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@