diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2008-10-16 18:03:47 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2008-10-16 18:03:47 +0000 |
commit | f48e3505473b9be26fa6d71c8437a87abde608f1 (patch) | |
tree | 5de89f01c6b0882b780447501327cd052cf6da31 /xpp/waitfor_xpds | |
parent | eb21b700dd088304d1d9da2a657d4665ca655e23 (diff) |
xpp: userspace support for sysfx migration.
The userspace side of dahdi-linux r5097.
* Perl modules default to using xpp sysfs but will fallback (with warning)
to procfs interface.
* An additional /usr/share/dahdi/waitfor_xpds to replace the line in the
init.d script.
git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@5099 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'xpp/waitfor_xpds')
-rwxr-xr-x | xpp/waitfor_xpds | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/xpp/waitfor_xpds b/xpp/waitfor_xpds new file mode 100755 index 0000000..0108b1b --- /dev/null +++ b/xpp/waitfor_xpds @@ -0,0 +1,31 @@ +#! /bin/sh + +set -e + +ab_list() { + ab=`find /sys/bus/astribanks/devices/xbus-*/ -name waitfor_xpds 2> /dev/null || :` + if [ "$ab" = "" ]; then + ab=`find /proc/xpp/XBUS-[0-9]*/ -name waitfor_xpds 2> /dev/null || :` + procfiles=1 + fi + if [ "$ab" = "" ]; then + echo 1>&2 "$0: No XBUSES to wait for. Aborting..." + exit 1 + fi + if [ -n "$procfiles" ]; then + echo 1>&2 "$0: No /sys attributes, fallback to /proc interface..." + fi + echo $ab +} + + +while + if ! ab=`ab_list`; then + exit 1 + fi + test "$oldab" != "$ab" +do + oldab="$ab" + echo 1>&2 "Waiting for XPDS" + cat $ab +done |