My Cloud PR4100 / PR2100 Firmware Analysis


#67

While examining the kernel/boot logs to learn how the hardware fan control works, I stumbled across several entries which show some clues to the purpose of the hidden NAND flash partitions.

[   20.227565] EXT4-fs (mmcblk0p7): mounted filesystem with ordered data mode. Opts: (null)
cp: can't stat '/mnt/wdnas_reserve1/flash_update_firmware': No such file or directory
[   22.983105] EXT4-fs (mmcblk0p8): mounted filesystem with ordered data mode. Opts: (null)
cp: can't stat '/mnt/wdnas_reserve2/mac_addr': No such file or directory
cp: can't stat '/mnt/wdnas_reserve2/wd_serial.txt': No such file or directory
cp: can't stat '/mnt/wdnas_reserve2/model_id': No such file or directory

mmcblk0p7 appears to only be used during the firmware update process.
mmcblk0p8 appears to store specific and unique NAS identification information, etc…


#68

@dswv42

I’ve attached the dmesg output from the EX4100 as well if you want to take a look. It looks like the 7 and 8 partitions on this unit are UBIFS, so could try and mount these and see what it in them. I also saw there are some bad block messages for the flash which is a bit concerning :frowning:

EX4100 dmesg.txt (32.4 KB)

Cheers,

JediNite


#69

@dswv42

Tried this on my unit :slight_smile:

root@WDMyCloudEX4100 /tmp # mount -t ubifs ubi1_0 /tmp/ubi1
root@WDMyCloudEX4100 /tmp # mount -t ubifs ubi2_0 /tmp/ubi2
root@WDMyCloudEX4100 /tmp # cd ubi1/
root@WDMyCloudEX4100 ubi1 # ls -al
drwxr-xr-x    2 root     root           240 Jan  1  1970 .
drwxrwxrwt   14 root     root          1360 Nov  4 20:57 ..
-rw-r--r--    1 root     root             1 Jan  1  1970 flash_update_firmware
root@WDMyCloudEX4100 ubi1 # cd ..
root@WDMyCloudEX4100 /tmp # cd ubi2
root@WDMyCloudEX4100 ubi2 # ls -al
drwxr-xr-x    2 root     root           456 Mar  5  2015 .
drwxrwxrwt   14 root     root          1360 Nov  4 20:57 ..
-rw-r--r--    1 root     root             2 Jan  1  1970 hidden_eccryption
-rw-r--r--    1 root     root            36 Feb  7  2015 mac_addr
-rw-r--r--    1 root     root             2 Jan  1  1970 model_id
-rw-r--r--    1 root     root            12 Mar  5  2015 wd_serial.txt

root@WDMyCloudEX4100 /tmp # cd ubi1
root@WDMyCloudEX4100 ubi1 # more flash_update_firmware
0root@WDMyCloudEX4100 ubi1 # cd ..
root@WDMyCloudEX4100 /tmp # cd ubi2
root@WDMyCloudEX4100 ubi2 # ls -al
drwxr-xr-x    2 root     root           456 Mar  5  2015 .
drwxrwxrwt   14 root     root          1360 Nov  4 20:57 ..
-rw-r--r--    1 root     root             2 Jan  1  1970 hidden_eccryption
-rw-r--r--    1 root     root            36 Feb  7  2015 mac_addr
-rw-r--r--    1 root     root             2 Jan  1  1970 model_id
-rw-r--r--    1 root     root            12 Mar  5  2015 wd_serial.txt
root@WDMyCloudEX4100 ubi2 # more *
0
00:90:A9:E1:53:4A
00:90:A9:E1:53:4B
0
WNAG25360101root@WDMyCloudEX4100 ubi2 #

So nothing exciting in these files by the looks.

Cheers,

JediNite


#70

The PR4100 and EX4100 do use different filesystems for the NAND flash partitions, but it doesn’t pose any problems. I was mainly interested in them for 2 reasons.

  1. So backup copies can be saved for analysis and recovery… if needed.

  2. Unused partitions could be used to store persistent information that would remain available after reimaging the OS partition. Space is limited and write operations have to be kept to a minimum, but it would be an ideal place for config settings, scripts, etc.

Currently, my biggest concern is hardware control. Now that installing Debian has become a reality, having control of the fan, led display messages, display backlight, power button led, HDD led’s, reset button, etc… is highly desirable. At the very least, having fan control would keep noise to a minimum, while keeping everything at an ideal operating temperature.


#71

@dswv42,

Have you seen this thread on doozan.com ?

https://forum.doozan.com/read.php?2,34103

It looks like they have made some significant progress on the EX4100 and EX2100 series of NAS to get Debian working. They do have the same issues though that you mentioned around LED and Fan control.

Cheers,

JediNite


#72

I hadn’t seen that thread, but it’s been an interesting and informative read. They certainly went to a lot of trouble to recompile Debian and get it working on the EX4100, which was unavoidable due to the asinine decision of WD to use 64k pages. Fortunately, the PR4100 uses standard 4k pages. However, I’m not certain why they found it necessary to mess with uBoot… writing to NAND is risky business.

Building new firmware with an updated kernel, etc was my original approach as well, or at least it was until I realized that there was an easier way. Being one who trys to follow the principal of Occam’s razor, I usually try and look for the simplest solution. In this case, learning how to build new firmware was bad, but teaching others how to do it would be a nightmare. Hence, my decision to delay posting build instructions.

With regard to hardware control, it seems that they are on the same path as me. Starting with the system_init script, where the fan_control binary file is loaded. It seems that they think trying to run it will work, but I have my doubts because it has many dependencies, plus old binary files tend to crash when paired with newer kernels.

if [ -e /usr/sbin/fan_control ]; then
#======================
#	Fan Control
#======================
  fan_control b c
  if [ -e /tmp/hw_mode ]; then
    hw_mode_test_temper=`cat /tmp/hw_mode | grep temperature`
    if [ -n "$hw_mode_test_temper" ]; then
      fan_control -w c&
    else
      fan_control 0 c&
    fi
  else
    fan_control 0 c&
  fi
fi

My investigation is ongoing, but I have managed to track down most of the library files required for hardware control. Unfortunately, much like the fan_control binary file, which is probably little more than a simple compiled script, everything is closed-source. Here’s what I’ve found to date…

libredhawk_query_power_supply_state.so.1
libredhawk_lcd_control.so.1
libredhawk_hwlib_temperature_source.so.1
libsprite_alert_interface.so.1
libsprite_hwlib_fan_controller.so.1
libsprite_button_monitor.so.1
libsprite_command_alert_interface.so.1
libsprite_drive_temperature_source.so.1
libsprite_lcd_control.so.1
libsprite_syslog_alert_interface.so.1
libstargate_query_power_supply_state.so.1
libthermal_management.so.1
libthermal_service.so.1
libwdhw.so.1
libtemperature.so
liblcd_management.so

Hackers have discovered that writing to the LCD display is possible, but it’s a hack that probably won’t run on Debian with an updated kernel because the library files were compiled for a much older kernel. More investigation is required, and I remain hopeful that WD will release the portions of the source code pertaining to hardware control, which will enable required scripts and libraries to be modified and/or compiled to run on newer kernels. Only time will tell…


#73

I discovered how to control the front panel leds, but it requires using a pre-compiled binary file that comes with the factory firmware. Unfortunately, it probably won’t work with Debian, but someone may find it useful for alerts or notification purposes.

LED Command Help:

# led
led v1.01.03162012
power led description : --> led power blue/red/green on/off/blinking
hd led description : --> led hd0/hd1/hd2/hd3 red on/off/blinking
hd led description : --> led hd0/hd1/hd2/hd3 blue on/off(controlled by hw)
usb led descritpion : --> led usb blue on/off/blinking
usb led descritpion : --> led usb red on/off/blinking

Power LED Examples:

# led power red on
# led power red blinking
# led power green on
# led power blue on

USB LED Examples:

# led usb red on
# led usb red blinking
# led usb red off

Everything Red:

# led power red on; led usb red on; led hd0 red on; led hd1 red on; led hd2 red on; led hd3 red on
# led power red blinking; led usb red blinking; led hd0 red blinking; led hd1 red blinking; led hd2 red blinking; led hd3 red blinking
# led power red off; led usb red off; led hd0 red off; led hd1 red off; led hd2 red off; led hd3 red off

The blue hard drive leds are controlled by the hardware, which means commands won’t work on them. If a hard drive is installed, the led is blue. If a hard drive is being accessed, the led blinks. If a hard drive is not installed, the led is off. However, the red hard drive leds can be controlled.


#74

I found a file named BNFA-thermal.xml which has some useful hardware information. BNFA is the WD code for the PR4100, also called Black Canyon.

