summaryrefslogtreecommitdiff
path: root/openwrt
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2009-11-17 15:35:15 (GMT)
committerChristian Pointner <equinox@helsinki.at>2009-11-17 15:35:15 (GMT)
commitb1ae0fb1e45f4d6cc79200b30b18a7aac0f9b7de (patch)
tree69ed56187e94ca1ecd2cef2a082aef769dc05eac /openwrt
parent0e5843d0ab4bed1a8bf9afb11834b4cc71d11adf (diff)
added dependency to udev and init script for it
removed dependency to socat (not working anyway) some fixes at openwrt package
Diffstat (limited to 'openwrt')
-rw-r--r--openwrt/rhctl/Makefile9
-rw-r--r--openwrt/rhctl/files/rhctl.config12
-rw-r--r--openwrt/rhctl/files/serialclient.init18
-rwxr-xr-xopenwrt/rhctl/files/switchctl.init8
-rw-r--r--openwrt/rhctl/files/udev.init25
-rw-r--r--openwrt/rhctl/files/udev.rules7
6 files changed, 62 insertions, 17 deletions
diff --git a/openwrt/rhctl/Makefile b/openwrt/rhctl/Makefile
index 80430cf..4b55152 100644
--- a/openwrt/rhctl/Makefile
+++ b/openwrt/rhctl/Makefile
@@ -13,12 +13,12 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=rhctl
PKG_VERSION:=0.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://localhost/
-PKG_MD5SUM:=2e5fb8d8a6b075bcc8dde214a6d924e5
+PKG_MD5SUM:=8d693d1d4431eeeac383d5fde17c068f
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
@@ -30,7 +30,7 @@ define Package/rhctl
TITLE:=Radio Helsinki control tools
URL:=http://www.helsinki.at
MAINTAINER:=Christian Pointner <equinox@helsinki.at>
- DEPENDS:=+socat
+ DEPENDS:=+udev
endef
define Package/rhctl/conffiles
@@ -71,8 +71,11 @@ define Package/rhctl/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/serialclient $(1)/usr/bin/
$(INSTALL_BIN) ./files/rhctlsh $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/udev.init $(1)/etc/init.d/udev
$(INSTALL_BIN) ./files/switchctl.init $(1)/etc/init.d/switchctl
$(INSTALL_BIN) ./files/serialclient.init $(1)/etc/init.d/serialclient
+ $(INSTALL_DIR) $(1)/etc/udev/rules.d
+ $(INSTALL_DATA) ./files/udev.rules $(1)/etc/udev/rules.d/50-rhctl.rules
endef
$(eval $(call BuildPackage,rhctl))
diff --git a/openwrt/rhctl/files/rhctl.config b/openwrt/rhctl/files/rhctl.config
index 79f5ce3..1b14f04 100644
--- a/openwrt/rhctl/files/rhctl.config
+++ b/openwrt/rhctl/files/rhctl.config
@@ -1,7 +1,7 @@
config 'switchctl'
option command_sock '/var/run/rhctl/switchctl.sock'
option baudrate '19200'
- option device '/dev/audioswatch'
+ option device '/dev/audioswitch'
option config '/etc/rhctl/switchctl.conf'
option mode 'master'
option channel 'main'
@@ -12,7 +12,7 @@ config 'serialclient'
option log 'syslog:3,serialclient-master,daemon'
option command_sock '/var/run/rhctl/switchctl.sock'
option baudrate '38400'
- option device '/dev/ttyUSB0'
+ option device '/dev/ttyMaster'
option type 'master'
config 'serialclient'
@@ -21,5 +21,11 @@ config 'serialclient'
option log 'syslog:3,serialclient-standby,daemon'
option command_sock '/var/run/rhctl/switchctl.sock'
option baudrate '38400'
- option device '/dev/ttyUSB1'
+ option device '/dev/ttyStandby'
option type 'standby'
+
+config 'heartbeatclient'
+ option disabled 1
+ option command_sock '/var/run/rhctl/switchctl.sock'
+ option baudrate '38400'
+ option device '/dev/ttyHeartbeat'
diff --git a/openwrt/rhctl/files/serialclient.init b/openwrt/rhctl/files/serialclient.init
index d869d25..39665b2 100644
--- a/openwrt/rhctl/files/serialclient.init
+++ b/openwrt/rhctl/files/serialclient.init
@@ -17,7 +17,7 @@ option_cb() {
}
foreach_config_forced() {
- foreach_config $1 "forced"
+ foreach_config $1 "$2" "forced"
}
foreach_config() {
@@ -28,16 +28,20 @@ foreach_config() {
local args=""
local forced=0
- if [ -n "$2" ] && [ "x$2" == "xforced" ]; then
+ config_get name "$cfg" "name"
+ if [ -n "$2" ] && [ "x$2" != "x$name" ]; then
+ return
+ fi
+
+ if [ -n "$3" ] && [ "x$3" == "xforced" ]; then
forced=1
fi
- config_get name "serialclient" "name"
for option in $CONFIG_OPTIONS
do
- config_get value "serialclient" "$option"
+ config_get value "$cfg" "$option"
if [ "x$option" == "xdisabled" ]; then
- if [ $forced -eq 0 ] && [ $value -eq 1 ]; then
+ if [ $forced -eq 0 ] && [ -n "$value" ] && [ $value -eq 1 ]; then
echo -n " $name(disabled)"
return
fi
@@ -78,11 +82,11 @@ start() {
config_load "rhctl"
if [ $# -gt 0 ]; then
while [ $# -gt 0 ]; do
- config_foreach foreach_config_forced "$1"
+ config_foreach foreach_config_forced "serialclient" "$1"
shift
done
else
- config_foreach foreach_config ""
+ config_foreach foreach_config "serialclient"
fi
echo "."
}
diff --git a/openwrt/rhctl/files/switchctl.init b/openwrt/rhctl/files/switchctl.init
index c947e40..24ed62f 100755
--- a/openwrt/rhctl/files/switchctl.init
+++ b/openwrt/rhctl/files/switchctl.init
@@ -24,7 +24,7 @@ start_daemon() {
for option in $CONFIG_OPTIONS
do
- config_get value "switchctl" "$option"
+ config_get value "$1" "$option"
option=`echo $option | tr '_' '-'`
if [ -n "$value" ]; then
args="$args --$option $value"
@@ -32,7 +32,7 @@ start_daemon() {
done
local status="OK"
$DAEMON --write-pid $PIDFILE $args || status="failed"
- echo -n "($status)"
+ echo -n " ($status)"
}
start() {
@@ -48,9 +48,9 @@ stop() {
if [ -f $PIDFILE ]; then
kill `cat $PIDFILE` > /dev/null 2>&1
rm -f $PIDFILE > /dev/null 2>&1
- echo -n " Ok"
+ echo -n " (Ok)"
else
- echo -n " not running"
+ echo -n " (not running)"
fi
echo "."
}
diff --git a/openwrt/rhctl/files/udev.init b/openwrt/rhctl/files/udev.init
new file mode 100644
index 0000000..76796fe
--- /dev/null
+++ b/openwrt/rhctl/files/udev.init
@@ -0,0 +1,25 @@
+#!/bin/sh /etc/rc.common
+START=69
+
+BIN=udevd
+DAEMON=/sbin/$BIN
+TRIGGER=/sbin/udevtrigger
+SETTLE=/sbin/udevsettle
+OPTIONS="--daemon"
+DESC=$BIN
+
+start() {
+ echo -n "Starting $DESC:"
+ $DAEMON $OPTIONS
+ echo -n " triggering .. "
+ $TRIGGER
+ echo -n " wait for settle"
+ $SETTLE
+ echo " ."
+}
+
+stop() {
+ echo -n "Stopping $DESC:"
+ killall $BIN
+ echo " ."
+}
diff --git a/openwrt/rhctl/files/udev.rules b/openwrt/rhctl/files/udev.rules
new file mode 100644
index 0000000..1723ace
--- /dev/null
+++ b/openwrt/rhctl/files/udev.rules
@@ -0,0 +1,7 @@
+# rhctl usb-serial rules
+#
+
+SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{serial}=="ftE2BB18", SYMLINK+="ttyMaster"
+SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{serial}=="ftE2BI9E", SYMLINK+="ttyHeartbeat"
+SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{serial}=="ftE27L3P", SYMLINK+="ttyStandby"
+SUBSYSTEMS=="usb-serial", KERNELS=="ttyUSB*", DRIVERS=="pl2303", SYMLINK+="audioswitch"