i386_QEMUHOST = $(32BIT_QEMUHOST)
amd64_QEMUHOST = $(64BIT_QEMUHOST)
+## Which distribution of Qemu to use.
+CONFIG_VARS += $(foreach d,$(DISTS),$d_QEMUDIST)
+stretch_QEMUDIST = buster
+
## Qemu architecture names. These tell us which Qemu binary to use for a
## particular Debian architecture.
CONFIG_VARS += $(foreach a,$(FOREIGN_ARCHS),$a_QEMUARCH)
## $(call squote,TXT)
##
## Single-quote TXT.
-squote = '$(subst ','\\'',$1)'
+squote = '$(subst ','\'',$1)'
+#'
## $(call chroot-dist,D-A) -> D
## $(call chroot-arch,D-A) -> A
$(V_AT)mkdir -p $(dir $(patsubst %/,%,$@))
$(call v_tag,MKDIR)mkdir $@
-LOCAL_ARCH_DIRS = bin/ etc/ games/ include/ lib/ libexec/ sbin/
+LOCAL_ARCH_DIRS = bin/ etc/ games/ include/ include.aside/
+LOCAL_ARCH_DIRS += lib/ libexec/ sbin/
LOCAL_ARCH_LINKS = man
man_LINKDEST = share/man
all:: $(foreach a,$(ALL_ARCHS),\
MAINTQ_ = -q
MAINTQ_0 = -q
-MAINT = +$(call v_tag,RUN)\
+MAINT = +$(call v_tag,MAINT)\
PYTHONPATH=$(STATE)/lib/python $(STATE)/bin/chroot-maint \
$(MAINTQ_$V) $(OPTS)
$(MAINT) -f$(FRESH) $(JOBS)
.PHONY: maint
+###--------------------------------------------------------------------------
+### Running random commands.
+
+CMD = echo %d %a
+subst-command = $(subst %d,$(call chroot-dist,$1), \
+ $(subst %a,$(call chroot-arch,$1), \
+ $(subst %r,$1, $(CMD))))
+
+run: $(foreach c,$(ALL_CHROOTS),run/$c)
+$(foreach c,$(ALL_CHROOTS),run/$c): run/%:
+ $(V_AT)$(call v_print,RUN,$(call subst-command,$*))\
+ $(call subst-command,$*)
+
###--------------------------------------------------------------------------
### Other maintenance targets.
"*_DEPS": ("PKGDEPS", _conv_list),
"*_QEMUHOST": ("QEMUHOST", _conv_str),
"*_QEMUARCH": ("QEMUARCH", _conv_str),
+ "*_QEMUDIST": ("QEMUDIST", _conv_str),
"*_ALIASES": ("DISTALIAS", _conv_str)
}
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)
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]
continue
ff.append(f)
path = OS.path.join(dir, f)
- if not OS.path.isdir(path): examine(path)
+ if OS.path.islink(path) or not OS.path.isdir(path): examine(path)
files[:] = ff
OS.path.walk(crossdir, visit, None)
OS.path.walk(OS.path.join(crossdir, "TOOLCHAIN", gnuarch),
run_root(["mv", new, real])
for path in have_link.iterkeys():
if path in want_link: continue
- progress("remove obsolete link `%s' -> `%s'" % path)
real = root + path
+ progress("remove obsolete link `%s' -> `%s'" %
+ (path, OS.readlink(real)))
run_root(["rm", "-f", real])
## Remove diversions from paths which don't need them any more. Here
## Install the base system.
progress("install base system")
- run_root(["eatmydata", "debootstrap"] +
+ run_root(["eatmydata", "debootstrap", "--no-merged-usr"] +
(arch in C.FOREIGN_ARCHS and ["--foreign"] or []) +
["--arch=" + arch, "--variant=minbase",
"--include=" + ",".join(C.BASE_PACKAGES),
with safewrite_root\
(OS.path.join(mnt, "fs/etc/apt/apt.conf.d/20arch")) as f:
f.write("""\
- ### -*-conf-*-
+### -*-conf-*-
- APT {
- Architecture "%s";
- };
- """ % arch)
+APT {
+ Architecture "%s";
+};
+""" % arch)
## Set up the locale and time zone from the host system.
progress("configure locales and timezone")
with safewrite_root(OS.path.join(mnt, "fs/usr/sbin/policy-rc.d"),
mode = "755") as f:
f.write("""\
- #! /bin/sh
- echo >&2 "policy-rc.d: Services disabled by policy."
- exit 101
- """)
+#! /bin/sh
+echo >&2 "policy-rc.d: Services disabled by policy."
+exit 101
+""")
## Hack the dynamic linker to prefer libraries in `/usr' over
## `/usr/local'. This prevents `dpkg-shlibdeps' from becoming
with safewrite_root\
(OS.path.join(mnt, "fs/etc/ld.so.conf.d/zzz-local.conf")) as f:
f.write("""\
- ### -*-conf-*-
- ### Local hack to make /usr/local/ late.
- /usr/local/lib
- """)
+### -*-conf-*-
+### Local hack to make /usr/local/ late.
+/usr/local/lib
+""")
## If this is a foreign architecture then we need to set it up.
if arch in C.FOREIGN_ARCHS:
apt-get -y dist-upgrade
apt-get -y autoremove
apt-get -y clean
+ ldconfig
"""], stdin = DISCARD)
if arch in C.FOREIGN_ARCHS: me._install_cross_tools()
me._meta.update = zulu(); me._meta.write()
try: dest = dest[:dest.rindex("/")]
except ValueError: dest = ""
if path == "": path = link
- else: path = "%s/%s" % (path, link)
+ else: path = "%s/%s" % (link, path)
## Work through the shopping list, copying the things it names into the
## cross-tools tree.
run_schroot_session(session,
["mount", "-oremount,rw", "/usr/local.schroot"],
rootp = True, stdin = DISCARD)
+ run_schroot_session(session,
+ ["mount", "--bind",
+ "/usr/local.schroot/%s/include.aside" % arch,
+ "/usr/local.schroot/%s/include" % arch],
+ rootp = True, stdin = DISCARD)
progress("configure `%s' %s for %s" % (pkg, ver, arch))
run_schroot_session(session, ["sh", "-e", "-c", """