<?xml version="1.0" encoding="utf-8" ?>
<product_model>BlackCanyon</product_model>
<thermal_config>
    <options>
        <scriptInterval value="1" />
	<scriptIntervalCycle value="600" />
    </options>

    <init_script_variables>
        <step name="init_cpu_state" action="set_int_value" var="cpu_state" value="1" />
	<step name="init_mem_state" action="set_int_value" var="mem_state" value="1" />
	<step name="init_pmc_state" action="set_int_value" var="pmc_state" value="1" />
	<step name="init_drv_state" action="set_int_value" var="drv_state" value="1" />
	<step name="init_global_state"    action="set_int_value" var="global_state"    value="1" />
	<step name="init_ex_global_state" action="set_int_value" var="ex_global_state" value="1" />
	<step name="init_pending_shutdown" action="set_int_value" var="pending_shutdown" value="0" />
    </init_script_variables>

    <libraries>
        <library name="/opt/wd/lib/libredhawk_hwlib_temperature_source.so" source_name="system" type="1" log_variance="5.0"  read_interval="1" />
        <library name="/opt/wd/lib/libredhawk_hwlib_temperature_source.so" source_name="memory" type="3" log_variance="5.0"  count="1" optional="2" read_interval="1" />
        <library name="/opt/wd/lib/libredhawk_hwlib_temperature_source.so" source_name="dts"    type="5" log_variance="5.0"  read_interval="1" />
        <library name="/opt/wd/lib/libredhawk_hwlib_temperature_source.so" source_name="cpu"    type="6" log_variance="5.0"  read_interval="1" />
        <library name="/opt/wd/lib/libsprite_hwlib_fan_controller.so"     source_name="system_fan" type="1" scale_factor="1" initial_value="30" />

        <library name="/opt/wd/lib/libsprite_drive_temperature_source.so" drives="4" optional="2" read_interval="60" standby_mask_path="/tmp/hd_sleep" log_variance="5.0" >
            <drive_info index="0" device_path="/sys/devices/pci0000:00/0000:00:13.0/ata1/host0/target0:0:0/0:0:0:0/block"/>
            <drive_info index="1" device_path="/sys/devices/pci0000:00/0000:00:13.0/ata2/host1/target1:0:0/1:0:0:0/block"/>
            <drive_info index="2" device_path="/sys/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/ata3/host2/target2:0:0/2:0:0:0/block"/>
            <drive_info index="3" device_path="/sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/ata5/host4/target4:0:0/4:0:0:0/block"/>
        </library>
        <library name="/opt/wd/lib/libsprite_alert_interface.so" />
	<library name="/opt/wd/lib/libsprite_syslog_alert_interface.so" />
	<library name="/opt/wd/lib/libsprite_command_alert_interface.so" >
	  <command name="fan_not_working"            raise="echo '' > /dev/null" clear="up_send_ctl ErrStatus 0029 0; alert_led.sh 29 0" />
	  <command name="system_over_temperature"    raise="echo '' > /dev/null" clear="up_send_ctl ErrStatus 0001 0" />
	  <command name="system_under_temperature"   raise="echo '' > /dev/null" clear="up_send_ctl ErrStatus 0002 0" />
	  <command name="system_pending_shutdown"    raise="echo '' > /dev/null" clear="up_send_ctl ErrStatus 0005 0" />
	  <command name="thermal_shutdown_immediate" raise="echo '' > /dev/null" clear="up_send_ctl ErrStatus 0006 0" />
	  <command name="system_safe_mode"    raise="safe_mode.sh 1" clear="safe_mode.sh 0" />
	</library>
    </libraries>

    <thermal>
	<!-- set component temperature state and continue -->
	<step name="start"             action="compare_temperature"    source="dts" index="*" comparison="less_than"    value="1.0"  interval="10" goto="set_cpu_extreme" next="check_cpu_danger" />
	<step name="check_cpu_danger"  action="compare_temperature"    source="dts" index="*" comparison="less_than"    value="3.0" interval="10" goto="set_cpu_danger"  next="check_cpu_warm" />
	<step name="check_cpu_warm"    action="compare_temperature"    source="dts" index="*" comparison="less_than"    value="10.0" interval="10" goto="set_cpu_warm"    next="check_cpu_content" />
	<step name="check_cpu_content" action="compare_temperature"    source="dts" index="*" comparison="less_than"    value="17.0" interval="10" goto="set_cpu_content" next="check_cpu_under" />
	<step name="check_cpu_under"   action="compare_temperature"    source="dts" index="*" comparison="greater_than" value="89.0" interval="10" goto="set_cpu_under"   next="check_cpu_cool" />
	<step name="check_cpu_cool"    action="compare_temperature"    source="dts" index="*" comparison="greater_than" value="16.0" interval="10" goto="set_cpu_cool"    next="check_mem_extreme" />

	<step name="check_mem_extreme" action="compare_temperature"    source="memory" index="*" comparison="greater_than" value="94.0" interval="30" goto="set_mem_extreme" next="check_mem_danger" />
	<step name="check_mem_danger"  action="compare_temperature"    source="memory" index="*" comparison="greater_than" value="89.0" interval="30" goto="set_mem_danger"  next="check_mem_hot" />
	<step name="check_mem_hot"     action="compare_temperature"    source="memory" index="*" comparison="greater_than" value="84.0" interval="30" goto="set_mem_hot"     next="check_mem_warm" />
	<step name="check_mem_warm"    action="compare_temperature"    source="memory" index="*" comparison="greater_than" value="69.0" interval="30" goto="set_mem_warm"    next="check_mem_content" />
	<step name="check_mem_content" action="compare_temperature"    source="memory" index="*" comparison="greater_than" value="60.0" interval="30" goto="set_mem_content" next="check_mem_under" />
	<step name="check_mem_under"   action="compare_temperature"    source="memory" index="*" comparison="less_than"    value="1.0"  interval="30" goto="set_mem_under"   next="check_mem_cool" />
	<step name="check_mem_cool"    action="compare_temperature"    source="memory" index="*" comparison="less_than"    value="61.0" interval="30" goto="set_mem_cool"    next="check_pmc_extreme" />

	<step name="check_pmc_extreme" action="compare_temperature"    source="system" index="*" comparison="greater_than" value="104.0" interval="30" goto="set_pmc_extreme" next="check_pmc_danger" />
	<step name="check_pmc_danger"  action="compare_temperature"    source="system" index="*" comparison="greater_than" value="94.0"  interval="30" goto="set_pmc_danger"  next="check_pmc_hot" />
	<step name="check_pmc_hot"     action="compare_temperature"    source="system" index="*" comparison="greater_than" value="89.0"  interval="30" goto="set_pmc_hot"     next="check_pmc_warm" />
	<step name="check_pmc_warm"    action="compare_temperature"    source="system" index="*" comparison="greater_than" value="84.0"  interval="30" goto="set_pmc_warm"    next="check_pmc_content" />
	<step name="check_pmc_content" action="compare_temperature"    source="system" index="*" comparison="greater_than" value="74.0"  interval="30" goto="set_pmc_content" next="check_pmc_under" />
	<step name="check_pmc_under"   action="compare_temperature"    source="system" index="*" comparison="less_than"    value="1.0"   interval="30" goto="set_pmc_under"   next="check_pmc_cool" />
	<step name="check_pmc_cool"    action="compare_temperature"    source="system" index="*" comparison="less_than"    value="75.0"  interval="30" goto="set_pmc_cool"    next="init_drv_cool" />

	<step name="init_drv_cool"     action="set_int_value" var="drv_state" value="1" interval="600" next="check_drv_extreme" />
	<step name="check_drv_extreme" action="compare_temperature"    source="drive" index="*" comparison="greater_than" value="74.0" interval="600" goto="set_drv_extreme" next="check_drv_pending" />
	<step name="check_drv_pending" action="compare_temperature"    source="drive" index="*" comparison="greater_than" value="71.0" interval="600" goto="set_drv_pending" next="check_drv_danger" />
	<step name="check_drv_danger"  action="compare_temperature"    source="drive" index="*" comparison="greater_than" value="67.0" interval="600" goto="set_drv_danger"  next="check_drv_hot" />
	<step name="check_drv_hot"     action="compare_temperature"    source="drive" index="*" comparison="greater_than" value="64.0" interval="600" goto="set_drv_hot"     next="check_drv_warm" />
	<step name="check_drv_warm"    action="compare_temperature"    source="drive" index="*" comparison="greater_than" value="57.0" interval="600" goto="set_drv_warm"    next="check_drv_content" />
	<step name="check_drv_content" action="compare_temperature"    source="drive" index="*" comparison="greater_than" value="50.0" interval="600" goto="set_drv_content" next="check_drv_under" />
	<step name="check_drv_under"   action="compare_temperature"    source="drive" index="*" comparison="less_than"    value="1.0"  interval="600" goto="set_drv_under"   next="check_drv_cool" />
	<step name="check_drv_cool"    action="compare_temperature"    source="drive" index="*" comparison="less_than"    value="51.0" interval="600" goto="set_drv_cool"    next="check_cpu_shutdown" />

	<step name="set_cpu_under"   action="set_int_value" var="cpu_state" value="0" next="check_mem_extreme" />
	<step name="set_cpu_cool"    action="set_int_value" var="cpu_state" value="1" next="check_mem_extreme" />
	<step name="set_cpu_content" action="set_int_value" var="cpu_state" value="2" next="check_mem_extreme" />
	<step name="set_cpu_warm"    action="set_int_value" var="cpu_state" value="3" next="check_mem_extreme" />
	<step name="set_cpu_hot"     action="set_int_value" var="cpu_state" value="4" next="check_mem_extreme" />
	<step name="set_cpu_danger"  action="set_int_value" var="cpu_state" value="5" next="check_mem_extreme" />
	<step name="set_cpu_extreme" action="set_int_value" var="cpu_state" value="7" next="check_mem_extreme" />

	<step name="set_mem_under"   action="set_int_value" var="mem_state" value="0" next="check_pmc_extreme" />
	<step name="set_mem_cool"    action="set_int_value" var="mem_state" value="1" next="check_pmc_extreme" />
	<step name="set_mem_content" action="set_int_value" var="mem_state" value="2" next="check_pmc_extreme" />
	<step name="set_mem_warm"    action="set_int_value" var="mem_state" value="3" next="check_pmc_extreme" />
	<step name="set_mem_hot"     action="set_int_value" var="mem_state" value="4" next="check_pmc_extreme" />
	<step name="set_mem_danger"  action="set_int_value" var="mem_state" value="5" next="check_pmc_extreme" />
	<step name="set_mem_extreme" action="set_int_value" var="mem_state" value="7" next="check_pmc_extreme" />

	<step name="set_pmc_under"   action="set_int_value" var="pmc_state" value="0" next="init_drv_cool" />	
	<step name="set_pmc_cool"    action="set_int_value" var="pmc_state" value="1" next="init_drv_cool" />
	<step name="set_pmc_content" action="set_int_value" var="pmc_state" value="2" next="init_drv_cool" />
	<step name="set_pmc_warm"    action="set_int_value" var="pmc_state" value="3" next="init_drv_cool" />
	<step name="set_pmc_hot"     action="set_int_value" var="pmc_state" value="4" next="init_drv_cool" />
	<step name="set_pmc_danger"  action="set_int_value" var="pmc_state" value="5" next="init_drv_cool" />
	<step name="set_pmc_extreme" action="set_int_value" var="pmc_state" value="7" next="init_drv_cool" />

	<step name="set_drv_under"   action="set_int_value" var="drv_state" value="0" next="check_cpu_shutdown" />
	<step name="set_drv_cool"    action="set_int_value" var="drv_state" value="1" next="check_cpu_shutdown" />
	<step name="set_drv_content" action="set_int_value" var="drv_state" value="2" next="check_cpu_shutdown" />
	<step name="set_drv_warm"    action="set_int_value" var="drv_state" value="3" next="check_cpu_shutdown" />
	<step name="set_drv_hot"     action="set_int_value" var="drv_state" value="4" next="check_cpu_shutdown" />
	<step name="set_drv_danger"  action="set_int_value" var="drv_state" value="5" next="check_cpu_shutdown" />
	<step name="set_drv_pending" action="set_int_value" var="drv_state" value="6" next="check_cpu_shutdown" />
	<step name="set_drv_extreme" action="set_int_value" var="drv_state" value="7" next="check_cpu_shutdown" />

	<!-- do shutdown if necessary and continue -->
	<step name="check_cpu_shutdown" action="compare_int_value" var="cpu_state" comparison="greater_than" value="6" goto="send_critical_hot_shutdown" next="check_mem_shutdown" />
	<step name="check_mem_shutdown" action="compare_int_value" var="mem_state" comparison="greater_than" value="6" goto="send_critical_hot_shutdown" next="check_pmc_shutdown" />
	<step name="check_pmc_shutdown" action="compare_int_value" var="pmc_state" comparison="greater_than" value="6" goto="send_critical_hot_shutdown" next="check_drv_shutdown" />
	<step name="check_drv_shutdown" action="compare_int_value" var="drv_state" comparison="greater_than" value="6" goto="send_critical_hot_shutdown" next="check_sys_fan_fail" />

	<step name="send_critical_hot_shutdown"   action="set_int_value"   var="global_state"  value="7" next="set_sys_fan_max" />

	<!-- raise/clear fan alert and continue -->
	<step name="check_sys_fan_fail"  action="compare_int_value"      var="global_state"    comparison="less_than"   value="100" interval="600"  goto="check_sys_fan_fail2"  next="check_drv_state_pending" />
	<step name="check_sys_fan_fail2" action="compare_fan_functional" source="system_fan"    index="0"       comparison="equal"   value="no"   goto="send_sys_fan_fail"   next="clear_sys_fan_fail" />
	<step name="send_sys_fan_fail"   action="set_alert"              source="alert"         type="29,0"              next="send_sys_fan_fail2" />
	<step name="send_sys_fan_fail2"  action="set_alert"              source="command_alert" type="fan_not_working"   next="check_drv_state_pending" />
	<step name="clear_sys_fan_fail"  action="clear_alert"            source="alert"         type="29,0"              next="clear_sys_fan_fail2" />
	<step name="clear_sys_fan_fail2" action="clear_alert"            source="command_alert" type="fan_not_working"   next="check_drv_state_pending" />

	<!-- check for pending shutdown / t2 state -->
	<step name="check_drv_state_pending"      action="compare_int_value"   var="drv_state"         comparison="greater_than"  value="5" goto="send_drv_pending" next="check_cpu_overtemp" />
	<step name="send_drv_pending"       action="set_int_value"       var="global_state"       value="6" next="set_sys_fan_max" />

	<!-- raise overtemp alert if necessary and continue -->
	<step name="check_cpu_overtemp" action="compare_int_value" var="cpu_state" comparison="greater_than" value="4" goto="send_overtemp_alert" next="check_mem_overtemp" />
	<step name="check_mem_overtemp" action="compare_int_value" var="mem_state" comparison="greater_than" value="4" goto="send_overtemp_alert" next="check_pmc_overtemp" />
	<step name="check_pmc_overtemp" action="compare_int_value" var="pmc_state" comparison="greater_than" value="4" goto="send_overtemp_alert" next="check_drv_overtemp" />
	<step name="check_drv_overtemp" action="compare_int_value" var="drv_state" comparison="greater_than" value="4" goto="send_overtemp_alert" next="check_cpu_sys_fan_max" />

	<step name="send_overtemp_alert"   action="set_int_value"    var="global_state"            value="5"                       next="set_sys_fan_max" />

	<!-- set sys fan max if needed, if so set and start over -->
	<step name="check_cpu_sys_fan_max" action="compare_int_value" var="cpu_state" comparison="greater_than" value="3" goto="set_global_danger" next="check_mem_sys_fan_max" />
	<step name="check_mem_sys_fan_max" action="compare_int_value" var="mem_state" comparison="greater_than" value="3" goto="set_global_danger" next="check_pmc_sys_fan_max" />
	<step name="check_pmc_sys_fan_max" action="compare_int_value" var="pmc_state" comparison="greater_than" value="3" goto="set_global_danger" next="check_drv_sys_fan_max" />
	<step name="check_drv_sys_fan_max" action="compare_int_value" var="drv_state" comparison="greater_than" value="3" goto="set_global_danger" next="check_cpu_sys_fan_inc" />

	<step name="set_global_danger"  action="set_int_value" var="global_state" value="4" next="set_sys_fan_max" />
	<step name="set_sys_fan_max"  action="compare_int_value"      var="global_state"    comparison="less_than"   value="100" interval="10"  goto="set_sys_fan_max2"  next="send_temp_alert" />
	<step name="set_sys_fan_max2" action="set_fan"       source="system_fan"   index="0" value="100" next="send_temp_alert" />

	<!-- inc sys fan if needed, if so, start over. if not continue -->
	<step name="check_cpu_sys_fan_inc" action="compare_int_value" var="cpu_state" comparison="greater_than" value="2" interval="10"  goto="inc_sys_fan" next="check_mem_sys_fan_inc" />
	<step name="check_mem_sys_fan_inc" action="compare_int_value" var="mem_state" comparison="greater_than" value="2" interval="30"  goto="inc_sys_fan" next="check_pmc_sys_fan_inc" />
	<step name="check_pmc_sys_fan_inc" action="compare_int_value" var="pmc_state" comparison="greater_than" value="2" interval="30"  goto="inc_sys_fan" next="check_drv_sys_fan_inc" />
	<step name="check_drv_sys_fan_inc" action="compare_int_value" var="drv_state" comparison="greater_than" value="2" interval="600" goto="inc_sys_fan" next="check_cpu_sys_fan_dec" />

	<step name="inc_sys_fan"   action="set_int_value" var="global_state" value="3" next="inc_sys_fan2" />
	<step name="inc_sys_fan2"  action="increment_fan" source="system_fan" index="0" delta="10" limit="100" next="send_temp_alert" />

	<!-- dec sys fan if needed -->
	<step name="check_cpu_sys_fan_dec" action="compare_int_value" var="cpu_state" comparison="less_than" value="2" goto="check_mem_sys_fan_dec" next="nochange_sys_fan" />
	<step name="check_mem_sys_fan_dec" action="compare_int_value" var="mem_state" comparison="less_than" value="2" goto="check_pmc_sys_fan_dec" next="nochange_sys_fan" />
	<step name="check_pmc_sys_fan_dec" action="compare_int_value" var="pmc_state" comparison="less_than" value="2" goto="check_drv_sys_fan_dec" next="nochange_sys_fan" />
	<step name="check_drv_sys_fan_dec" action="compare_int_value" var="drv_state" comparison="less_than" value="2" goto="check_cool_or_under"   next="nochange_sys_fan" />

	<step name="check_cool_or_under"   action="compare_int_value" var="cpu_state" comparison="less_than" value="1" goto="set_global_under" next="check_cool_or_under2" />
	<step name="check_cool_or_under2"  action="compare_int_value" var="mem_state" comparison="less_than" value="1" goto="set_global_under" next="check_cool_or_under3" />
	<step name="check_cool_or_under3"  action="compare_int_value" var="pmc_state" comparison="less_than" value="1" goto="set_global_under" next="check_cool_or_under4" />
	<step name="check_cool_or_under4"  action="compare_int_value" var="drv_state" comparison="less_than" value="1" goto="set_global_under" next="set_global_cool" />

	<step name="set_global_under"  action="set_int_value" var="global_state" value="0" next="dec_sys_fan" />
	<step name="set_global_cool"  action="set_int_value" var="global_state" value="1" next="dec_sys_fan" />

	<step name="dec_sys_fan"        action="compare_int_value" var="global_state" comparison="less_than" value="2" interval="600" goto="dec_sys_fan2" next="nochange_sys_fan2" />
	<step name="dec_sys_fan2"       action="decrement_fan" source="system_fan" index="0" delta="10" limit="20" next="send_temp_alert" />

	<step name="nochange_sys_fan"        action="set_int_value" var="global_state" value="2" next="nochange_sys_fan2" />
	<step name="nochange_sys_fan2"  action="compare_int_value"      var="global_state"    comparison="less_than"   value="100" interval="10"  goto="nochange_sys_fan3"  next="send_temp_alert" />
	<step name="nochange_sys_fan3"   action="increment_fan" source="system_fan" index="0" delta="0" limit="100" next="send_temp_alert" />

	<!-- handle alert and system conditions -->
	<step name="send_temp_alert"    action="compare_int_value"      var="ex_global_state"    comparison="greater_than"  value="0"  goto="check_normal_temp_alert"       next="handle_ex_under_temp" />
	<step name="check_normal_temp_alert"    action="compare_int_value"      var="ex_global_state"    comparison="greater_than"  value="4"  goto="check_over_temp_alert" next="handle_ex_normal_temp" />
	<step name="check_over_temp_alert"    action="compare_int_value"      var="ex_global_state"    comparison="greater_than"  value="5"  goto="check_pending_temp_alert" next="handle_ex_over_temp" />
	<step name="check_pending_temp_alert"    action="compare_int_value"      var="ex_global_state"    comparison="greater_than"  value="6"  goto="handle_pending_to_extreme_temp" next="handle_ex_pending_temp" />

	<step name="handle_ex_under_temp" action="compare_int_value" var="global_state" comparison="greater_than" value="0" goto="handle_under_to_normal_temp" next="set_ex_under" />
	<step name="handle_under_to_normal_temp" action="clear_alert" source="alert" type="2,0" next="handle_under_to_normal_temp2" />
	<step name="handle_under_to_normal_temp2" action="clear_alert" source="command_alert" type="system_under_temperature" next="handle_under_to_normal_temp3" />
	<step name="handle_under_to_normal_temp3" action="set_alert"   source="alert" type="2003,0"  next="set_ex_normal" />

	<step name="handle_ex_normal_temp" action="compare_int_value" var="global_state" comparison="less_than" value="1" goto="handle_normal_to_under_temp" next="handle_ex_normal_temp2" />
	<step name="handle_normal_to_under_temp"  action="clear_alert" source="alert" type="2003,0" next="handle_normal_to_under_temp2" />
	<step name="handle_normal_to_under_temp2" action="set_alert"   source="alert" type="2,0"  next="handle_normal_to_under_temp3" />
	<step name="handle_normal_to_under_temp3" action="set_alert" source="command_alert" type="system_under_temperature" next="set_ex_under" />

	<step name="handle_ex_normal_temp2" action="compare_int_value" var="global_state" comparison="greater_than" value="4" goto="handle_normal_to_over_temp" next="set_ex_normal"/>
	<step name="handle_normal_to_over_temp"  action="clear_alert" source="alert" type="2003,0" next="handle_normal_to_over_temp2" />
	<step name="handle_normal_to_over_temp2" action="set_alert"   source="alert" type="1,0"  next="handle_normal_to_over_temp3"/>
	<step name="handle_normal_to_over_temp3" action="set_alert" source="command_alert" type="system_over_temperature" next="set_ex_over" />

	<step name="handle_ex_over_temp" action="compare_int_value" var="global_state" comparison="less_than" value="5" goto="handle_over_to_normal_temp" next="handle_ex_over_temp2" />
	<step name="handle_over_to_normal_temp" action="clear_alert" source="alert" type="1,0" next="handle_over_to_normal_temp2" />
	<step name="handle_over_to_normal_temp2" action="clear_alert" source="command_alert" type="system_over_temperature" next="handle_over_to_normal_temp3" />
	<step name="handle_over_to_normal_temp3" action="set_alert"   source="alert" type="2003,0"  next="set_ex_normal" />

	<step name="handle_ex_over_temp2" action="compare_int_value" var="global_state" comparison="greater_than" value="5" goto="handle_over_to_pending_temp" next="set_ex_over" />
	<step name="handle_over_to_pending_temp"  action="clear_alert" source="alert" type="1,0" next="handle_over_to_pending_temp2" />
	<step name="handle_over_to_pending_temp2" action="clear_alert" source="command_alert" type="system_over_temperature" next="handle_over_to_pending_temp_skip" />
	<step name="handle_over_to_pending_temp_skip" action="compare_int_value" var="drv_state" comparison="greater_than" value="5" goto="handle_over_to_pending_temp3" next="set_ex_pending" />
	<step name="handle_over_to_pending_temp3" action="set_alert"   source="alert" type="5,0"  next="handle_over_to_pending_temp4" />
	<step name="handle_over_to_pending_temp4" action="set_alert" source="command_alert" type="system_pending_shutdown"  next="handle_over_to_pending_temp5" />
	<step name="handle_over_to_pending_temp5" action="set_alert" source="command_alert" type="system_safe_mode"  next="handle_over_to_pending_temp6" />

	<step name="handle_ex_pending_temp" action="compare_int_value" var="global_state" comparison="less_than" value="6" goto="handle_pending_to_over_temp" next="handle_ex_pending_temp2" />
	<step name="handle_pending_to_over_temp"  action="compare_int_value" var="pending_shutdown"          comparison="greater_than" value="0"   goto="handle_pending_to_over_temp2"       next="handle_pending_to_over_temp4" />
	<step name="handle_pending_to_over_temp2"  action="set_int_value"     var="pending_shutdown"          value="0"                 next="handle_pending_to_over_temp3" />
	<step name="handle_pending_to_over_temp3"  action="system"            command="/opt/wd/sbin/send_pending_shutdown.sh -c"   next="handle_pending_to_over_temp4" />
	<step name="handle_pending_to_over_temp4"  action="clear_alert" source="alert" type="5,0" next="handle_pending_to_over_temp5" />
	<step name="handle_pending_to_over_temp5" action="clear_alert" source="command_alert" type="system_pending_shutdown" next="handle_pending_to_over_temp6" />
	<step name="handle_pending_to_over_temp6" action="clear_alert" source="command_alert" type="system_safe_mode" next="handle_pending_to_over_temp7" />
	<step name="handle_pending_to_over_temp7" action="set_alert"   source="alert" type="1,0"  next="handle_pending_to_over_temp8" />
	<step name="handle_pending_to_over_temp8" action="set_alert" source="command_alert" type="system_over_temperature" next="set_ex_over" />

	<step name="handle_ex_pending_temp2" action="compare_int_value" var="global_state" comparison="greater_than" value="6" goto="handle_pending_to_extreme_temp" next="send_pending_shutdown" />

	<step name="handle_pending_to_extreme_temp"  action="compare_int_value" var="pending_shutdown"          comparison="greater_than" value="0"   goto="handle_pending_to_extreme_temp2"       next="handle_pending_to_extreme_temp4" />
	<step name="handle_pending_to_extreme_temp2"  action="set_int_value"     var="pending_shutdown"          value="0"                 next="handle_pending_to_extreme_temp3" />
	<step name="handle_pending_to_extreme_temp3"  action="system"            command="/opt/wd/sbin/send_pending_shutdown.sh -c"   next="handle_pending_to_extreme_temp4" />

	<step name="handle_pending_to_extreme_temp4"  action="clear_alert" source="alert" type="5,0" next="handle_pending_to_extreme_temp5" />
	<step name="handle_pending_to_extreme_temp5" action="clear_alert" source="command_alert" type="system_pending_shutdown" next="handle_pending_to_extreme_temp6" />
	<step name="handle_pending_to_extreme_temp6" action="set_alert"   source="alert" type="6,0"  next="shutdown" />

	<step name="set_ex_under"  action="set_int_value" var="ex_global_state" value="0" />
	<step name="set_ex_normal"  action="set_int_value" var="ex_global_state" value="1" />
	<step name="set_ex_over"  action="set_int_value" var="ex_global_state" value="5" />
	<step name="set_ex_pending"  action="set_int_value" var="ex_global_state" value="6" />
	<step name="set_ex_extreme"  action="set_int_value" var="ex_global_state" value="7" />

	<step name="handle_over_to_pending_temp6"      action="system" command="/opt/wd/sbin/send_pending_shutdown.sh -c"  next="send_pending_shutdown" />
	<step name="send_pending_shutdown"      action="compare_int_value"   var="drv_state"         comparison="less_than"  value="100"  interval="10"  goto="send_pending_shutdown2"    next="set_ex_pending" />
	<step name="send_pending_shutdown2"   action="set_int_value"     var="pending_shutdown"          value="1"                 next="send_pending_shutdown3" />
	<step name="send_pending_shutdown3"  action="system"              command="/opt/wd/sbin/send_pending_shutdown.sh -s 3600" next="set_ex_pending" />

	<step name="shutdown" action="system"    command="immediately_shutdown.sh" next="set_ex_extreme" />
	
    </thermal>
