* [PATCH] isar-bootstrap: Remove GNUPGHOME sharing
@ 2021-10-14 14:44 Anton Mikanovich
2021-10-22 14:59 ` Anton Mikanovich
0 siblings, 1 reply; 2+ messages in thread
From: Anton Mikanovich @ 2021-10-14 14:44 UTC (permalink / raw)
To: isar-users; +Cc: Anton Mikanovich
From: Anton Mikanovich <amikan@ilbers.de>
Run every gpg-agent in separate GNUPGHOME to get rid of any conflicts
in case of multiple keys defined in THIRD_PARTY_APT_KEYS.
Fix issue #73
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index b8af6760..08b1486b 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -331,23 +331,22 @@ do_bootstrap() {
mkdir -p "${ROOTFSDIR}/etc/apt/apt.conf.d"
install -v -m644 "${WORKDIR}/isar-apt.conf" \
"${ROOTFSDIR}/etc/apt/apt.conf.d/50isar.conf"
- if [ -n "${@get_distro_needs_gpg_support(d)}" ]; then
+ find ${APT_KEYS_DIR}/ -type f | while read keyfile
+ do
MY_GPGHOME="$(chroot "${ROOTFSDIR}" mktemp -d /tmp/gpghomeXXXXXXXXXX)"
echo "Created temporary directory ${MY_GPGHOME} for gpg-agent"
export GNUPGHOME="${MY_GPGHOME}"
APT_KEY_APPEND="--homedir ${MY_GPGHOME}"
- fi
- find ${APT_KEYS_DIR}/ -type f | while read keyfile
- do
+
kfn="$(basename $keyfile)"
cp $keyfile "${ROOTFSDIR}/tmp/$kfn"
chroot "${ROOTFSDIR}" /usr/bin/gpg-agent --daemon -- /usr/bin/apt-key \
--keyring ${THIRD_PARTY_APT_KEYRING} ${APT_KEY_APPEND} add "/tmp/$kfn"
rm "${ROOTFSDIR}/tmp/$kfn"
- done
- if [ -n "${MY_GPGHOME}" ]; then
+
+ echo "Removing ${MY_GPGHOME}"
rm -rf "${ROOTFSDIR}${MY_GPGHOME}"
- fi
+ done
if [ "${@get_distro_suite(d)}" = "stretch" ] && [ "${@get_host_release().split('.')[0]}" -lt "4" ]; then
install -v -m644 "${WORKDIR}/isar-apt-fallback.conf" \
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] isar-bootstrap: Remove GNUPGHOME sharing
2021-10-14 14:44 [PATCH] isar-bootstrap: Remove GNUPGHOME sharing Anton Mikanovich
@ 2021-10-22 14:59 ` Anton Mikanovich
0 siblings, 0 replies; 2+ messages in thread
From: Anton Mikanovich @ 2021-10-22 14:59 UTC (permalink / raw)
To: isar-users
On 14.10.21 17:44, Anton Mikanovich wrote:
> From: Anton Mikanovich <amikan@ilbers.de>
>
> Run every gpg-agent in separate GNUPGHOME to get rid of any conflicts
> in case of multiple keys defined in THIRD_PARTY_APT_KEYS.
>
> Fix issue #73
>
> Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
Applied to next.
--
Anton Mikanovich
Promwad Ltd.
External service provider of ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn, Germany
+49 (89) 122 67 24-0
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-22 14:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-14 14:44 [PATCH] isar-bootstrap: Remove GNUPGHOME sharing Anton Mikanovich
2021-10-22 14:59 ` Anton Mikanovich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox