db3e119f7d
Change-Id: I39d9aa96eb8ed2dd6a4a222c3c4da9ff2b2de007 Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
36 sor
1.1 KiB
Bash
Executable File
36 sor
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
rm_pyc() {
|
|
# remove pyc files generated by python
|
|
rm -rf @CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/amdsmi_cli/__pycache__
|
|
rm -rf @CPACK_PACKAGING_INSTALL_PREFIX@/@SHARE_INSTALL_PREFIX@/amdsmi/__pycache__
|
|
}
|
|
|
|
rm_logFolder() {
|
|
rm -rf /var/log/amd_smi_lib
|
|
}
|
|
|
|
return_logrotateToOrigConfig() {
|
|
local logrotateConfFile=/etc/logrotate.d/amd_smi.conf
|
|
if [ -f $logrotateConfFile ]; then
|
|
rm -rf "$logrotateConfFile"
|
|
fi
|
|
if [ -f /etc/cron.hourly/logrotate ]; then
|
|
mv /etc/cron.hourly/logrotate /etc/cron.daily/logrotate
|
|
fi
|
|
if [ -f /lib/systemd/system/logrotate.timer.backup ]; then
|
|
cp /lib/systemd/system/logrotate.timer.backup /lib/systemd/system/logrotate.timer
|
|
rm -rf /lib/systemd/system/logrotate.timer.backup
|
|
systemctl reenable --now logrotate.timer
|
|
fi
|
|
}
|
|
|
|
if [ "$1" -le 1 ]; then
|
|
# perform the below actions for rpm remove($1=0) or upgrade($1=1) operations
|
|
# remove old gpuv-smi symlink
|
|
rm -f @CPACK_PACKAGING_INSTALL_PREFIX@/bin/gpuv-smi &> /dev/null
|
|
rm_pyc
|
|
rm_logFolder
|
|
return_logrotateToOrigConfig
|
|
fi
|