</thermal_config>

#75

Getting closer… the PR4100 uses ACPI control.

# dmesg | grep ACPI

[    0.000000] BIOS-e820: [mem 0x000000000003f000-0x000000000003ffff] ACPI NVS
[    0.000000] BIOS-e820: [mem 0x000000007721e000-0x0000000077684fff] ACPI NVS
[    0.000000] efi:  ACPI=0x775f4000  ACPI 2.0=0x775f4000  SMBIOS=0xf05e0  MPS=0xfca40
[    0.000000] ACPI: Early table checksum verification disabled
[    0.000000] ACPI: RSDP 0x00000000775F4000 000024 (v02 ALASKA)
[    0.000000] ACPI: XSDT 0x00000000775F4080 00007C (v01 ALASKA A M I    01072009 AMI  00010013)
[    0.000000] ACPI: FACP 0x00000000775FE888 00010C (v05 ALASKA A M I    01072009 AMI  00010013)
[    0.000000] ACPI BIOS Warning (bug): 32/64X length mismatch in FADT/Gpe0Block: 128/32 (20140424/tbfadt-623)
[    0.000000] ACPI: DSDT 0x00000000775F4190 00A6F1 (v02 ALASKA A M I    01072009 INTL 20120913)
[    0.000000] ACPI: FACS 0x0000000077684E80 000040
[    0.000000] ACPI: APIC 0x00000000775FE998 000084 (v03 ALASKA A M I    01072009 AMI  00010013)
[    0.000000] ACPI: FPDT 0x00000000775FEA20 000044 (v01 ALASKA A M I    01072009 AMI  00010013)
[    0.000000] ACPI: FIDT 0x00000000775FEA68 00009C (v01 ALASKA A M I    01072009 AMI  00010013)
[    0.000000] ACPI: MCFG 0x00000000775FEB08 00003C (v01 ALASKA A M I    01072009 MSFT 00000097)
[    0.000000] ACPI: SSDT 0x00000000775FEB48 000763 (v01 PmRef  CpuPm    00003000 INTL 20061109)
[    0.000000] ACPI: SSDT 0x00000000775FF2B0 000290 (v01 PmRef  Cpu0Tst  00003000 INTL 20061109)
[    0.000000] ACPI: SSDT 0x00000000775FF540 00017A (v01 PmRef  ApTst    00003000 INTL 20061109)
[    0.000000] ACPI: UEFI 0x00000000775FF6C0 000042 (v01 ALASKA A M I    00000000      00000000)
[    0.000000] ACPI: LPIT 0x00000000775FF708 000104 (v01 ALASKA A M I    00000005 MSFT 0100000D)
[    0.000000] ACPI: CSRT 0x00000000775FF810 00014C (v00 INTEL  LANFORDC 00000005 MSFT 0100000D)
[    0.000000] ACPI: Local APIC address 0xfee00000
[    0.000000] ACPI: PM-Timer IO Port: 0x408
[    0.000000] ACPI: Local APIC address 0xfee00000
[    0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x02] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x03] lapic_id[0x04] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x04] lapic_id[0x06] enabled)
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1])
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0x02] high edge lint[0x1])
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0x03] high edge lint[0x1])
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0x04] high edge lint[0x1])
[    0.000000] ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0])
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.000000] ACPI: IRQ0 used by override.
[    0.000000] ACPI: IRQ2 used by override.
[    0.000000] ACPI: IRQ9 used by override.
[    0.000000] Using ACPI (MADT) for SMP configuration information
[    0.017117] ACPI: Core revision 20140424
[    0.039416] ACPI: All ACPI Tables successfully acquired
[    0.436325] PM: Registering ACPI NVS region [mem 0x0003f000-0x0003ffff] (4096 bytes)
[    0.444988] PM: Registering ACPI NVS region [mem 0x7721e000-0x77684fff] (4616192 bytes)
[    0.483507] ACPI: bus type PCI registered
[    0.487990] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
[    0.533438] ACPI: Added _OSI(Module Device)
[    0.538122] ACPI: Added _OSI(Processor Device)
[    0.543089] ACPI: Added _OSI(3.0 _SCP Extensions)
[    0.548344] ACPI: Added _OSI(Processor Aggregator Device)
[    0.554379] ACPI: Added _OSI(Linux)
[    0.591476] ACPI: Dynamic OEM Table Load:
[    0.595973] ACPI: SSDT 0xFFFF88017F03C800 0006D9 (v01 PmRef  Cpu0Ist  00003000 INTL 20061109)
[    0.617852] ACPI: Dynamic OEM Table Load:
[    0.622344] ACPI: SSDT 0xFFFF88017AEE0C00 00015F (v01 PmRef  ApIst    00003000 INTL 20061109)
[    0.645354] ACPI: Interpreter enabled
[    0.649460] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_] (20140424/hwxface-580)
[    0.659794] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S2_] (20140424/hwxface-580)
[    0.670125] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S3_] (20140424/hwxface-580)
[    0.680472] ACPI: (supports S0 S4 S5)
[    0.684565] ACPI: Using IOAPIC for interrupt routing
[    0.690186] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    0.702920] ACPI: Power Resource [ID3C] (off)
[    0.710387] ACPI: Power Resource [USBC] (on)
[    0.722654] ACPI: Power Resource [CLK0] (off)
[    0.727837] ACPI: Power Resource [CLK0] (off)
[    0.732798] ACPI: Power Resource [CLK1] (off)
[    0.743763] ACPI: Power Resource [FN00] (off)
[    0.749672] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
[    0.840320] pci 0000:00:14.0: System wakeup disabled by ACPI
[    0.849269] pci 0000:00:1b.0: System wakeup disabled by ACPI
[    0.855941] pci 0000:00:1c.0: System wakeup disabled by ACPI
[    0.862614] pci 0000:00:1c.1: System wakeup disabled by ACPI
[    0.869282] pci 0000:00:1c.2: System wakeup disabled by ACPI
[    0.875950] pci 0000:00:1c.3: System wakeup disabled by ACPI
[    0.884559] pci 0000:01:00.0: System wakeup disabled by ACPI
[    0.904953] pci 0000:02:00.0: System wakeup disabled by ACPI
[    0.925273] pci 0000:03:00.0: System wakeup disabled by ACPI
[    0.945593] pci 0000:04:00.0: System wakeup disabled by ACPI
[    0.967373] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 10 *11 12 14 15)
[    0.975242] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 10 *11 12 14 15)
[    0.983107] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 *10 11 12 14 15)
[    0.990965] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 *5 6 10 11 12 14 15)
[    0.998838] ACPI: PCI Interrupt Link [LNKE] (IRQs *3 4 5 6 10 11 12 14 15)
[    1.006709] ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 *10 11 12 14 15)
[    1.014581] ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 *5 6 10 11 12 14 15)
[    1.022429] ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    1.032607] ACPI: Enabled 5 GPEs in block 00 to 3F
[    1.062934] PCI: Using ACPI for IRQ routing
[    1.101336] pnp: PnP ACPI init
[    1.104794] ACPI: bus type PNP registered
[    1.109387] pnp 00:00: Plug and Play ACPI device, IDs PNP0b00 (active)
[    1.129611] system 00:01: Plug and Play ACPI device, IDs PNP0c02 (active)
[    1.132283] system 00:02: Plug and Play ACPI device, IDs PNP0c02 (active)
[    1.199775] system 00:03: Plug and Play ACPI device, IDs PNP0c02 (active)
[    1.200404] pnp: PnP ACPI: found 4 devices
[    1.204984] ACPI: bus type PNP unregistered
[    3.454852] ACPI: Fan [FAN0] (off)
[    3.474281] ACPI: Thermal Zone [TZ01] (27 C)
[    3.491407] ACPI Warning: \_SB_.PCI0.RP01._PRT: Return Package has no elements (empty) (20140424/nsprepkg-126)
[    3.492223] ACPI Warning: \_SB_.PCI0.RP02._PRT: Return Package has no elements (empty) (20140424/nsprepkg-126)
[    3.604140] ACPI: bus type USB registered
[    9.267669] ACPI: Power Button [PWRB]
[    9.281605] ACPI: Sleep Button [SLPB]
[    9.299360] ACPI: Power Button [PWRF]

