From 6b084d4af85df68fe4a724bb8de88a0634d03d02 Mon Sep 17 00:00:00 2001 From: Felix Radensky Date: Tue, 26 Nov 2024 16:44:53 +0200 Subject: [PATCH] hw-mgmt: scripts: Delete psuN_i2c_bus files when PSUs are plugged out These files are generated when PSUs are detected on I2C bus. However they are not removed when PSUs are plugged out. This makes it difficult to differentiate between real and dummy PSUs since dummy PSUs are not visible on I2C. Signed-off-by: Felix Radensky --- usr/usr/bin/hw-management-thermal-events.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr/usr/bin/hw-management-thermal-events.sh b/usr/usr/bin/hw-management-thermal-events.sh index 2c32c34e5..7b4322e38 100755 --- a/usr/usr/bin/hw-management-thermal-events.sh +++ b/usr/usr/bin/hw-management-thermal-events.sh @@ -1419,6 +1419,9 @@ else rm -f "$config_path"/"$psu_name"_power_slope rm -f "$config_path"/"$psu_name"_power_capacity fi + if [ -e "$config_path"/"$psu_name"_i2c_bus ]; then + rm -f "$config_path"/"$psu_name"_i2c_bus + fi fi if [ "$2" == "sxcore" ]; then /usr/bin/hw-management.sh chipdown 0 "$4/$5"