diff options
| author | Ovidiu Panait <ovidiu.panait@windriver.com> | 2020-09-25 13:13:19 +0300 |
|---|---|---|
| committer | Jia Zhang <zhang.jia@linux.alibaba.com> | 2020-10-19 19:32:49 +0800 |
| commit | a32ddd2b2a51b26c011fa50e441df39304651503 (patch) | |
| tree | b34c3a53f36fb308031d61dd095753507a941995 | |
| parent | 696ee1495caa0e1a52a0c212cbdf8d6bb206d9a1 (diff) | |
| download | meta-secure-core-a32ddd2b2a51b26c011fa50e441df39304651503.tar.gz | |
check_gpg_key: Fix gpg-agent.conf creation race condition
If GPG_PATH is already created by signing-keys do_get_public_keys task,
subsequent executions of do_package_write_rpm will not create the
gpg-agent.conf file anymore.
Therefore, the spawned gpg-agent will miss important features such as
auto-expand-secmem, leading to the following intermittent build errors:
....
Subprocess output:
gpg: signing failed: Cannot allocate memory
gpg: signing failed: Cannot allocate memory
error: gpg exec failed (2)
gpg: signing failed: Cannot allocate memory
gpg: signing failed: Cannot allocate memory
error: gpg exec failed (2)
...
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
| -rw-r--r-- | meta-signing-key/classes/user-key-store.bbclass | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/meta-signing-key/classes/user-key-store.bbclass b/meta-signing-key/classes/user-key-store.bbclass index 960bde6..5bc650f 100644 --- a/meta-signing-key/classes/user-key-store.bbclass +++ b/meta-signing-key/classes/user-key-store.bbclass | |||
| @@ -477,7 +477,10 @@ def check_gpg_key(basekeyname, keydirfunc, d): | |||
| 477 | status, output = oe.utils.getstatusoutput('mkdir -m 0700 -p %s' % gpg_path) | 477 | status, output = oe.utils.getstatusoutput('mkdir -m 0700 -p %s' % gpg_path) |
| 478 | if status: | 478 | if status: |
| 479 | bb.fatal('Failed to create gpg keying %s: %s' % (gpg_path, output)) | 479 | bb.fatal('Failed to create gpg keying %s: %s' % (gpg_path, output)) |
| 480 | f = open(os.path.join(gpg_path, 'gpg-agent.conf'), 'w') | 480 | |
| 481 | gpg_conf = os.path.join(gpg_path, 'gpg-agent.conf') | ||
| 482 | if not os.path.exists(gpg_conf): | ||
| 483 | f = open(gpg_conf, 'w') | ||
| 481 | f.write('allow-loopback-pinentry\n') | 484 | f.write('allow-loopback-pinentry\n') |
| 482 | f.write('auto-expand-secmem\n') | 485 | f.write('auto-expand-secmem\n') |
| 483 | f.close() | 486 | f.close() |
