xpp/astribank_hook: remove Astribank initialization

If this is the last seen Astribank

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
This commit is contained in:
Oron Peled 2014-10-28 13:43:48 -04:00 committed by Tzafrir Cohen
parent 1a78b71fac
commit 44fe560f3b
1 changed files with 12 additions and 0 deletions

View File

@ -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