From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6662306179908108288 Date: Tue, 26 Feb 2019 06:07:38 -0800 (PST) From: cedric_hombourger@mentor.com To: isar-users Message-Id: In-Reply-To: <20190226134844.8632-3-andreas.reichel.ext@siemens.com> References: <20190226134844.8632-1-andreas.reichel.ext@siemens.com> <20190226134844.8632-3-andreas.reichel.ext@siemens.com> Subject: Re: [RFC v1 2/3] Refactor gpg code to use apt code MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1253_389121488.1551190058377" X-Google-Token: EKqQ1eMFB8pJH8QMB2M0 X-Google-IP: 95.176.90.117 X-TUID: xpsu1CLZE6Ou ------=_Part_1253_389121488.1551190058377 Content-Type: multipart/alternative; boundary="----=_Part_1254_1422868489.1551190058377" ------=_Part_1254_1422868489.1551190058377 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit > > diff --git a/meta/classes/isar-bootstrap-helper.bbclass > b/meta/classes/isar-bootstrap-helper.bbclass > index d780b85..df6fbee 100644 > --- a/meta/classes/isar-bootstrap-helper.bbclass > +++ b/meta/classes/isar-bootstrap-helper.bbclass > @@ -119,6 +119,14 @@ setup_root_file_system() { > export LANG=C > export LANGUAGE=C > export LC_ALL=C > + > + if [ -d ${TMPDIR}/aptkeys ]; then > + for keyfile in ${TMPDIR}/aptkeys/* > + do > + cp $keyfile "$ROOTFSDIR"/tmp/$(basename $keyfile) > I have seen repos name their key debian.gpg or some other generic name I am concerned that we may get repositories using the same key names and only the last key would be added Should we do something like: tmpkey=$(mktemp -p "$ROOTFSDIR"/tmp) cp $keyfile $tmpkey sudo -E chroot "$ROOTFSDIR" /usr/bin/apt-key add /tmp/$(basename $tmpkey) rm -f $tmpkey + sudo -E chroot "$ROOTFSDIR" /usr/bin/apt-key add > /tmp/$(basename $keyfile) > + done > + fi > > ------=_Part_1254_1422868489.1551190058377 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
diff --git a/= meta/classes/isar-bootstrap-helper.bbclass b/meta/classes/isar-bootstr= ap-helper.bbclass
index d780b85..df6fbee 100644
--- a/meta/classes/isar-bootstrap-helper.bbclass
+++ b/meta/classes/isar-bootstrap-helper.bbclass
@@ -119,6 +119,14 @@ setup_root_file_system() {
=C2=A0 =C2=A0 =C2=A0export LANG=3DC
=C2=A0 =C2=A0 =C2=A0export LANGUAGE=3DC
=C2=A0 =C2=A0 =C2=A0export LC_ALL=3DC
+
+ =C2=A0 =C2=A0if [ -d ${TMPDIR}/aptkeys ]; then
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0for keyfile in ${TMPDIR}/aptkeys/*
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0do
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cp $keyfile "$ROOTFSDIR= "/tmp/$(basename $keyfile)

I have seen repos name their key debia= n.gpg or some other generic name
I am concerned that we may get r= epositories using the same key names and only the last key would be added
Should we do something like:

tmpkey=3D$(m= ktemp -p=C2=A0 "$ROOTFSDIR"/tmp)
cp $keyfile $tmpkey
sudo -E chroot "$ROOTFSDIR" /usr/bin/apt-key add /tmp= /$(basename $tmpkey)
rm -f=C2=A0 =C2=A0$tmpkey

=
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0sudo -E chroot "$ROOTFSDIR" /usr/bin/apt-key = add /tmp/$(basename $keyfile)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0done
+ =C2=A0 =C2=A0fi