~mdw
/
distorted-chroot
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'deploy' into deploy.universe
[distorted-chroot]
/
bin
/
chroot-maint
diff --git
a/bin/chroot-maint
b/bin/chroot-maint
index
a24d173
..
34dec2e
100755
(executable)
--- a/
bin/chroot-maint
+++ b/
bin/chroot-maint
@@
-1431,6
+1431,7
@@
class Config (object):
"*_DEPS": ("PKGDEPS", _conv_list),
"*_QEMUHOST": ("QEMUHOST", _conv_str),
"*_QEMUARCH": ("QEMUARCH", _conv_str),
"*_DEPS": ("PKGDEPS", _conv_list),
"*_QEMUHOST": ("QEMUHOST", _conv_str),
"*_QEMUARCH": ("QEMUARCH", _conv_str),
+ "*_QEMUDIST": ("QEMUDIST", _conv_str),
"*_ALIASES": ("DISTALIAS", _conv_str)
}
"*_ALIASES": ("DISTALIAS", _conv_str)
}
@@
-1477,6
+1478,12
@@
with toplevel_handler(): C = Config()
CREATE = Tag("CREATE")
FORCE = Tag("FORCE")
CREATE = Tag("CREATE")
FORCE = Tag("FORCE")
+DEBCONF_TWEAKS = """
+ DEBIAN_FRONTEND=noninteractive; export DEBIAN_FRONTEND
+ DEBIAN_PRIORITY=critical export DEBIAN_PRIORITY
+ DEBCONF_NONINTERACTIVE_SEEN=true; export DEBCONF_NONINTERACTIVE_SEEN
+"""
+
def check_fresh(fresh, update):
"""
Compare a refresh mode FRESH against an UPDATE time.
def check_fresh(fresh, update):
"""
Compare a refresh mode FRESH against an UPDATE time.
@@
-1852,7
+1859,8
@@
class ChrootJob (BaseJob):
me._tools_chroot = CrossToolsJob.ensure\
("%s-%s" % (me._dist, C.TOOLSARCH), FRESH)
me._qemu_chroot = CrossToolsJob.ensure\
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)
me.await(me._tools_chroot)
me.await(me._qemu_chroot)
@@
-1889,9
+1897,10
@@
class ChrootJob (BaseJob):
crossdir = OS.path.join(C.LOCAL, "cross",
"%s-%s" % (dist, C.TOOLSARCH))
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",
qemudir = OS.path.join(C.LOCAL, "cross",
- "%s-%s" % (dist, qhost), "QEMU")
+ "%s-%s" % (
q
dist, qhost), "QEMU")
## Acquire lockfiles in a canonical order to prevent deadlocks.
donors = [C.TOOLSARCH]
## Acquire lockfiles in a canonical order to prevent deadlocks.
donors = [C.TOOLSARCH]
@@
-1938,7
+1947,7
@@
class ChrootJob (BaseJob):
continue
ff.append(f)
path = OS.path.join(dir, f)
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),
files[:] = ff
OS.path.walk(crossdir, visit, None)
OS.path.walk(OS.path.join(crossdir, "TOOLCHAIN", gnuarch),
@@
-2045,8
+2054,9
@@
class ChrootJob (BaseJob):
run_root(["mv", new, real])
for path in have_link.iterkeys():
if path in want_link: continue
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
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
run_root(["rm", "-f", real])
## Remove diversions from paths which don't need them any more. Here
@@
-2110,7
+2120,7
@@
class ChrootJob (BaseJob):
## Install the base system.
progress("install base system")
## 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),
(arch in C.FOREIGN_ARCHS and ["--foreign"] or []) +
["--arch=" + arch, "--variant=minbase",
"--include=" + ",".join(C.BASE_PACKAGES),
@@
-2150,12
+2160,12
@@
class ChrootJob (BaseJob):
with safewrite_root\
(OS.path.join(mnt, "fs/etc/apt/apt.conf.d/20arch")) as f:
f.write("""\
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")
## Set up the locale and time zone from the host system.
progress("configure locales and timezone")
@@
-2178,10
+2188,10
@@
class ChrootJob (BaseJob):
with safewrite_root(OS.path.join(mnt, "fs/usr/sbin/policy-rc.d"),
mode = "755") as f:
f.write("""\
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
## Hack the dynamic linker to prefer libraries in `/usr' over
## `/usr/local'. This prevents `dpkg-shlibdeps' from becoming
@@
-2193,10
+2203,10
@@
class ChrootJob (BaseJob):
with safewrite_root\
(OS.path.join(mnt, "fs/etc/ld.so.conf.d/zzz-local.conf")) as f:
f.write("""\
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:
## If this is a foreign architecture then we need to set it up.
if arch in C.FOREIGN_ARCHS:
@@
-2222,7
+2232,8
@@
class ChrootJob (BaseJob):
## Finishing touches.
progress("finishing touches")
## Finishing touches.
progress("finishing touches")
- run_schroot_source(dist, arch, ["eatmydata", "sh", "-e", "-c", """
+ run_schroot_source(dist, arch, ["eatmydata", "sh", "-e", "-c",
+ DEBCONF_TWEAKS + """
apt-get update
apt-get -y upgrade
apt-get -y install "$@"
apt-get update
apt-get -y upgrade
apt-get -y install "$@"
@@
-2240,11
+2251,13
@@
class ChrootJob (BaseJob):
with Cleanup() as clean:
dist, arch = me._dist, me._arch
clean.enter(lockfile(chroot_src_lockfile(dist, arch)))
with Cleanup() as clean:
dist, arch = me._dist, me._arch
clean.enter(lockfile(chroot_src_lockfile(dist, arch)))
- run_schroot_source(dist, arch, ["eatmydata", "sh", "-e", "-c", """
+ run_schroot_source(dist, arch, ["eatmydata", "sh", "-e", "-c",
+ DEBCONF_TWEAKS + """
apt-get update
apt-get -y dist-upgrade
apt-get -y autoremove
apt-get -y clean
apt-get update
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()
"""], stdin = DISCARD)
if arch in C.FOREIGN_ARCHS: me._install_cross_tools()
me._meta.update = zulu(); me._meta.write()
@@
-2311,7
+2324,8
@@
class CrossToolsJob (BaseJob):
## Make sure the donor tree is up-to-date, and install the extra
## packages we need.
progress("install tools packages")
## Make sure the donor tree is up-to-date, and install the extra
## packages we need.
progress("install tools packages")
- run_schroot_session(session, ["eatmydata", "sh", "-e", "-c", """
+ run_schroot_session(session, ["eatmydata", "sh", "-e", "-c",
+ DEBCONF_TWEAKS + """
apt-get update
apt-get -y upgrade
apt-get -y install "$@"
apt-get update
apt-get -y upgrade
apt-get -y install "$@"
@@
-2366,7
+2380,7
@@
class CrossToolsJob (BaseJob):
try: dest = dest[:dest.rindex("/")]
except ValueError: dest = ""
if path == "": path = link
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.
## Work through the shopping list, copying the things it names into the
## cross-tools tree.
@@
-2659,6
+2673,11
@@
class PackageBuildJob (BaseJob):
run_schroot_session(session,
["mount", "-oremount,rw", "/usr/local.schroot"],
rootp = True, stdin = DISCARD)
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", """
progress("configure `%s' %s for %s" % (pkg, ver, arch))
run_schroot_session(session, ["sh", "-e", "-c", """