From 44fe560f3be4993339918a71a81fc50e52c2731a Mon Sep 17 00:00:00 2001 From: Oron Peled Date: Tue, 28 Oct 2014 13:43:48 -0400 Subject: [PATCH] xpp/astribank_hook: remove Astribank initialization If this is the last seen Astribank Signed-off-by: Tzafrir Cohen --- xpp/astribank_hook | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xpp/astribank_hook b/xpp/astribank_hook index 59c79ea..05d1c17 100755 --- a/xpp/astribank_hook +++ b/xpp/astribank_hook @@ -172,6 +172,13 @@ old_synchronous_stop() { fi } +ab_list() { + find /sys/devices -name idVendor 2>/dev/null | \ + xargs grep -H 'e4e4' 2>/dev/null | \ + sed -e 's/idVendor.*/idProduct/' | xargs grep -H '11[3456]' | \ + sed 's,/[^/]*$,,' || : +} + tws_watchdog_enable() { devdir="/sys$DEVPATH" label=`cat "$devdir/label"` @@ -197,6 +204,11 @@ case "$ACTION" in add) ;; remove) + ab=`ab_list | wc -l` + if [ "$ab" -eq 0 ]; then + $LOGGER "$prefix: No more Astribanks -- remove astribank_is_starting semaphore" + astribank_is_starting -v -r 2>&1 | $LOGGER + fi ;; online) if can_full_async; then