Terastation Management

Aus MvOWiki
Wechseln zu: Navigation, Suche

Here are collected some information about Board Management Functions beside the main processor such as Fan controlling, Watchdog, LED switching, Power On/Off, Reboot, Flashing, UPS.

There are two different controllers on the board for these functions. See http://www.terastation.org/wiki/Hardware.

Monitoring Voltage, Temparature and Controlling Fan[Bearbeiten]

There is the SMSC EMC6D102-CZC controller on the board for voltage and temperature monitoring and fan controlling. This is a standard chip who is supported by the Linux 2.6 kernel and the lm-sensors package. Have a look at Terastation Sensors about this part of the board management.

AVR[Bearbeiten]

Second there is a programmable Microprocessor Motorola MC68HC908JL8. This processor is responsible for LEDs, power on, power off, watchdog, communication with UPS. The software running at this processor is not public available so far as I know. Software running on the main processor communicates over a serial line represented as ``/dev/ttyS1`` under Linux with that processor.

In the original firmware from Buffalo there are many programs and scripts communicating with the AVR over that serial line. There are some information about this protocol available in the net. But the protocol differs from box to box and from firmware version to firmware version. So these information are not really reliable.

To the good for some of the functionality of this management processor there is a command line interface available. It is a utility called miconapl. This tool is provided by Buffalo as part of the firmware. The information in this document is about the miconapl which is contained in official firmware from Buffalo version 2.05.

The license of the buffalo firmware does not allow that the binary is published here. That's why you have to use your own one.

To use some of the original tools from Buffalo they could be run in a chroot jail to not interfer with the clean Debian Etch Installation.

Here comes the content of the jail located under /var/lib/legacy_apps/. If the files are copied using cp -a they are getting all their original attributes (special files, links, owner, permission and so on).

 /var/lib/legacy_apps/
 /var/lib/legacy_apps/usr
 /var/lib/legacy_apps/usr/sbin
 /var/lib/legacy_apps/usr/sbin/mc_ctld
 /var/lib/legacy_apps/usr/sbin/diskmon
 /var/lib/legacy_apps/usr/sbin/ls_servd
 /var/lib/legacy_apps/usr/sbin/processmon
 /var/lib/legacy_apps/usr/local/sbin/miconapl
 /var/lib/legacy_apps/dev
 /var/lib/legacy_apps/dev/ttyS1
 /var/lib/legacy_apps/var
 /var/lib/legacy_apps/var/lock
 /var/lib/legacy_apps/var/lock/miconapl
 /var/lib/legacy_apps/etc
 /var/lib/legacy_apps/etc/mc_ctld.ini
 /var/lib/legacy_apps/etc/mtab
 /var/lib/legacy_apps/etc/melco
 /var/lib/legacy_apps/etc/melco/diskinfo
 /var/lib/legacy_apps/lib
 /var/lib/legacy_apps/lib/libc-2.3.2.so
 /var/lib/legacy_apps/lib/ld-2.3.2.so
 /var/lib/legacy_apps/lib/ld.so.1
 /var/lib/legacy_apps/lib/libc.so.6
 /var/lib/legacy_apps/lib/libcrypt.so.1
 /var/lib/legacy_apps/lib/libcrypt-2.3.2.so

Now there could be created a script in /usr/local/sbin/miconapl:

 #!/bin/sh
 
 /usr/sbin/chroot /var/lib/legacy_apps /usr/sbin/miconapl $*

Now it should work the same way like miconapl on the original firmware except that is moved to comply with Debian path guidelines to /usr/local/sbin/.

LED controlling[Bearbeiten]

There are many commands to control the LED in front of the TeraStation:

 /usr/local/sbin/miconapl -a ledusermode on
 /usr/local/sbin/miconapl -a ledenet 10|100|1000 on|off
 /usr/local/sbin/miconapl -a leddiag on|off
 /usr/local/sbin/miconapl -a ledpower green on|off|blink

Reboot the system[Bearbeiten]

Rebooting the system is quite simple:

/usr/local/sbin/miconapl -a reboot_start has to be executed just when the restart process starts. In the original firmware the call to this script is located in a script in /etc/init.d/ which is the first script to be executed in runlevel 6 (reboot).

So we create a script /etc/init.d/tera_reboot with the following content:

 #!/bin/sh
 
 stop() {
   /usr/local/sbin/miconapl -a reboot_start
 }
 
 case "$1" in
 
   stop)
     stop
     ;;
   *)
     echo "Only command 'stop' supported."
     exit 1
     ;;
 esac

Now create the link for the run level 6:

 ts1:~# update-rc.d tera_reboot stop 10 6 .