wspoon: Copy in the MAX31785 hwmon config file
The code will now copy the correct air or water cooled
config file to the correct name so phosphor-hwmon can find it.
It was just a link before, but that would cause problems with
code updates as this directory is preserved, so if older
code was put back on the link would point to nothing and
phosphor-hwmon would never start for the MAX31785.
Now with the copy the old code can still pick up this file.
The only hole this has is if someone goes from the new code
back to the old code, and then swaps air/water cooling, as the
old code will then pick up the config file generated by the
newer code, which now won't match the actual config. This
would be a very unlikely scenario.
Change-Id: I45db3c3ac8265caae30163a4e90035189e861e82
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon%/start_max31785_hwmon.sh b/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon%/start_max31785_hwmon.sh
index 1270427..6d4e6ba 100755
--- a/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon%/start_max31785_hwmon.sh
+++ b/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon%/start_max31785_hwmon.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-# Link in the correct MAX31785 phosphor-hwmon config file to use based on the
+# Copy in the correct MAX31785 phosphor-hwmon config file to use based on the
# WaterCooled property, and then start the hwmon service.
# $1: The OF_FULLNAME udev attribute for the MAX31785
@@ -20,7 +20,7 @@
source=$base'_air.conf'
fi
-ln -sf $source $target
+cp $source $target
instance=$(systemd-escape $1)
systemctl start xyz.openbmc_project.Hwmon@$instance.service