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

Torben Hohn torben.hohn at linutronix.de
Thu Apr 4 12:56:49 CEST 2019


On Thu, Apr 04, 2019 at 11:06:13AM +0200, Manuel Traut wrote:
> 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>

Reviewed-by: Torben Hohn <torben.hohn 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
> 

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20190404/12c08ee9/attachment.sig>


More information about the elbe-devel mailing list