/lib/udev/entropykey.sh is in ekeyd 1.1.5-6.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #!/bin/sh
#
# Entropy key udev helper, ensures ekeyd is updated with new devices
#
# Copyright 2009-2011 Simtec Electronics
#
# For licence terms refer to the COPYING file.
BINPATH=/usr/sbin
# This function waits for the USB dev nodes to be made before
# attempting to allow the ULUSBD to attach, this might resolve
# a race condition where udev runs us before the nodes are
# available.
wait_for_usb () {
COUNTER=0
while ! test -e /dev/bus/usb/${BUSNUM}/${DEVNUM}; do
sleep 1
COUNTER=$(( ${COUNTER} + 1 ))
test ${COUNTER} -ge 10 && exit 1
done
$BINPATH/ekey-ulusbd -b${BUSNUM} -d${DEVNUM} -P/var/run/ekey-ulusbd-${ENTROPY_KEY_SERIAL}.pid -p/var/run/entropykeys/${ENTROPY_KEY_SERIAL} -D
sleep 1
$BINPATH/ekeydctl ${ACTION} /var/run/entropykeys/${ENTROPY_KEY_SERIAL}
exit 0
}
if test "x$SUBSYSTEM" = "xtty"; then
# Update ekeyd with device operation
$BINPATH/ekeydctl ${ACTION} /dev/entropykey/${ENTROPY_KEY_SERIAL}
else
if test "x$ACTION" = "xadd"; then
# start userland USB connection daemon
if test "x${BUSNUM}" = "x" -o "x${DEVNUM}" = "x"; then
exit 0
fi
if test -r "/var/run/ekey-ulusbd-${ENTROPY_KEY_SERIAL}.pid"; then
kill $(cat "/var/run/ekey-ulusbd-${ENTROPY_KEY_SERIAL}.pid") || true
fi
mkdir -p /var/run/entropykeys
wait_for_usb &
exit 0
fi
# Update ekeyd with device operation
$BINPATH/ekeydctl ${ACTION} /var/run/entropykeys/${ENTROPY_KEY_SERIAL}
if test "x$ACTION" = "xremove"; then
rm "/var/run/ekey-ulusbd-${ENTROPYKEY_KEY_SERIAL}.pid"
rm "/var/run/entropykeys/${ENTROPYKEY_KEY_SERIAL}"
fi
fi
exit 0
|