diff options
author | De Huo <De.Huo@windriver.com> | 2020-04-15 18:06:39 +0800 |
---|---|---|
committer | Jia Zhang <zhang.jia@linux.alibaba.com> | 2020-04-16 20:22:56 +0800 |
commit | 33d90d92b0df5f0d52186d267368ab146d771564 (patch) | |
tree | 343895547e5bda84284e695111c7f9c7ef83da3a | |
parent | 88347534070cbce5f5260c0d0d49f12d991ff452 (diff) | |
download | meta-secure-core-33d90d92b0df5f0d52186d267368ab146d771564.tar.gz |
create-user-key-store.sh: Fix defect about invalid option "--pinentry-mode=loopback"
The option --pinentry-mode is not supported in gpg 2.0.22 code.
so when the host gpg version is 2.0.22 the option will be removed.
Start gpg-agent daemon when gpg-connect-agent reload agent failed.
Otherwise there will be below failure message reported.
gpg: can't connect to the agent - trying fall back
gpg: can't connect to the agent: IPC connect call failed
gpg: problem with the agent: No agent running
Signed-off-by: De Huo <De.Huo@windriver.com>
-rwxr-xr-x | meta-signing-key/scripts/create-user-key-store.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/meta-signing-key/scripts/create-user-key-store.sh b/meta-signing-key/scripts/create-user-key-store.sh index bf979c7..a63f50e 100755 --- a/meta-signing-key/scripts/create-user-key-store.sh +++ b/meta-signing-key/scripts/create-user-key-store.sh | |||
@@ -340,9 +340,15 @@ EOF | |||
340 | 340 | ||
341 | pinentry="" | 341 | pinentry="" |
342 | if [ "$gpg_ver" = "2" ] ; then | 342 | if [ "$gpg_ver" = "2" ] ; then |
343 | pinentry="--pinentry-mode=loopback" | 343 | gpg_ver_whole=`gpg --version | head -1 | awk '{ print $3 }'` |
344 | echo "allow-loopback-pinentry" > $key_dir/gpg-agent.conf | 344 | if [ "$gpg_ver_whole" != "2.0.22" ] ; then |
345 | pinentry="--pinentry-mode=loopback" | ||
346 | echo "allow-loopback-pinentry" > $key_dir/gpg-agent.conf | ||
347 | fi | ||
345 | gpg-connect-agent --homedir "$key_dir" reloadagent /bye | 348 | gpg-connect-agent --homedir "$key_dir" reloadagent /bye |
349 | if [ $? != 0 ] ; then | ||
350 | gpg-agent --homedir "$key_dir" --daemon | ||
351 | fi | ||
346 | fi | 352 | fi |
347 | $GPG_BIN --homedir "$key_dir" --batch --yes --gen-key "$key_dir/gen_keyring" | 353 | $GPG_BIN --homedir "$key_dir" --batch --yes --gen-key "$key_dir/gen_keyring" |
348 | if [ $? != 0 ] ; then | 354 | if [ $? != 0 ] ; then |