George Hung | b67a01a | 2020-06-30 10:47:30 +0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
George Hung | fb67234 | 2021-01-20 21:40:31 +0800 | [diff] [blame^] | 3 | FAN_TABLE_SKU_FILE="/usr/share/swampd/config-sku.json" |
| 4 | FAN_TABLE_FILE="/usr/share/swampd/config.json" |
| 5 | |
| 6 | # determine sku |
| 7 | cp $FAN_TABLE_SKU_FILE $FAN_TABLE_FILE |
| 8 | |
George Hung | b67a01a | 2020-06-30 10:47:30 +0800 | [diff] [blame] | 9 | # wait for fan dbus |
| 10 | mapper wait /xyz/openbmc_project/sensors/fan_tach/fan0 |
| 11 | mapper wait /xyz/openbmc_project/sensors/fan_tach/fan1 |
George Hung | 43bbb29 | 2020-07-16 13:47:14 +0800 | [diff] [blame] | 12 | mapper wait /xyz/openbmc_project/sensors/fan_tach/fb_fan0 |
| 13 | mapper wait /xyz/openbmc_project/sensors/fan_tach/fb_fan1 |
| 14 | mapper wait /xyz/openbmc_project/sensors/fan_tach/fb_fan2 |
George Hung | b67a01a | 2020-06-30 10:47:30 +0800 | [diff] [blame] | 15 | |
| 16 | /usr/bin/fan-default-speed.sh |
| 17 | |
| 18 | # generate fan table writePath |
| 19 | Fan_0_To_4_Hwmon="$(ls -la /sys/class/hwmon |grep pwm | head -n 1| tail -n +1|cut -d '/' -f 9)" |
| 20 | |
George Hung | fb67234 | 2021-01-20 21:40:31 +0800 | [diff] [blame^] | 21 | if [[ "$Fan_0_To_4_Hwmon" != "" ]]; then |
| 22 | sed -i "s/Fan_0_To_4_Hwmon/$Fan_0_To_4_Hwmon/g" $FAN_TABLE_FILE |
George Hung | b67a01a | 2020-06-30 10:47:30 +0800 | [diff] [blame] | 23 | fi |
| 24 | |
| 25 | # start read margin temp wait |
| 26 | /usr/bin/read-margin-temp-wait.sh & |
| 27 | |
| 28 | exit 0 |