[elbe-devel] [PATCH v3 1/4] pbuilder: write pbuilderrc without qemu-debootstrap

Torben Hohn torben.hohn at linutronix.de
Wed Apr 29 15:39:48 CEST 2020


On Mon, Apr 27, 2020 at 04:35:41PM +0200, Christian Teklenborg wrote:
> The pbuilder_write_config function writes debootstrap options in the pbuilderrc
> which would create a chroot environment with a foreign achitecture with qemu
> if pbuilder --create is called.
> But to crosscompile, a chroot environment with the build architecture is needed.
> Thus add the function pbuilder_write_cross_config that creates a pbuilderrc
> without these debootstrap options. Change the pbuilder_write_repo_hook function
> to take care of the different directory names from the pbuilder environment.
> 
> Signed-off-by: Christian Teklenborg <chris at linutronix.de>
> ---
>  elbepack/pbuilder.py | 30 ++++++++++++++++++++++++++++--
>  1 file changed, 28 insertions(+), 2 deletions(-)
> 
> diff --git a/elbepack/pbuilder.py b/elbepack/pbuilder.py
> index 6c40a240..e6f0b3cf 100644
> --- a/elbepack/pbuilder.py
> +++ b/elbepack/pbuilder.py
> @@ -62,6 +62,29 @@ def pbuilder_write_config(builddir, xml):
>  
>      fp.close()
>  
> +def pbuilder_write_cross_config(builddir, xml):
> +    distname = xml.prj.text('suite')
> +    pbuilderrc_fname = os.path.join(builddir, "cross_pbuilderrc")
> +    fp = open(pbuilderrc_fname, "w")
> +
> +    fp.write('#!/bin/sh\n')
> +    fp.write('set -e\n')
> +    fp.write('MIRRORSITE="%s"\n' % xml.get_primary_mirror(False))
> +    fp.write('OTHERMIRROR="deb http://127.0.0.1:8080%s/repo %s main"\n' %
> +             (builddir, distname))
> +    fp.write('BASETGZ="%s"\n' % os.path.join(builddir, 'pbuilder_cross', 'base.tgz'))
> +
> +    fp.write('DISTRIBUTION="%s"\n' % distname)
> +
> +    fp.write('BUILDRESULT="%s"\n' %
> +             os.path.join(builddir, 'pbuilder_cross', 'result'))
> +    fp.write('APTCACHE="%s"\n' %
> +             os.path.join(builddir, 'pbuilder_cross','aptcache'))
> +    fp.write('HOOKDIR="%s"\n' % os.path.join(builddir, 'pbuilder_cross', 'hooks.d'))
> +    fp.write('PBUILDERSATISFYDEPENDSCMD='
> +             '/usr/lib/pbuilder/pbuilder-satisfydepends-apt\n')
> +    fp.close()
> +
>  
>  def pbuilder_write_apt_conf(builddir, xml):
>  
> @@ -107,9 +130,12 @@ def mirror_script_add_key_url(mirror, key_url):
>      return mirror_script_add_key_text(mirror, key_text)
>  
>  
> -def pbuilder_write_repo_hook(builddir, xml):
> +def pbuilder_write_repo_hook(builddir, xml, cross):

this patch adds the cross parameter, but the calls to
pbuilder_write_repo_hook() are not changed in this patch,
because the cross parameter does not exist yet.

Its probably better, to just squash this patch with patch 2.

the rest of the patch looks good.


>  
> -    pbuilder_hook_dir = os.path.join(builddir, "pbuilder", "hooks.d")
> +    if cross:
> +        pbuilder_hook_dir = os.path.join(builddir, "pbuilder_cross", "hooks.d")
> +    else:
> +        pbuilder_hook_dir = os.path.join(builddir, "pbuilder", "hooks.d")
>  
>      with open(os.path.join(pbuilder_hook_dir, "H10elbe_apt_update"), "w") as f:
>          f.write("#!/bin/sh\napt update\n")
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
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



More information about the elbe-devel mailing list