The temperature sensors are now detected by lm_sensors, but still no fan control. It looks like a driver issue.

# sensors -u

acpitz-virtual-0
Adapter: Virtual device
temp1:
  temp1_input: 26.800
  temp1_crit: 95.000

coretemp-isa-0000
Adapter: ISA adapter
Core 0:
  temp2_input: 32.000
  temp2_max: 90.000
  temp2_crit: 90.000
  temp2_crit_alarm: 0.000
Core 1:
  temp3_input: 35.000
  temp3_max: 90.000
  temp3_crit: 90.000
  temp3_crit_alarm: 0.000
Core 2:
  temp4_input: 37.000
  temp4_max: 90.000
  temp4_crit: 90.000
  temp4_crit_alarm: 0.000
Core 3:
  temp5_input: 32.000
  temp5_max: 90.000
  temp5_crit: 90.000
  temp5_crit_alarm: 0.000

#76

@dswv42,

Just looked on the EX4100 and the same binary exists on it as well.

Cheers,

JediNite


#77

@dswv42,

There are a few different ones of these on the NAS:

 root@WDMyCloudEX4100 / # find . -name *thermal.xml -print
./usr/local/modules/etc/wd/BVBZ-thermal.xml
./usr/local/modules/etc/wd/BWAZ-thermal.xml
./usr/local/modules/etc/wd/BWVZ-thermal.xml
./usr/local/modules/etc/wd/BWZE-thermal.xml
./etc/wd/BVBZ-thermal.xml
./etc/wd/BWAZ-thermal.xml
./etc/wd/BWVZ-thermal.xml
./etc/wd/BWZE-thermal.xml

