[buildd-tools-devel] Bug#604268: Bug#604268: Bug#604268: Bug#604268: QEMU linux-user support
Roger Leigh
rleigh at codelibre.net
Sat Jan 22 16:56:26 UTC 2011
On Sun, Dec 12, 2010 at 12:11:29PM +0000, Roger Leigh wrote:
> Thanks for the updated patch. I'm afraid that it can't go into
> schroot 1.4 just at the moment due to the squeeze freeze. But I'll
> put in onto the master branch when I have some free time, and it
> can go into schroot 1.5/1.6 for wheezy/unstable once the freeze is
> over.
OK, I've worked on this a bit today, and I've attached a patch for
the current work in progress. Basically, I've added support for
machine emulation as a "chroot facet" inside the actual C++
sources, rather than the setup scripts. This means the qemu
configuration etc. can be done directly in the chroot configuration
in /etc/schroot. A patch is attached, as is the documentation
(searching for "machine emulation" will find the relevant bits).
Essentially, you can now set
emulation=qemu|none
emulation-arch=auto|$arch
and when the setup scripts are run, those are then set as
$CHROOT_EMULATION and
$CHROOT_EMULATION_ARCH
Your 11qemu script has been added as 50emulation (does it need to
be sooner?) I renamed it to allow other emulation programs to be
used potentially; the same applies to the option names.
I'm not sure if emulation-arch is that useful; is there any reason
not to always autodetect? Maybe if autodetection fails? Also, we
can use emulation=qemu to force qemu usage--since we enable it in the
configuration explicitly, do we then need to check the host arch to see
if we should run qemu? This would make the setup script simpler and
behave the same under most conditions.
If any additional options need adding (I think you mentioned supporting
other executables?) then this is now simple to do. They can simply be
added as additional members of the class in
sbuild/sbuild-chroot-facet-emulation.(cc|h), and the configuration file
and environment settings are also defined here.
If you're unhappy with any of the names used, that's also trivial to
change if you like. (I'm fairly rubbish at naming things!)
BTW, does kfreebsd have the same binfmt-misc and qemu support as Linux?
I'm just wondering if this should be enabled by default on BSD as well.
Anyway, that's it so far. I'd appreciate any thoughts you have!
Regards,
Roger
% ./bin/schroot/schroot -i -c bsnaptest
─── Chroot ───
Name bsnaptest
Description Debian sid btrfs snapshot
Type btrfs-snapshot
…
Btrfs Source Subvolume /srv/chroot/sid-snap
Btrfs Snapshot Directory /srv/chroot/snapshots
Personality undefined
Machine Emulation qemu
Emulation Architecture powerpc
…
% ./bin/schroot/schroot --config -c bsnaptest
# schroot configuration generated by schroot 1.5.0 on 22 Jan 2011
[bsnaptest]
…
emulation=qemu
emulation-arch=powerpc
…
% ./bin/schroot/schroot -V
schroot (Debian sbuild) 1.5.0 (16 Jan 2011)
…
Configured features:
DEVLOCK Device locking
PAM Pluggable Authentication Modules
PERSONALITY Linux kernel Application Binary Interface switching
UNION Support for filesystem unioning
EMULATION Machine emulation
…
bin/schroot-base/schroot-base-main.cc | 5
configure.ac | 29 +++++
debian/control | 2
etc/setup.d/50emulation | 141 +++++++++++++++++++++++++++
etc/setup.d/Makefile.am | 17 ++-
man/schroot-setup.5.in | 7 +
man/schroot.conf.5.in | 30 +++++
sbuild/Makefile.am | 17 ++-
sbuild/sbuild-chroot-facet-emulation.cc | 166 ++++++++++++++++++++++++++++++++
sbuild/sbuild-chroot-facet-emulation.h | 137 ++++++++++++++++++++++++++
sbuild/sbuild-chroot.cc | 6 +
sbuild/sbuild-config.h.in | 3
test/sbuild-chroot-block-device.cc | 5
test/sbuild-chroot-btrfs-snapshot.cc | 5
test/sbuild-chroot-directory.cc | 5
test/sbuild-chroot-file.cc | 5
test/sbuild-chroot-loopback.cc | 5
test/sbuild-chroot-lvm-snapshot.cc | 5
test/sbuild-chroot-plain.cc | 5
test/sbuild-chroot.cc | 5
test/test-sbuild-chroot.h | 17 +++
21 files changed, 608 insertions(+), 9 deletions(-)
--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: schroot-qemu-1.patch
Type: text/x-diff
Size: 28271 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20110122/147272f9/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: schroot-qemu.pdf
Type: application/pdf
Size: 105201 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20110122/147272f9/attachment-0001.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20110122/147272f9/attachment-0001.pgp>
More information about the Buildd-tools-devel
mailing list