Makefile, bin/chroot-maint: Allow source distribution selection for Qemu.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 8 Jun 2020 18:56:53 +0000 (19:56 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 8 Jun 2020 18:56:53 +0000 (19:56 +0100)
Now we don't always take the corresponding distribution, though this is
the default.

Makefile
bin/chroot-maint

index 3b431a2..dfbdcb6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -178,6 +178,9 @@ arm64_QEMUHOST               = $(64BIT_QEMUHOST)
 i386_QEMUHOST           = $(32BIT_QEMUHOST)
 amd64_QEMUHOST          = $(64BIT_QEMUHOST)
 
+## Which distribution of Qemu to use.
+CONFIG_VARS            += $(foreach d,$(DISTS),$d_QEMUDIST)
+
 ## Qemu architecture names.  These tell us which Qemu binary to use for a
 ## particular Debian architecture.
 CONFIG_VARS            += $(foreach a,$(FOREIGN_ARCHS),$a_QEMUARCH)
index ba51ec5..34dec2e 100755 (executable)
@@ -1431,6 +1431,7 @@ class Config (object):
     "*_DEPS": ("PKGDEPS", _conv_list),
     "*_QEMUHOST": ("QEMUHOST", _conv_str),
     "*_QEMUARCH": ("QEMUARCH", _conv_str),
+    "*_QEMUDIST": ("QEMUDIST", _conv_str),
     "*_ALIASES": ("DISTALIAS", _conv_str)
   }
 
@@ -1858,7 +1859,8 @@ class ChrootJob (BaseJob):
       me._tools_chroot = CrossToolsJob.ensure\
         ("%s-%s" % (me._dist, C.TOOLSARCH), FRESH)
       me._qemu_chroot = CrossToolsJob.ensure\
-        ("%s-%s" % (me._dist, C.QEMUHOST[me._arch]), FRESH)
+        ("%s-%s" % (C.QEMUDIST.get(me._dist, me._dist),
+                    C.QEMUHOST[me._arch]), FRESH)
       me.await(me._tools_chroot)
       me.await(me._qemu_chroot)
 
@@ -1895,9 +1897,10 @@ class ChrootJob (BaseJob):
       crossdir = OS.path.join(C.LOCAL, "cross",
                               "%s-%s" % (dist, C.TOOLSARCH))
 
-      qarch, qhost = C.QEMUARCH[arch], C.QEMUHOST[arch]
+      qarch, qhost, qdist = \
+        C.QEMUARCH[arch], C.QEMUHOST[arch], C.QEMUDIST.get(dist, dist)
       qemudir = OS.path.join(C.LOCAL, "cross",
-                             "%s-%s" % (dist, qhost), "QEMU")
+                             "%s-%s" % (qdist, qhost), "QEMU")
 
       ## Acquire lockfiles in a canonical order to prevent deadlocks.
       donors = [C.TOOLSARCH]