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

Christian Teklenborg chris at linutronix.de
Tue Mar 10 17:49:40 CET 2020


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.

Signed-off-by: Christian Teklenborg <chris at linutronix.de>
---
 elbepack/pbuilder.py | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/elbepack/pbuilder.py b/elbepack/pbuilder.py
index 6c40a240..ca387f28 100644
--- a/elbepack/pbuilder.py
+++ b/elbepack/pbuilder.py
@@ -62,6 +62,38 @@ 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, "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', 'base.tgz'))
+
+    fp.write('DISTRIBUTION="%s"\n' % distname)
+
+    fp.write(
+        'BUILDRESULT="%s"\n' %
+        os.path.join(
+            builddir,
+            'pbuilder',
+            'result'))
+    fp.write(
+        'APTCACHE="%s"\n' %
+        os.path.join(
+            builddir,
+            'pbuilder',
+            'aptcache'))
+    fp.write('HOOKDIR="%s"\n' % os.path.join(builddir, 'pbuilder', 'hooks.d'))
+    fp.write('PBUILDERSATISFYDEPENDSCMD='
+             '/usr/lib/pbuilder/pbuilder-satisfydepends-apt\n')
+    fp.close()
+
 
 def pbuilder_write_apt_conf(builddir, xml):
 
@@ -87,6 +119,7 @@ def pbuilder_write_apt_conf(builddir, xml):
 
     # Make aptitude install untrusted packages without asking
     fp.write('Aptitude::CmdLine::Ignore-Trust-Violations "true";\n')
+
     fp.close()
 
 
-- 
2.20.1




More information about the elbe-devel mailing list