From: Harald Hoyer Date: Wed, 12 May 2021 14:48:52 +0000 (+0200) Subject: fix(crypt-gpg): cope with different scdaemon location X-Git-Tag: 054~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=44fd1c13555f2e12bb566c246948629ada27d14d;p=thirdparty%2Fdracut.git fix(crypt-gpg): cope with different scdaemon location On Arch things are different for some reason. --- diff --git a/modules.d/91crypt-gpg/module-setup.sh b/modules.d/91crypt-gpg/module-setup.sh index 4d33df175..634a5149f 100755 --- a/modules.d/91crypt-gpg/module-setup.sh +++ b/modules.d/91crypt-gpg/module-setup.sh @@ -29,7 +29,7 @@ install() { if sc_requested; then inst_multiple gpg-agent inst_multiple gpg-connect-agent - inst_multiple /usr/libexec/scdaemon + inst_multiple -o /usr/libexec/scdaemon /usr/lib/gnupg/scdaemon cp "$dracutsysrootdir$(sc_public_key)" "${initdir}/root/" fi } @@ -42,14 +42,22 @@ sc_public_key() { sc_supported() { local gpgMajor local gpgMinor + local scdaemon gpgMajor="$(gpg --version | sed -n 1p | sed -n -r -e 's|.* ([0-9]*).*|\1|p')" gpgMinor="$(gpg --version | sed -n 1p | sed -n -r -e 's|.* [0-9]*\.([0-9]*).*|\1|p')" + if [[ -x "$dracutsysrootdir"/usr/libexec/scdaemon ]]; then + scdaemon=/usr/libexec/scdaemon + elif [[ -x "$dracutsysrootdir"/usr/lib/gnupg/scdaemon ]]; then + scdaemon=/usr/lib/gnupg/scdaemon + else + return 1 + fi + if [[ ${gpgMajor} -gt 2 || ${gpgMajor} -eq 2 && ${gpgMinor} -ge 1 ]] \ && require_binaries gpg-agent \ && require_binaries gpg-connect-agent \ - && require_binaries /usr/libexec/scdaemon \ - && ($DRACUT_LDD "$dracutsysrootdir"/usr/libexec/scdaemon | grep libusb > /dev/null); then + && ($DRACUT_LDD "${dracutsysrootdir}${scdaemon}" | grep libusb > /dev/null); then return 0 else return 1