[parrot] Detect if qemu is available (#894)
Reini Urban
rurban at x-ray.at
Fri Dec 21 03:28:36 UTC 2012
On Dec 20, 2012, at 7:55 PM, James E Keenan <notifications at github.com> wrote:
> On 12/20/12 6:08 PM, leto wrote:
> > We need to teach Configure.pl to detect if qemu is available. This is related to #173 and will allow us to emulate the cross-compilation of Parrot under qemu.
> >
> > If qemu is found, it's version number should also be printed in the Configure.pl .
>
> For the qemu-ignorant amongst us (e.g, me), can you provide (a) a
> rationale for this detection; (b) link to qemu's documentation; and (c)
> particularly link to its API?
>
> The latter will enable us how to write a probe for it.
qemu/kvm detection mean a lot of things.
I use kvm/qemu images already to run smokes and update native pbc for various architectures,
and described a bit at http://blogs.perl.org/users/rurban/2012/07/architecture-testing.html
I basically involves setting up images, OS, a libc, networking (IP and sshd), setup a user,
install devel tools, perl, bitbake, git, and control the rest via ssh sessions.
I use App::perlall and simple ssh commandlines.
windows/i386, darwin/x86_64, darwin/ppc, debian/mips, debian/sparc32 (unstable) and debian/powerpc.
embedded devs use bitbake to automate this. (linux only)
The images can be natively supported (kvm) or for a different cpu (qemu).
I published such images for testing of unusual architectures at http://perl514.cpanel.net/qemu/
And I'll get my multi-core Parallella ARM device soon, something better than a Raspberry PI.
Docs:
See e.g. http://www.openembedded.org/wiki/ for a typical setup, embedded uses usually bitbake.
They do not support kvm, only qemu, but provide pre-setup qemu images (better than mine) esp.
targeted for embedded devices (usually ARM)
http://www.openembedded.org/wiki/Testing_with_QEMU
http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html has the best overview.
It requires few gigabytes of diskspace, ~100GB.
Probing:
This means generally getting
user at hostname:port/path/to/parrot
only hostname/ip and path are required
In our case if `runqemu` and `bitbake` can be executed, typically with the argument qemuarm and the image name.
qemu-arm alone is not enough to query, you need to have pre-prepared images, properly setup.
Then which images are available to boot? --cross=target should provide this info.
You can download prebuilt kernels and filesystem images
http://downloads.yoctoproject.org/releases/yocto/yocto-1.3/machines/qemu/
E.g. http://downloads.yoctoproject.org/releases/yocto/yocto-1.3/machines/qemu/qemuarm/core-image-minimal-dev-qemuarm.ext3 with the .tar.gz and zImage-qemuarm.bin in our case.
--cross=$arch would then check for an environment setup script,
for yocto at source /opt/poky/1.3/environment-setup-$arch
openembedded uses a lot of env vars, as seen at http://www.openembedded.org/wiki/TestingScript
and just calls bitbake then.
More information about the parrot-dev
mailing list