[elbe-devel] [PATCH v2] rfs/debootstrap: gnupg is not bootstraped in buster
Manuel Traut
manut at linutronix.de
Thu Apr 4 11:06:13 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
changes since v2:
* use split(',') for detecting if gnupg2 is already included
* fix case if includepkgs='bla,gnupg2' that all but gnupg2 will be removed
elbepack/rfs.py | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/elbepack/rfs.py b/elbepack/rfs.py
index cbe43c01..f2519294 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)
- else:
- self.log.printo('use bootstrap no variant.')
- strapcmd = 'debootstrap'
+ strapcmd += '--variant="%s" ' % bootstrapvariant
+
+ if includepkgs and not "gnupg2" in includepkgs.split(','):
+ includepkgs += ",gnupg2"
+ if not includepkgs:
+ 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