* app-crypt/ekeyd: Add
[portage-overlay.git] / app-crypt / ekeyd / files / ekeyd-3.patch
1 # HG changeset patch
2 # User kristianf
3 # Date 1382917171 -3600
4 #      Mon Oct 28 00:39:31 2013 +0100
5 # Node ID d96c42b36cb125e6e52cff623b7bdad1910284b4
6 # Parent  0a9e41a05aafb98cc8c21562931cb1cbb5e30c1f
7 entropykey.sh
8
9 diff -r 0a9e41a05aaf -r d96c42b36cb1 udev/entropykey.sh
10 --- a/udev/entropykey.sh        Mon Oct 28 00:35:46 2013 +0100
11 +++ b/udev/entropykey.sh        Mon Oct 28 00:39:31 2013 +0100
12 @@ -19,9 +19,10 @@
13      COUNTER=$(( ${COUNTER} + 1 ))
14      test ${COUNTER} -ge 10 && exit 1
15    done
16 -  $BINPATH/ekey-ulusbd -b${BUSNUM} -d${DEVNUM} -P/var/run/ekey-ulusbd-${ENTROPY_KEY_SERIAL}.pid -p/var/run/entropykeys/${ENTROPY_KEY_SERIAL} -D
17 +  /usr/libexec/ekey-ulusbd -b${BUSNUM} -d${DEVNUM} -P/dev/.ekey-ulusbd/${ENTROPY_KEY_SERIAL}.pid -p/dev/entropykey/${ENTROPY_KEY_SERIAL} -D
18 +
19    sleep 1
20 -  $BINPATH/ekeydctl ${ACTION} /var/run/entropykeys/${ENTROPY_KEY_SERIAL}
21 +  $BINPATH/ekeydctl ${ACTION} /dev/entropykey/${ENTROPY_KEY_SERIAL}
22    exit 0
23  }
24  
25 @@ -34,18 +35,18 @@
26      if test "x${BUSNUM}" = "x" -o "x${DEVNUM}" = "x"; then
27        exit 0
28      fi
29 -    if test -r "/var/run/ekey-ulusbd-${ENTROPY_KEY_SERIAL}.pid"; then
30 -      kill $(cat "/var/run/ekey-ulusbd-${ENTROPY_KEY_SERIAL}.pid") || true
31 +    if test -r "/dev/.ekey-ulusbd/${ENTROPY_KEY_SERIAL}.pid"; then
32 +      kill $(< "/dev/.ekey-ulusbd/${ENTROPY_KEY_SERIAL}.pid") || true
33      fi
34 -    mkdir -p /var/run/entropykeys
35 +    mkdir -p /dev/entropykey /dev/.ekeyd-ulusb
36      wait_for_usb &
37      exit 0
38    fi
39    # Update ekeyd with device operation
40 -  $BINPATH/ekeydctl ${ACTION} /var/run/entropykeys/${ENTROPY_KEY_SERIAL}
41 +  $BINPATH/ekeydctl ${ACTION} /dev/entropykey/${ENTROPY_KEY_SERIAL}
42    if test "x$ACTION" = "xremove"; then
43 -    rm "/var/run/ekey-ulusbd-${ENTROPYKEY_KEY_SERIAL}.pid"
44 -    rm "/var/run/entropykeys/${ENTROPYKEY_KEY_SERIAL}"
45 +    rm "/dev/.ekey-ulusbd/${ENTROPYKEY_KEY_SERIAL}.pid"
46 +    rm "/dev/entropykey/${ENTROPYKEY_KEY_SERIAL}"
47    fi
48  fi
49