summaryrefslogtreecommitdiffstats
path: root/usr/bin/cryptosmartcard.sh
diff options
context:
space:
mode:
Diffstat (limited to 'usr/bin/cryptosmartcard.sh')
-rwxr-xr-xusr/bin/cryptosmartcard.sh28
1 files changed, 27 insertions, 1 deletions
diff --git a/usr/bin/cryptosmartcard.sh b/usr/bin/cryptosmartcard.sh
index c6cd7fc..25f8d6e 100755
--- a/usr/bin/cryptosmartcard.sh
+++ b/usr/bin/cryptosmartcard.sh
@@ -43,8 +43,34 @@ fi
# Find plymouth
PLYDIR=/bin/plymouth
+# Determine multiarch directory
+ARCHDIR=$(ldd $SHELL | grep libc\.so |\
+ sed -e "s|^.*=> \(.*\)/[^/]*$|\1|" -e "s|^/usr||" -e "s|^/||")
+if [ -z "$ARCHDIR" ] && [ -n "$HOSTTYPE" ] && [ -n "$OSTYPE" ]; then
+ ARCHDIR=$HOSTTYPE-$OSTYPE
+fi
+if [ -z "$ARCHDIR" ]; then
+ ARCHDIR=$(uname -i)
+ if [ "$ARCHDIR" = "unknown" ]; then
+ ARCHDIR=$(uname -m)
+ fi
+ if [ "$ARCHDIR" = "ppc64le" ]; then
+ ARCHDIR="powerpc64"
+ fi
+ if [ "$ARCHDIR" = "ppc64el" ]; then
+ ARCHDIR="powerpc64"
+ fi
+ ARCHDIR="*${ARCHDIR}*"
+fi
+
# Set system PKCS library path
-SYSTEM_PKCS_LIBRARY=/usr/lib/opensc-pkcs11.so
+SYSTEM_PKCS_LIBRARY=opensc-pkcs11.so
+for x in /${ARCHDIR} /lib /usr/${ARCHDIR} /usr/lib; do
+ if [ -e $x/$SYSTEM_PKCS_LIBRARY ]; then
+ SYSTEM_PKCS_LIBRARY=$(echo $x/$SYSTEM_PKCS_LIBRARY)
+ break
+ fi
+done
# print message to usplash or stderr
# usage: msg <command> "message" [switch]