embedded_load_hw_scripts() { embd_type= case $EMBEDDED_TYPE in pc|sim) embd_type="-t $EMBEDDED_TYPE" ;; *) file=/etc/boot.d/${EMBEDDED_TYPE}-hw if [ -f $file ]; then . $file else log_error "missing driver file $file" fi ;; esac } i2c_load_drivers() { log_error "please provide a function loading i2c drivers for type '$EMBEDDED_TYPE'" } embd_load_drivers() { echo "no embd drivers to load for type '$EMBEDDED_TYPE'" } watchdogd_load_drivers() { log_error "please provide a function loading watchdog drivers for type '$EMBEDDED_TYPE'" } embd_start_daemon() { case $EMBEDDED_DAEMON in yes) : ${EMBEDDED_BUTTON_ACTION:=none} : ${EMBEDDED_BUTTON_SCRIPT:=/usr/bin/embedded_keyprog} if embd_load_drivers; then /usr/bin/embd $embd_type "$EMBEDDED_BUTTON_SCRIPT" "$EMBEDDED_BUTTON_ACTION" echo "LED1 blink" > /var/run/embedded.fifo else log_error "failed to load hardware support for embd, skipping embd invocation" fi ;; esac } watchdogd_start_daemon() { case $EMBEDDED_WATCHDOG in yes) if watchdogd_load_drivers; then 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 fi fi else log_error "failed to load hardware support for watchdogd, skipping watchdogd invocation" fi ;; esac }