[elbe-devel] [PATCH 08/10] pbuilder: fix pbuilder creation for buster and stretch

Manuel Traut manut at linutronix.de
Wed Apr 3 12:34:56 CEST 2019


Building buster pbuilder chroots fails:
--8<--
W: GPG error:
http://127.0.0.1:8080/var/cache/elbe/898da4a7-ce50-46fc-87e0-1d126bf85550/repo
buster InRelease: The following signatures couldn't be verified because the
public key is not available: NO_PUBKEY B55E6A0822C21D24
E: The repository
'http://127.0.0.1:8080/var/cache/elbe/898da4a7-ce50-46fc-87e0-1d126bf85550/repo
buster InRelease' is not signed.
--8<--
Therefore use the --keyring option of pbuilder to add the key of the
self signed repo.

For apt < 0.7.25.1 the --keyring option doesn't work, use the G hook
and 'apt-key add' to inject the key as promoted in the pbuilder man-page.

To use apt-key add directly after debootstrap, install gnupg early to avoid
--8<--
I: Copy
/var/cache/elbe/db428970-3c8e-4783-b942-3a6f792f1e44/aptconfdir/apt.conf.d  to
chroot
I: copying apt key file
/var/cache/elbe/db428970-3c8e-4783-b942-3a6f792f1e44/repo/elbe-keyring.gpg to
/var/cache/pbuilder/build/8294/etc/apt/trusted.gpg.d/elbe-keyring.gpg
I: user script /var/cache/pbuilder/build/8294/tmp/hooks/G10elbe_apt_sources
starting
E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is
required for this operation
--8<--
for buster chroots.

Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/elbeproject.py | 7 ++++---
 elbepack/pbuilder.py    | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
index 591c4065..80cbb8f8 100644
--- a/elbepack/elbeproject.py
+++ b/elbepack/elbeproject.py
@@ -712,13 +712,14 @@ class ElbeProject (object):
                 self.builddir,
                 "pbuilder",
                 "hooks.d",
-                "D10elbe_apt_sources"))
+                "G10elbe_apt_sources"))
 
         # Run pbuilder --create
         self.log.do('pbuilder --create --configfile "%s" --aptconfdir "%s" '
-                    '--extrapackages "git gnupg"' % (
+                    '--debootstrapopts --include="git gnupg2" --keyring "%s"' % (
                         os.path.join(self.builddir, "pbuilderrc"),
-                        os.path.join(self.builddir, "aptconfdir")))
+                        os.path.join(self.builddir, "aptconfdir"),
+                        os.path.join(self.builddir, "repo", "elbe-keyring.gpg")))
 
     def sync_xml_to_disk(self):
         try:
diff --git a/elbepack/pbuilder.py b/elbepack/pbuilder.py
index bd030bd3..e84d88fe 100644
--- a/elbepack/pbuilder.py
+++ b/elbepack/pbuilder.py
@@ -102,7 +102,7 @@ def pbuilder_write_repo_hook(builddir, xml):
 
     pbuilder_hook_dir = os.path.join(builddir, "pbuilder", "hooks.d")
 
-    fp = open(os.path.join(pbuilder_hook_dir, "D10elbe_apt_sources"), "w")
+    fp = open(os.path.join(pbuilder_hook_dir, "G10elbe_apt_sources"), "w")
 
     if xml.prj is None:
         return "# No Project"
-- 
2.20.1




More information about the elbe-devel mailing list