The contents of these look similar to what you published for the PR4100.

Cheers,

JediNite


#78

@dswv42,

None of the stuff in this post exists on the EX4100 :frowning:

Cheers,

JediNite


#79

Further analysis indicates that a file named thermal_config.xml may be the actual configuration file that’s in use. Perhaps the other XML configuration files are merely remnants from previous firmware versions, possibly left in place for reference.

/usr/local/modules/etc/wd/thermal_config.xml

The thermal_config.xml file is accessed by a binary file named wdtms (Western Digital Thermal Management Service ?), which references the shared library files libthermal_management.so.1, libsprite_hwlib_fan_controller.so.1, libredhawk_hwlib_temperature_source.so.1, libsprite_drive_temperature_source.so.1, etc.

/usr/local/modules/opt/wd/bin/wdtms

Curiously, the product model node of the thermal_config.xml says SPRITE, which is the code for the My Cloud DL4100.

<?xml version="1.0" encoding="utf-8" ?>
<product_model>SPRITE</product_model>
<button_config>
	<target_device>wdbuttons</target_device>
	<input_class_path>/sys/class/input</input_class_path>
</button_config>
<lcd_driver_path>/sys/wdlcd</lcd_driver_path>
<!-- Put elements of interest to multiple binaries here -->
<binaries>
  <!-- Put elements of interest to specific binary in it own binary section -->
  <binary name="power_monitor">        
    <libraries>
      <library name="power_supply_state" path="/opt/wd/lib/libredhawk_query_power_supply_state.so" />
    </libraries>
  </binary>
  <binary name="wdleds">        
    <libraries>
      <library name="led_control" path="/opt/wd/lib/libredhawk_led_control.so" />
    </libraries>
  </binary>
  <binary name="wddrivemonitor">
    <device_paths>
      <device_path name="bay_drives" path="/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/host0/target0:0:" />
    </device_paths>
    <libraries>
      <library name="hardware_info" path="/opt/wd/lib/libredhawk_drive_service_hardware_info.so" />
    </libraries>
  </binary>
</binaries>

<thermal_config>
    <options>
        <scriptInterval value="1" />
    </options>

    <libraries>
        <library name="/opt/wd/lib/libredhawk_hwlib_temperature_source.so" source_name="system" type="1" />
        <library name="/opt/wd/lib/libredhawk_hwlib_temperature_source.so" source_name="memory" type="3" count="1" optional="2" />
        <library name="/opt/wd/lib/libredhawk_hwlib_temperature_source.so" source_name="dts" type="5" log_variance="3.0" />
        <library name="/opt/wd/lib/libredhawk_hwlib_temperature_source.so" source_name="cpu" type="6" log_variance="3.0" />
        <library name="/opt/wd/lib/libsprite_hwlib_fan_controller.so"     source_name="system_fan" type="1" scale_factor="100" initial_value="8000" />

        <library name="/opt/wd/lib/libsprite_drive_temperature_source.so" drives="4" optional="2" read_interval="300" standby_mask_path="/tmp/hd_sleep" >
            <drive_info index="0" device_path="/sys/devices/pci0000:00/0000:00:18.0/ata5/host4/target4:0:0/4:0:0:0/block"/>
            <drive_info index="1" device_path="/sys/devices/pci0000:00/0000:00:18.0/ata6/host5/target5:0:0/5:0:0:0/block"/>
            <drive_info index="2" device_path="/sys/devices/pci0000:00/0000:00:17.0/ata1/host0/target0:0:0/0:0:0:0/block"/>
            <drive_info index="3" device_path="/sys/devices/pci0000:00/0000:00:17.0/ata2/host1/target1:0:0/1:0:0:0/block"/>
        </library>
<!-- to be deleted
        <library name="/opt/wd/lib/libstargate_system_led_interface.so" />
        <library name="/opt/wd/lib/libstargate_drive_led_interface.so" />
        <library name="/opt/wd/lib/libstargate_lcd_alert_interface.so" />
