diff options
| author | Slávek Banko <slavek.banko@axis.cz> | 2021-09-02 11:32:09 +0200 |
|---|---|---|
| committer | Slávek Banko <slavek.banko@axis.cz> | 2021-09-05 11:58:01 +0200 |
| commit | 3eb77b4fcaf2284e9711d6fbe757b4f882cd7c4d (patch) | |
| tree | 22536b2fd90020f93477518dbd5a124ac27a5d4e /usr/bin/cryptosmartcard.sh | |
| parent | 64a75f83cd2c6897bcc7b335c3570a6a7845b3b9 (diff) | |
| download | smartcardauth-3eb77b4fcaf2284e9711d6fbe757b4f882cd7c4d.tar.gz smartcardauth-3eb77b4fcaf2284e9711d6fbe757b4f882cd7c4d.zip | |
Improve processing of multiarch libraries location in scripts.
Initramfs hook instead of a fixed list of libraries, it processes dependent
libraries by using copy_exec function. This also ensure the copy of the
symlinks and maintaining the original paths by multiarch location.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'usr/bin/cryptosmartcard.sh')
| -rwxr-xr-x | usr/bin/cryptosmartcard.sh | 28 |
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] |
