* pbuilder-dist: allow any foreign chroot (may not work, but we can try)

* docs/pbuilder-dist.1: update manpage to indicate general architecture
This commit is contained in:
Emmet Hikory 2010-03-08 18:54:54 +09:00
parent 510cdbd726
commit e5862f49c9
3 changed files with 19 additions and 20 deletions

4
debian/changelog vendored
View File

@ -7,8 +7,10 @@ ubuntu-dev-tools (0.94) UNRELEASED; urgency=low
[ Emmet Hikory ]
* mk-sbuild: switch to use qemu-debootstrap for foreign chroots
* mk-sbuild: allow any foreign chroot (may not work, but we can try)
* pbuilder-dist: allow any foreign chroot (may not work, but we can try)
* docs/pbuilder-dist.1: update manpage to indicate general architecture
-- Emmet Hikory <persia@ubuntu.com> Mon, 08 Mar 2010 17:56:30 +0900
-- Emmet Hikory <persia@ubuntu.com> Mon, 08 Mar 2010 18:51:19 +0900
ubuntu-dev-tools (0.93) lucid; urgency=low

View File

@ -4,10 +4,10 @@
pbuilder\-dist, cowbuilder\-dist \- multi-distribution pbuilder/cowbuilder wrapper
.SH SYNOPSIS
\fBpbuilder\-dist\fP \fIdistribution\fR [\fBi386\fP|\fBamd64\fP|\fBarmel\fP] [\fBmainonly\fP]
\fBpbuilder\-dist\fP \fIdistribution\fR [\fIarchitecture\fR] [\fBmainonly\fP]
\fIoperation\fR [\fI...\fR]
\fBcowbuilder\-dist\fP \fIdistribution\fR [\fBi386\fP|\fBamd64\fP|\fBarmel\fP] [\fBmainonly\fP]
\fBcowbuilder\-dist\fP \fIdistribution\fR [\fIarchitecture\fR] [\fBmainonly\fP]
\fIoperation\fR [\fI...\fR]
.SH DESCRIPTION
@ -15,8 +15,8 @@ pbuilder\-dist, cowbuilder\-dist \- multi-distribution pbuilder/cowbuilder wrapp
versions of Ubuntu and/or Debian.
.PP
It is common to symlink this script in order to give it many names in the form of
\fBpbuilder\-\fIdistribution\fP\fR (\fBpbuilder\-\fIdistribution\fR\-\fIarchitecture\fP\fR on amd64
systems), like for example \fBpbuilder\-feisty\fP, \fBpbuilder\-sid\fP, \fBpbuilder\-gutsy\-i386\fP, etc.
\fBpbuilder\-\fIdistribution\fP\fR or \fBpbuilder\-\fIdistribution\fR\-\fIarchitecture\fP\fR,
like for example \fBpbuilder\-feisty\fP, \fBpbuilder\-sid\fP, \fBpbuilder\-gutsy\-i386\fP, etc.
.PP
The same applies to \fBcowbuilder\-dist\fP, which uses cowbuilder. The main
difference between both is that pbuilder compresses the created chroot as a
@ -33,12 +33,13 @@ the name also contains \-\fIarchitecture\fR.
\fBdistribution\fP
Replace this with the codename of the version of Ubuntu or Debian you want to use.
.TP
\fBi386\fP / \fBamd64\fP / \fBarmel\fP
Only available on i386 and amd64 systems.
This is optional; default is the native architecture
If \fBi386\fP is specified, an i386 environment will be used.
If \fBarmel\fP is specified, an armel environment will be used.
Note that there is no support for amd64 chroots on i386 systems
\fBarchitecture\fP
This optional parameter will attempt to construct a chroot in a foreign
architecture. For some architecture pairs (e.g. i386 on an amd64 install),
the chroot will be created natively. For others (e.g. armel on an i386
install), qemu-static and binfmt-misc will be used. Note that some
combinations (e.g. amd64 on an i386 install) require special separate
kernel handling, and may break in unexpected ways.
.TP
\fBmainonly\fP
If you specify \fBmainonly\fP, only packages from the main (in Debian) or

View File

@ -310,20 +310,16 @@ def main():
if len(parts) > 2:
requested_arch = parts[2]
elif len(args) > 0 and args[0] in ('i386', 'amd64', 'armel'):
elif len(args) > 0 and args[0] in ("alpha", "amd64", "arm", "armeb", "armel", "i386", "lpia", "m68k", "mips", "mipsel", "powerpc", "ppc64", "sh4", "sh4eb", "sparc", "sparc64"):
requested_arch = args.pop(0)
else:
requested_arch = None
if requested_arch:
if requested_arch in ('i386', 'amd64') and app.system_architecture == 'amd64':
app.build_architecture = requested_arch
elif requested_arch == 'armel' and app.system_architecture in ('i386', 'amd64'):
app.build_architecture = requested_arch
args.append('--debootstrap build-arm-chroot')
else:
print 'Error: Architecture switching is not supported on your system; wrong filename.'
sys.exit(1)
app.build_architecture = requested_arch
# For some foreign architectures we need to use qemu
if requested_arch != app.system_architecture and (requested_arch, app.system_architecture) not in (("amd64", "i386"), ("amd64", "lpia"), ("arm", "armel"), ("armel", "arm"), ("i386", "lpia"), ("lpia", "i386"), ("powerpc", "ppc64"), ("ppc64", "powerpc"), ("sparc", "sparc64"), ("sparc64", "sparc")):
args.append('--debootstrap qemu-debootstrap')
if 'mainonly' in sys.argv:
app.extra_components = False