-->
        <library name="/opt/wd/lib/libsprite_alert_interface.so" />
    </libraries>

    <thermal>
        <step name="start"  action="compare_temperature" source="dts" index="*" comparison="less_than" value="1.0"  goto="cpuhotshutdown"                   next="checkdrvshutdown" />
        <step name="checkdrvshutdown" action="compare_temperature" source="drive" index="*" comparison="greater_than" value="69.0" goto="drivehotshutdown"  next="checkcpuheat" />

        <step name="checkcpuheat" action="compare_temperature" source="dts" index="*" comparison="less_than" value="10.0" goto="sendcpuheatalert"  next="clearcpuheatalert" />
        <step name="sendcpuheatalert" action="set_alert" source="alert" type="5,0,cpu"                                                             next="setsysfanmax" />
        <step name="clearcpuheatalert" action="clear_alert" source="alert" type="5,0,cpu"                                                          next="checkmemheat" />

        <step name="checkmemheat" action="compare_temperature" source="memory" index="0" comparison="greater_than" value="89.0" goto="sendmemhot"  next="clearmemhot" />
        <step name="sendmemhot" action="set_alert"   source="alert" type="1,0,mem"                                                                 next="setsysfanmax" />
        <step name="clearmemhot"     action="clear_alert" source="alert" type="1,0,mem"                                                            next="checkcpufanhot" />

        <step name="checkcpufanhot" action="compare_temperature" source="dts" index="*" comparison="less_than" value="20.0" goto="sendcputemphigh"  next="checkcpufanwarm" />
        <step name="checkcpufanwarm" action="compare_temperature" source="dts" index="*" comparison="less_than" value="25.0" goto="incsysfan66"     next="checkcpufancontent" />
        <step name="checkcpufancontent" action="compare_temperature" source="dts" index="*" comparison="less_than" value="35.0" goto="decsysfan"    next="checkdrv0warn" />

        <step name="cpuhotshutdown"    action="set_alert" source="alert" type="6,0,cpu"       next="shutdown" />
        <step name="drivehotshutdown"  action="set_alert" source="alert" type="6,0,drive"     next="shutdown" />
        <step name="sendcputemphigh" action="set_alert" source="alert" type="1004,0,cpu"      next="incsysfan200" />
        <step name="shutdown"           action="system"    command="shutdown -h now" />

        <step name="checkdrv0warn" action="compare_temperature" source="drive" index="0" comparison="greater_than" value="64.0" goto="setdrv0warn"  next="cleardrv0warn" />
        <step name="setdrv0warn"        action="set_alert"      source="alert" type="1,0,drive_0"                                                   next="checkdrv1warn" />
        <step name="cleardrv0warn"      action="clear_alert"    source="alert" type="1,0,drive_0"                                                   next="checkdrv1warn" />

        <step name="checkdrv1warn" action="compare_temperature" source="drive" index="1" comparison="greater_than" value="64.0" goto="setdrv1warn"  next="cleardrv1warn" />
        <step name="setdrv1warn"        action="set_alert"      source="alert" type="1,0,drive_1"                                                   next="checkdrv2warn" />
        <step name="cleardrv1warn"      action="clear_alert"    source="alert" type="1,0,drive_1"                                                   next="checkdrv2warn" />

        <step name="checkdrv2warn" action="compare_temperature" source="drive" index="2" comparison="greater_than" value="64.0" goto="setdrv2warn"  next="cleardrv2warn" />
        <step name="setdrv2warn"        action="set_alert"      source="alert" type="1,0,drive_2"                                                   next="checkdrv3warn" />
        <step name="cleardrv2warn"      action="clear_alert"    source="alert" type="1,0,drive_2"                                                   next="checkdrv3warn" />

        <step name="checkdrv3warn" action="compare_temperature" source="drive" index="3" comparison="greater_than" value="64.0" goto="setdrv3warn"  next="cleardrv3warn" />
        <step name="setdrv3warn"        action="set_alert"      source="alert" type="1,0,drive_3"                                                   next="checkdtssysmax" />
        <step name="cleardrv3warn"      action="clear_alert"    source="alert" type="1,0,drive_3"                                                   next="checkdtssysmax" />

        <step name="checkdtssysmax" action="compare_temperature" source="dts" index="*" comparison="less_than" value="15.0" goto="sendcpuovertemp"  next="clearcpuovertemp" />
        <step name="sendcpuovertemp" action="set_alert" source="alert" type="1,0,cpu"                                                               next="setsysfanmax" />
        <step name="clearcpuovertemp" action="clear_alert" source="alert" type="1,0,cpu"                                                            next="checkmemsysmax" />
        <step name="checkmemsysmax" action="compare_temperature" source="memory" index="*" comparison="greater_than" value="84.0" goto="sendmemovertemp" next="clearmemovertemp" />
        <step name="sendmemovertemp" action="set_alert" source="alert" type="1004,0,mem"                                                                 next="setsysfanmax" />
        <step name="clearmemovertemp" action="clear_alert" source="alert" type="1004,0,mem"                                                              next="checkdrvsysmax" />
        <step name="checkdrvsysmax" action="compare_temperature" source="drive"  index="*" comparison="greater_than" value="59.0" goto="setsysfanmax"    next="checkdtssyswarm" />
        <step name="checkdtssyswarm" action="compare_temperature" source="dts" index="*" comparison="less_than" value="20.0" goto="incsysfan200"         next="checkmemsyswarm" />
        <step name="checkmemsyswarm" action="compare_temperature" source="memory" index="*" comparison="greater_than" value="69.0" goto="incsysfan66"    next="checkdrvsyswarm" />
        <step name="checkdrvsyswarm" action="compare_temperature" source="drive" index="*" comparison="greater_than" value="52.0" goto="incsysfan3"      next="checkdtssyscool" />
        <step name="checkdtssyscool" action="compare_temperature" source="dts" index="*" comparison="less_than" value="30.0" goto="nosysfanchange"       next="checkmemsyscool" />
        <step name="checkmemsyscool" action="compare_temperature" source="memory" index="*" comparison="greater_than" value="60.0" goto="nosysfanchange" next="checkdrvsyscool" />
        <step name="checkdrvsyscool" action="compare_temperature" source="drive" index="*" comparison="greater_than" value="44.0" goto="nosysfanchange"  next="decsysfan" />

        <step name="setsysfanmax"   action="set_fan"       source="system_fan" index="0" value="10000" />
        <step name="incsysfan200"   action="increment_fan" source="system_fan" index="0" delta="200" limit="10000" />
        <step name="incsysfan66"    action="increment_fan" source="system_fan" index="0" delta="66"  limit="10000" />
        <step name="incsysfan16"    action="increment_fan" source="system_fan" index="0" delta="16"  limit="10000" />
        <step name="incsysfan3"     action="increment_fan" source="system_fan" index="0" delta="4"   limit="10000" />
        <step name="decsysfan"      action="decrement_fan" source="system_fan" index="0" delta="4"   limit="3500" />
        <step name="nosysfanchange" action="increment_fan" source="system_fan" index="0" delta="0"   limit="10000" />
    </thermal>
</thermal_config>
<DriveMap>
  <DriveMapEntry Bay="0" DrivePort="0" LED="1" ControlPort="0" />
  <DriveMapEntry Bay="1" DrivePort="1" LED="2" ControlPort="1" />
  <DriveMapEntry Bay="2" DrivePort="2" LED="3" ControlPort="2" />
  <DriveMapEntry Bay="3" DrivePort="3" LED="4" ControlPort="3" />
</DriveMap>

#80

Found this as a running process.

root@WDMyCloudEX4100 root # ps -aef | grep wdtms
root      4153     1  0 Nov04 ?        00:02:50 /opt/wd/bin/wdtms -config=/etc/wd/BWZE-thermal.xml

The file referenced is identical to the ones you are referring to in /usr/local/modules/etc/wd however, the EX4100 does not have a thermal_config.xml file. Instead has the following:

root@WDMyCloudEX4100 root # ls -al /usr/local/modules/etc/wd/
drwxrwxr-x    2 root     root           111 Apr  1  2016 .
drwxr-xr-x   10 root     root           158 Nov 14  2015 ..
-rwxrwxr-x    1 root     root         23923 Apr  1  2016 BVBZ-thermal.xml
-rwxrwxr-x    1 root     root         23873 Apr  1  2016 BWAZ-thermal.xml
-rwxrwxr-x    1 root     root         23923 Apr  1  2016 BWVZ-thermal.xml
-rwxrwxr-x    1 root     root         23876 Apr  1  2016 BWZE-thermal.xml

The Product Model is returned as YELLOWSTONE and the following libraries are referenced:

 <library name="/opt/wd/lib/libredhawk_hwlib_temperature_source.so" source_name="system" type="1" count="1" log_variance="5.0" read_interval="5" />
 <library name="/opt/wd/lib/libredhawk_hwlib_temperature_source.so" source_name="cpu" type="6" count="1" log_variance="5.0" read_interval="5" />
 <library name="/opt/wd/lib/libredhawk_hwlib_temperature_source.so" source_name="drive" type="7" count="4" optional="2" log_variance="5.0" read_interval="60" />
 <library name="/opt/wd/lib/libsprite_hwlib_fan_controller.so"     source_name="system_fan" type="1" count="1" scale_factor="1" initial_value="80" fan_check_retries="3" />
 <library name="/opt/wd/lib/libsprite_alert_interface.so" />
 <library name="/opt/wd/lib/libsprite_syslog_alert_interface.so" />
 <library name="/opt/wd/lib/libsprite_command_alert_interface.so" >

If there is value in getting the whole file, I can attach it but looks very similar to the one you’ve shared.

Cheers,

JediNite


#81

I guess that settles it, the BNFA-thermal.xml file is correct for the PR4100 and the BWZE-thermal.xml file is correct for the EX4100. Knowing this helps to narrow things down a bit.

# ps -aef | grep wdtms
 2436 root      267m S    /opt/wd/bin/wdtms -config=/etc/wd/BNFA-thermal.xml
23744 root      7720 S    grep wdtms

#82

Thermal management process information.

System Init:

/usr/sbin/system_init

Daemon Start:

/etc/init.d/S20wdtmsd start

Daemon Run:

/opt/wd/bin/wdtms -config=/etc/wd/BNFA-thermal.xml
/opt/wd/bin/wdtms -debug -config=/etc/wd/BNFA-thermal.xml

Config Files:

/etc/wd

Processes:

# lsof /opt/wd/bin/wdtms
	COMMAND   PID USER  FD   TYPE DEVICE SIZE/OFF NODE NAME
	wdtms   13445 root txt    REG    7,0    40168 6307 /usr/local/modules/opt/wd/bin/wdtms

# lsof -p 13445
	COMMAND   PID USER   FD   TYPE             DEVICE SIZE/OFF   NODE NAME
	wdtms   13445 root  cwd    DIR                0,1        0      1 /
	wdtms   13445 root  rtd    DIR                0,1        0      1 /
	wdtms   13445 root  txt    REG                7,0    40168   6307 /usr/local/modules/opt/wd/bin/wdtms
	wdtms   13445 root  mem    REG                7,0   134896   6333 /usr/local/modules/opt/wd/lib/libsprite_command_alert_interface.so.1
	wdtms   13445 root  mem    REG                7,0    41560   6341 /usr/local/modules/opt/wd/lib/libsprite_syslog_alert_interface.so.1
	wdtms   13445 root  mem    REG                7,0    10016  18064 /usr/local/modules/lib/libwdlog.so.1
	wdtms   13445 root  mem    REG                7,0    15464  18011 /usr/local/modules/lib/libxmldbc.so
	wdtms   13445 root  mem    REG                7,0  1402312  17976 /usr/local/modules/lib/libxml2.so.2.7.4
	wdtms   13445 root  mem    REG                7,0   289432   3337 /usr/local/modules/usrlib/libalert.so
	wdtms   13445 root  mem    REG                7,0   210264   6324 /usr/local/modules/opt/wd/lib/libsprite_alert_interface.so.1
	wdtms   13445 root  mem    REG                7,0   160968   6330 /usr/local/modules/opt/wd/lib/libsprite_drive_temperature_source.so.1
	wdtms   13445 root  mem    REG                7,0    70880   6339 /usr/local/modules/opt/wd/lib/libsprite_hwlib_fan_controller.so.1
	wdtms   13445 root  mem    REG                7,0   970848   6331 /usr/local/modules/opt/wd/lib/libwdhw.so.1
	wdtms   13445 root  mem    REG                7,0   136504   6342 /usr/local/modules/opt/wd/lib/libredhawk_hwlib_temperature_source.so.1
	wdtms   13445 root  mem    REG                0,1    31704   2257 /lib/librt-2.19.so
	wdtms   13445 root  mem    REG                0,1  1720792   2276 /lib/libc-2.19.so
	wdtms   13445 root  mem    REG                0,1    70056   2251 /lib/libgcc_s.so.1
	wdtms   13445 root  mem    REG                0,1  1050984   2250 /lib/libm-2.19.so
	wdtms   13445 root  mem    REG                0,1   830424   2270 /lib/libstdc++.so.6.0.18
	wdtms   13445 root  mem    REG                7,0  1884112   6334 /usr/local/modules/opt/wd/lib/libthermal_management.so.1
	wdtms   13445 root  mem    REG                7,0    93680   6316 /usr/local/modules/opt/wd/lib/boost/libboost_thread.so.1.55.0
	wdtms   13445 root  mem    REG                7,0    12384   6309 /usr/local/modules/opt/wd/lib/boost/libboost_system.so.1.55.0
	wdtms   13445 root  mem    REG                0,1    14664   2227 /lib/libdl-2.19.so
	wdtms   13445 root  mem    REG                0,1   148342   2273 /lib/libpthread-2.19.so
	wdtms   13445 root  mem    REG                0,1   136768   2223 /lib/ld-2.19.so
	wdtms   13445 root    0u   CHR                1,3      0t0   2410 /dev/null
	wdtms   13445 root    1u   CHR                1,3      0t0   2410 /dev/null
	wdtms   13445 root    2u   CHR                1,3      0t0   2410 /dev/null
	wdtms   13445 root    3u  unix 0xffff8801717948c0      0t0 246386 socket
	wdtms   13445 root    4u  0000                0,9        0   2051 anon_inode
	wdtms   13445 root    5u  0000                0,9        0   2051 anon_inode
	wdtms   13445 root    6u  0000                0,9        0   2051 anon_inode
	wdtms   13445 root    7u  unix 0xffff880179007440      0t0 247834 /var/run/wdtms.sock

