#------------------------------------------------------------------------------ # /etc/rc.d/rc002.hwsupp __FLI4LVER__ # # Creation: 2009-08-07 babel # Last Update: $Id$ #------------------------------------------------------------------------------ if [ "$OPT_HWSUPP" = "yes" ] then begin_script HWSUPP "starting hardware support for $HWSUPP_TYPE" # the hardware support type for pc and sim is not set via rc001.* script, do it now [ "$HWSUPP_TYPE" = "pc" ] && hwsupp_type="-t pc" [ "$HWSUPP_TYPE" = "sim" ] && hwsupp_type="-t sim" if [ "$HWSUPP_WATCHDOG" = "yes" -a -z "`ps | grep watchdogd | grep -v grep`" ] then log_info "starting watchdog daemon ..." # start watchdog daemon, required modules are loaded via rc001.* scripts if [ -c /dev/watchdog ] then watchdogd -d /dev/watchdog -r 20 -t 1 else if [ -c /dev/geode-watchdog ] then watchdogd -d /dev/geode-watchdog -r 20 -t 1 else log_error "cannot find watchdog-device" fi fi fi if [ "$HWSUPP_DAEMON" = "yes" ] then log_info "starting hardware support daemon ..." : ${HWSUPP_BUTTON_ACTION:=none} : ${HWSUPP_BUTTON_SCRIPT:=/usr/bin/hwsupp_keyprog} hwsuppd $hwsupp_type "$HWSUPP_BUTTON_SCRIPT" "$HWSUPP_BUTTON_ACTION" echo "LED2 blink" > /var/run/embedded.fifo { echo "hwsupp_type='$HWSUPP_TYPE'" echo "hwsupp_led_n='$HWSUPP_LED_N'" [ 0$HWSUPP_LED_N -eq 0 ] || for i in `seq 1 $HWSUPP_LED_N` do eval 'action=$HWSUPP_LED_'$i case $action in ready) echo "hwsupp_ready_led='LED$i'" ;; wlan) echo "hwsupp_wlan_led='LED$i'" echo "hwsupp_wlan_dev='$HWSUPP_WLAN_DEV'" ;; online) echo "hwsupp_online_led='LED$i'" ;; user) echo "hwsupp_user_led='LED$i'" echo "hwsupp_user_script='$HWSUPP_USER_SCRIPT'" ;; esac done } > /var/run/hwsupp.conf fi # add hardware support menu to httpd # we only need to check if the file is here, since an ext # script adds this file only if httpd is active if [ -e /srv/www/admin/hwsupp.cgi ] then log_info "add menu entry for hardware \"$HWSUPP_TYPE\" to webgui" httpd-menu.sh add -p 600 hwsupp.cgi "${HWSUPP_TYPE}" "" ${HWSUPP_TYPE} fi # start sensors with -s to allow settings like "set in0_max 5 * 0.95" to work sensors -s 2>&1 > /dev/null if [ -c /dev/hw_random -a -x /usr/sbin/rngd -a -z "`ps | grep rngd | grep -v grep`" ] then /usr/sbin/rngd -t 1 -r /dev/hw_random fi end_script fi