[elbe-devel] [PATCH v2] rfs/debootstrap: gnupg is not bootstraped in buster

Manuel Traut manut at linutronix.de
Thu Apr 4 10:03:37 CEST 2019


after debootstrapping a buster target without a debootstrap-variant gnupg is
missing in the target rfs.

however it is required by 'apt-key add' that is issued during entering the
chroot:

--8<--
running cmd +chroot /var/cache/elbe/7ec16c95-e147-425e-bb59-5e652bb1e734/chroot
apt-key add /repo/repo.pub+
------------------------------------------------------------------------------
E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is
required for this operation
------------------------------------------------------------------------------

Command failed with errorcode 255
--8<--

Therefore add it to the debootstrap include.

This also removes the logging from building the debootstrap command, because
the command is printed during execution.

Signed-off-by: Manuel Traut <manut at linutronix.de>
---

changes since v1:
  * reworked debootstrapped command creation to avoid specifying --include twice
  * unconditionally include gnupg2 during debootstrap

 elbepack/rfs.py | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/elbepack/rfs.py b/elbepack/rfs.py
index cbe43c01..829013bc 100644
--- a/elbepack/rfs.py
+++ b/elbepack/rfs.py
@@ -128,22 +128,19 @@ class BuildEnv (object):
         host_arch = self.log.get_command_out(
             "dpkg --print-architecture").strip()
 
+        includepkgs = None
+        strapcmd  = 'debootstrap '
         if self.xml.has("target/debootstrapvariant"):
             bootstrapvariant = self.xml.text("target/debootstrapvariant")
             includepkgs = self.xml.node("target/debootstrapvariant").et.get("includepkgs")
-            if includepkgs:
-                self.log.printo('NOTE: use bootstrap variant '
-                    '"%s" with additional includes: "%s".' % (
-                    bootstrapvariant, includepkgs))
-                strapcmd = 'debootstrap --variant="%s" --include="%s"' % (
-                    bootstrapvariant, includepkgs)
-            else:
-                self.log.printo('NOTE: use bootstrap variant "%s".' % (
-                    bootstrapvariant))
-                strapcmd = 'debootstrap --variant="%s"' % (bootstrapvariant)
+            strapcmd += '--variant="%s" ' % bootstrapvariant
+
+        if includepkgs and not "gnupg2" in includepkgs:
+            includepkgs += ",gnupg2"
         else:
-            self.log.printo('use bootstrap no variant.')
-            strapcmd = 'debootstrap'
+            includepkgs = "gnupg2"
+
+        strapcmd += ' --include="%s"' % includepkgs
 
         if not self.xml.is_cross(host_arch):
             # ignore gpg verification if install from cdrom, cause debootstrap
-- 
2.20.1




More information about the elbe-devel mailing list