Dependencies:

# ldd /opt/wd/bin/wdtms
        linux-vdso.so.1 (0x00007fff87fd9000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f70a246b000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f70a2267000)
        libboost_system.so.1.55.0 => /opt/wd/lib/boost/libboost_system.so.1.55.0 (0x00007f70a2063000)
        libboost_thread.so.1.55.0 => /opt/wd/lib/boost/libboost_thread.so.1.55.0 (0x00007f70a1e4c000)
        libthermal_management.so.1 => /opt/wd/lib/libthermal_management.so.1 (0x00007f70a1a80000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f70a17a0000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f70a149f000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f70a128e000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f70a0ee5000)
        /lib64/ld-linux-x86-64.so.2 (0x0000563c25ad5000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f70a0cdd000)

Dependencies (Verbose):

# ldd -v /opt/wd/bin/wdtms
        linux-vdso.so.1 (0x00007fff58b83000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f681ef2e000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f681ed2a000)
        libboost_system.so.1.55.0 => /opt/wd/lib/boost/libboost_system.so.1.55.0 (0x00007f681eb26000)
        libboost_thread.so.1.55.0 => /opt/wd/lib/boost/libboost_thread.so.1.55.0 (0x00007f681e90f000)
        libthermal_management.so.1 => /opt/wd/lib/libthermal_management.so.1 (0x00007f681e543000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f681e263000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f681df62000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f681dd51000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f681d9a8000)
        /lib64/ld-linux-x86-64.so.2 (0x000055e69f1b8000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f681d7a0000)

        Version information:
        /opt/wd/bin/wdtms:
                libgcc_s.so.1 (GCC_3.0) => /lib64/libgcc_s.so.1
                libpthread.so.0 (GLIBC_2.2.5) => /lib64/libpthread.so.0
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
                libstdc++.so.6 (CXXABI_1.3.1) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4.14) => /lib64/libstdc++.so.6
                libstdc++.so.6 (CXXABI_1.3) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4) => /lib64/libstdc++.so.6
        /lib64/libpthread.so.0:
                ld-linux-x86-64.so.2 (GLIBC_2.2.5) => /lib64/ld-linux-x86-64.so.2
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6
                libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libdl.so.2:
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /opt/wd/lib/boost/libboost_system.so.1.55.0:
                libgcc_s.so.1 (GCC_3.0) => /lib64/libgcc_s.so.1
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
                libstdc++.so.6 (GLIBCXX_3.4) => /lib64/libstdc++.so.6
                libstdc++.so.6 (CXXABI_1.3) => /lib64/libstdc++.so.6
        /opt/wd/lib/boost/libboost_thread.so.1.55.0:
                librt.so.1 (GLIBC_2.2.5) => /lib64/librt.so.1
                libgcc_s.so.1 (GCC_3.0) => /lib64/libgcc_s.so.1
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
                libpthread.so.0 (GLIBC_2.3.2) => /lib64/libpthread.so.0
                libpthread.so.0 (GLIBC_2.2.5) => /lib64/libpthread.so.0
                libstdc++.so.6 (CXXABI_1.3) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4.9) => /lib64/libstdc++.so.6
        /opt/wd/lib/libthermal_management.so.1:
                libgcc_s.so.1 (GCC_3.0) => /lib64/libgcc_s.so.1
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
                libm.so.6 (GLIBC_2.2.5) => /lib64/libm.so.6
                libpthread.so.0 (GLIBC_2.2.5) => /lib64/libpthread.so.0
                libpthread.so.0 (GLIBC_2.3.2) => /lib64/libpthread.so.0
                libstdc++.so.6 (CXXABI_1.3.1) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4.18) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4.14) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4.5) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4.11) => /lib64/libstdc++.so.6
                libstdc++.so.6 (CXXABI_1.3.5) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4.15) => /lib64/libstdc++.so.6
                libstdc++.so.6 (CXXABI_1.3) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4) => /lib64/libstdc++.so.6
                libc.so.6 (GLIBC_2.9) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.7) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.8) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libstdc++.so.6:
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
                libm.so.6 (GLIBC_2.2.5) => /lib64/libm.so.6
                libgcc_s.so.1 (GCC_4.2.0) => /lib64/libgcc_s.so.1
                libgcc_s.so.1 (GCC_3.3) => /lib64/libgcc_s.so.1
                libgcc_s.so.1 (GCC_3.0) => /lib64/libgcc_s.so.1
                libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libm.so.6:
                libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libgcc_s.so.1:
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libc.so.6:
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
        /lib64/librt.so.1:
                libpthread.so.0 (GLIBC_2.3.2) => /lib64/libpthread.so.0
                libpthread.so.0 (GLIBC_PRIVATE) => /lib64/libpthread.so.0
                libpthread.so.0 (GLIBC_2.2.5) => /lib64/libpthread.so.0
                libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6
                libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6

#83

Fan control process information.

System Init:

/usr/sbin/system_init

Init Code:

if [ -e /usr/sbin/fan_control ]; then
#======================
#	Fan Control
#======================
  fan_control b c
  if [ -e /tmp/hw_mode ]; then
    hw_mode_test_temper=`cat /tmp/hw_mode | grep temperature`
    if [ -n "$hw_mode_test_temper" ]; then
      fan_control -w c&
    else
      fan_control 0 c&
    fi
  else
    fan_control 0 c&
  fi
fi

Command Output:

# /usr/sbin/fan_control -h
	*** Fan Cobtrol Help Message ***

	fan_control b c: for NAS booting
	fan_control 0 d : [auto] open debug msg
	fan_control 0 c : [auto] close debug msg
	fan_control -g 0 : get current temperature
	fan_control -g 3 : get fan state
	fan_control -g 4 : get fan rpm

# /usr/sbin/fan_control -g 0
	Current temperature is 35
	hd0 temperature=-1
	hd1 temperature=36
	hd2 temperature=39
	hd3 temperature=-1
	CPU0 temperature=41
	CPU1 temperature=41
	CPU2 temperature=41
	CPU3 temperature=41
	CPU temperature=41

# /usr/sbin/fan_control -g 1
	Lower temperature is 35
	
# /usr/sbin/fan_control -g 2
	Upper temperature is 38

# /usr/sbin/fan_control -g 3
	fan state is 1
	
# /usr/sbin/fan_control -g 4
	fan rpm = 540
	
# /usr/sbin/fan_control 0 d
	[fan_control.c:424] standby_flag=6
	[fan_control.c:1939] current board temperature is 38
	[fan_control.c:1940] current hdd temperature is 0
	[fan_control.c:647] hd temperature 0 , fan control base on board temperature-10
	[fan_control.c:656] temperature=28
	[fan_control.c:1438] current fan_rpm=540
	[fan_control.c:776] uP cmd:up_send_ctl temperature 28 82
	[fan_control.c:887] calculate temperature=28
	[fan_control.c:890] WD daemon send alert
	[fan_control.c:268] sleep duration is 60
	[fan_control.c:273] 60
	[fan_control.c:273] 59
	[fan_control.c:273] 58
	[fan_control.c:273] 57
	[fan_control.c:273] 56
	[fan_control.c:273] 55
	[fan_control.c:273] 54
	[fan_control.c:273] 53
	[fan_control.c:273] 52
	[fan_control.c:273] 51
	[fan_control.c:273] 50
	[fan_control.c:273] 49
	[fan_control.c:273] 48
	[fan_control.c:273] 47
	[fan_control.c:273] 46
	[fan_control.c:273] 45
	[fan_control.c:273] 44
	[fan_control.c:273] 43
	[fan_control.c:273] 42
	[fan_control.c:273] 41
	[fan_control.c:273] 40
	[fan_control.c:273] 39
	[fan_control.c:273] 38
	[fan_control.c:273] 37
	[fan_control.c:273] 36
	[fan_control.c:273] 35
	[fan_control.c:273] 34
	[fan_control.c:273] 33
	[fan_control.c:273] 32
	[fan_control.c:273] 31
	[fan_control.c:273] 30
	[fan_control.c:273] 29
	[fan_control.c:273] 28
	[fan_control.c:273] 27
	[fan_control.c:273] 26
	[fan_control.c:273] 25
	[fan_control.c:273] 24
	[fan_control.c:273] 23
	[fan_control.c:273] 22
	[fan_control.c:273] 21
	[fan_control.c:273] 20
	[fan_control.c:273] 19
	[fan_control.c:273] 18
	[fan_control.c:273] 17
	[fan_control.c:273] 16
	[fan_control.c:273] 15
	[fan_control.c:273] 14
	[fan_control.c:273] 13
	[fan_control.c:273] 12
	[fan_control.c:273] 11
	[fan_control.c:273] 10
	[fan_control.c:273] 9
	[fan_control.c:273] 8
	[fan_control.c:273] 7
	[fan_control.c:273] 6
	[fan_control.c:273] 5
	[fan_control.c:273] 4
	[fan_control.c:273] 3
	[fan_control.c:273] 2
	[fan_control.c:273] 1

Processes:

# lsof /usr/sbin/fan_control
	COMMAND    PID USER  FD   TYPE DEVICE SIZE/OFF  NODE NAME
	fan_contr 2740 root txt    REG    7,0    20192 16618 /usr/local/modules/usrsbin/fan_control

# lsof -p 2740
	COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF  NODE NAME
	fan_contr 2740 root  cwd    DIR    0,1        0     1 /
	fan_contr 2740 root  rtd    DIR    0,1        0     1 /
	fan_contr 2740 root  txt    REG    7,0    20192 16618 /usr/local/modules/usrsbin/fan_control
	fan_contr 2740 root  mem    REG    0,1    31704  1230 /lib/librt-2.19.so
	fan_contr 2740 root  mem    REG    0,1    14664  1200 /lib/libdl-2.19.so
	fan_contr 2740 root  mem    REG    0,1   148342  1246 /lib/libpthread-2.19.so
	fan_contr 2740 root  mem    REG    0,1  1720792  1249 /lib/libc-2.19.so
	fan_contr 2740 root  mem    REG    0,1    70056  1224 /lib/libgcc_s.so.1
	fan_contr 2740 root  mem    REG    0,1  1050984  1223 /lib/libm-2.19.so
	fan_contr 2740 root  mem    REG    0,1   830424  1243 /lib/libstdc++.so.6.0.18
	fan_contr 2740 root  mem    REG    7,0    93680  6316 /usr/local/modules/opt/wd/lib/boost/libboost_thread.so.1.55.0
	fan_contr 2740 root  mem    REG    7,0    12384  6309 /usr/local/modules/opt/wd/lib/boost/libboost_system.so.1.55.0
	fan_contr 2740 root  mem    REG    7,0  1158232  6326 /usr/local/modules/opt/wd/lib/libthermal_service.so.1
	fan_contr 2740 root  mem    REG    7,0   970848  6331 /usr/local/modules/opt/wd/lib/libwdhw.so.1
	fan_contr 2740 root  mem    REG    7,0    10016 18064 /usr/local/modules/lib/libwdlog.so.1
	fan_contr 2740 root  mem    REG    7,0  1402312 17976 /usr/local/modules/lib/libxml2.so.2.7.4
	fan_contr 2740 root  mem    REG    7,0   289432  3337 /usr/local/modules/usrlib/libalert.so
	fan_contr 2740 root  mem    REG    7,0    53248  3333 /usr/local/modules/usrlib/libalpha_common.so
	fan_contr 2740 root  mem    REG    7,0    15464 18011 /usr/local/modules/lib/libxmldbc.so
	fan_contr 2740 root  mem    REG    0,1     8760  5490 /lib/libmipc.so
	fan_contr 2740 root  mem    REG    0,1    52984   760 /lib/libshare.so
	fan_contr 2740 root  mem    REG    0,1   136768  1196 /lib/ld-2.19.so
	fan_contr 2740 root    0r   CHR    1,3      0t0    56 /dev/null
	fan_contr 2740 root    1u   CHR    5,1      0t0  2134 /dev/console
	fan_contr 2740 root    2u   CHR    5,1      0t0  2134 /dev/console

Dependencies:

# ldd /usr/sbin/fan_control
        linux-vdso.so.1 (0x00007ffdaf3a2000)
        libshare.so => /lib64/libshare.so (0x00007ff20fe48000)
        libmipc.so => /lib64/libmipc.so (0x00007ff20fc46000)
        libxmldbc.so => /lib64/libxmldbc.so (0x00007ff20fa41000)
        libalpha_common.so => /lib64/libalpha_common.so (0x00007ff20f827000)
        libalert.so => /lib64/libalert.so (0x00007ff20f5e0000)
        libxml2.so.2 => /lib64/libxml2.so.2 (0x00007ff20f287000)
        libwdlog.so.1 => /lib64/libwdlog.so.1 (0x00007ff20f085000)
        libwdhw.so.1 => /opt/wd/lib/libwdhw.so.1 (0x00007ff20ed98000)
        libthermal_service.so.1 => /opt/wd/lib/libthermal_service.so.1 (0x00007ff20ea7c000)
        libboost_system.so.1.55.0 => /opt/wd/lib/boost/libboost_system.so.1.55.0 (0x00007ff20e879000)
        libboost_thread.so.1.55.0 => /opt/wd/lib/boost/libboost_thread.so.1.55.0 (0x00007ff20e662000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007ff20e382000)
        libm.so.6 => /lib64/libm.so.6 (0x00007ff20e081000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007ff20de70000)
        libc.so.6 => /lib64/libc.so.6 (0x00007ff20dac7000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ff20d8a9000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007ff20d6a5000)
        /lib64/ld-linux-x86-64.so.2 (0x00005580d05d6000)
        librt.so.1 => /lib64/librt.so.1 (0x00007ff20d49c000)

Dependencies (Verbose):

# ldd -v /usr/sbin/fan_control
        linux-vdso.so.1 (0x00007ffd4bfe2000)
        libshare.so => /lib64/libshare.so (0x00007f3eacb8a000)
        libmipc.so => /lib64/libmipc.so (0x00007f3eac988000)
        libxmldbc.so => /lib64/libxmldbc.so (0x00007f3eac783000)
        libalpha_common.so => /lib64/libalpha_common.so (0x00007f3eac569000)
        libalert.so => /lib64/libalert.so (0x00007f3eac322000)
        libxml2.so.2 => /lib64/libxml2.so.2 (0x00007f3eabfc9000)
        libwdlog.so.1 => /lib64/libwdlog.so.1 (0x00007f3eabdc7000)
        libwdhw.so.1 => /opt/wd/lib/libwdhw.so.1 (0x00007f3eabada000)
        libthermal_service.so.1 => /opt/wd/lib/libthermal_service.so.1 (0x00007f3eab7be000)
        libboost_system.so.1.55.0 => /opt/wd/lib/boost/libboost_system.so.1.55.0 (0x00007f3eab5bb000)
        libboost_thread.so.1.55.0 => /opt/wd/lib/boost/libboost_thread.so.1.55.0 (0x00007f3eab3a4000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f3eab0c4000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f3eaadc3000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f3eaabb2000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f3eaa809000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f3eaa5eb000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f3eaa3e7000)
        /lib64/ld-linux-x86-64.so.2 (0x00005612fef3c000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f3eaa1de000)

        Version information:
        /usr/sbin/fan_control:
                libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libshare.so:
                libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libmipc.so:
                libpthread.so.0 (GLIBC_2.2.5) => /lib64/libpthread.so.0
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libxmldbc.so:
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libalpha_common.so:
                libc.so.6 (GLIBC_2.7) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libalert.so:
                libxml2.so.2 (LIBXML2_2.6.0) => /lib64/libxml2.so.2
                libxml2.so.2 (LIBXML2_2.4.30) => /lib64/libxml2.so.2
                libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libxml2.so.2:
                libdl.so.2 (GLIBC_2.2.5) => /lib64/libdl.so.2
                libm.so.6 (GLIBC_2.2.5) => /lib64/libm.so.6
                libc.so.6 (GLIBC_2.7) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6
        /lib64/libwdlog.so.1:
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /opt/wd/lib/libwdhw.so.1:
                libgcc_s.so.1 (GCC_3.0) => /lib64/libgcc_s.so.1
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.8) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.9) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.7) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
                libpthread.so.0 (GLIBC_2.2.5) => /lib64/libpthread.so.0
                libpthread.so.0 (GLIBC_2.3.2) => /lib64/libpthread.so.0
                libstdc++.so.6 (GLIBCXX_3.4.5) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4.15) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4.18) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4.14) => /lib64/libstdc++.so.6
                libstdc++.so.6 (CXXABI_1.3) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4) => /lib64/libstdc++.so.6
        /opt/wd/lib/libthermal_service.so.1:
                libgcc_s.so.1 (GCC_3.0) => /lib64/libgcc_s.so.1
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.8) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.9) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.7) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
                libpthread.so.0 (GLIBC_2.2.5) => /lib64/libpthread.so.0
                libpthread.so.0 (GLIBC_2.3.2) => /lib64/libpthread.so.0
                libstdc++.so.6 (GLIBCXX_3.4.5) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4.15) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4.14) => /lib64/libstdc++.so.6
                libstdc++.so.6 (CXXABI_1.3) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4) => /lib64/libstdc++.so.6
        /opt/wd/lib/boost/libboost_system.so.1.55.0:
                libgcc_s.so.1 (GCC_3.0) => /lib64/libgcc_s.so.1
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
                libstdc++.so.6 (GLIBCXX_3.4) => /lib64/libstdc++.so.6
                libstdc++.so.6 (CXXABI_1.3) => /lib64/libstdc++.so.6
        /opt/wd/lib/boost/libboost_thread.so.1.55.0:
                librt.so.1 (GLIBC_2.2.5) => /lib64/librt.so.1
                libgcc_s.so.1 (GCC_3.0) => /lib64/libgcc_s.so.1
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
                libpthread.so.0 (GLIBC_2.3.2) => /lib64/libpthread.so.0
                libpthread.so.0 (GLIBC_2.2.5) => /lib64/libpthread.so.0
                libstdc++.so.6 (CXXABI_1.3) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4) => /lib64/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4.9) => /lib64/libstdc++.so.6
        /lib64/libstdc++.so.6:
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
                libm.so.6 (GLIBC_2.2.5) => /lib64/libm.so.6
                libgcc_s.so.1 (GCC_4.2.0) => /lib64/libgcc_s.so.1
                libgcc_s.so.1 (GCC_3.3) => /lib64/libgcc_s.so.1
                libgcc_s.so.1 (GCC_3.0) => /lib64/libgcc_s.so.1
                libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libm.so.6:
                libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libgcc_s.so.1:
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libc.so.6:
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
        /lib64/libpthread.so.0:
                ld-linux-x86-64.so.2 (GLIBC_2.2.5) => /lib64/ld-linux-x86-64.so.2
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6
                libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libdl.so.2:
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/librt.so.1:
                libpthread.so.0 (GLIBC_2.3.2) => /lib64/libpthread.so.0
                libpthread.so.0 (GLIBC_PRIVATE) => /lib64/libpthread.so.0
                libpthread.so.0 (GLIBC_2.2.5) => /lib64/libpthread.so.0
                libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6
                libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6

#84

Are you still using acpi_enforce_resource=lax as GRUB option? It helps detecting the sensors.


#85

I’ve been using it all along, but it has no effect.


#86

To dig deeper in the hardware, you might like this article: https://lwn.net/Articles/367630/
It explains how to decode the ACPI tables and even how to write a driver :slight_smile:
But some source code would be more helpful here. We shall see what the future brings.