Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1Ax4PC-0004ku-Q7 for qemu-devel@nongnu.org; Sat, 28 Feb 2004 08:21:22 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1Ax4Og-0004i3-C4 for qemu-devel@nongnu.org; Sat, 28 Feb 2004 08:21:21 -0500 Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.30) id 1Ax3ww-0003yk-0n for qemu-devel@nongnu.org; Sat, 28 Feb 2004 07:52:10 -0500 Received: from [62.236.252.195] (helo=sulkku.creanor.com) by mx20.gnu.org with esmtp (Exim 4.30) id 1Ax3tX-0004sj-9X for qemu-devel@nongnu.org; Sat, 28 Feb 2004 07:48:39 -0500 Date: Sat, 28 Feb 2004 14:45:41 +0200 From: Veli Mankinen Subject: Re: [Qemu-devel] qemu + chroot with non native image Message-ID: <20040228124540.GA3849@movial.fi> References: <200402281136.14662.boddingt@mpx.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200402281136.14662.boddingt@mpx.com.au> Reply-To: qemu-devel@nongnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: boddingt@mpx.com.au, qemu-devel@nongnu.org Hi, Project named Scratchbox aims to solve these cross-compilation and cross-configuration problems with similar approach as you described here. Qemu support has just been added to the latest pre release. Before that we used real devices and rsh kind a program that was executed using binfmt_misc (this is ofcourse still possible). Scratchbox also has other features that help cross-compilation. The next pre release (0.9.8-pre4) that will be released next week, will most likely come with ppc support also. Now sb has arm and x86 support. http://scratchbox.org/ - Veli On Sat, Feb 28, 2004 at 11:36:14AM +1000, James Boddington wrote: > Have been having a bit of a play. > > I used binfmt_misc to register qemu-ppc as the interpreter for ppc > binaries. This allows me to run ppc binaries on my athlon with out having > to specify qemu-ppc everytime. > > This seems to be usefull when cross compiling a few packages that create an > intermediate step that is built for the target instead of the build host. > The binary fails to run and the build process stops. Using binfmt_misc + > qemu-XXX allows this step to complete and the build can finish. > > For example texinfo-4.4 builds a binary part way though the build process > and tries to use that binary to process a few files. This binary has been > cross compiled and fails to run. Using the above idea I can cross compile > this package. > > Python 2.2.x is another offender. A python binary is built that is then > used to build python proper. The 1st python won't run because it is for > the wrong arch. Using binfmt_misc + qemu-ppc the build was going fine > until qemu-ppc seemed to go into a loop. Qemu-ppc sat just under 100% cpu > doing nothing obvious until I killed the process. > > Another use I have found for this is being able to chroot into a non native > filesystem. I cross compile my sparc images (x86 -> sparc) because it is a > lot quicker. So being able to chroot into the image is of interest to me. > > For this exercise I built a toolchain for ppc-unknown-linux-gnu and cross > compiled a small image. Placed a static qemu-ppc in opt/bin in the image. > I have not tried to see if it can self host yet. > > MAKEDEV bzip2 egg fileutils gcc gzip linux-headers ncurses sed tar wget > bash diffutils file findutils glibc kbd make patch sh-utils texinfo zlib > binutils ed filesystem gawk grep libtool mktemp procps shadow textutils > > /var/tmp/ppc-image, Sat Feb 28 11:19:51 > (root@fred) uname -a > Linux fred.bedrock 2.4.24 #3 Fri Feb 27 21:41:37 EST 2004 i686 unknown > unknown GNU/Linux > > /var/tmp/ppc-image, Sat Feb 28 11:19:54 > (root@fred) chroot . /opt/bin/qemu-ppc /bin/bash > > /, Sat Feb 28 01:20:03 > (root@fred) uname -a > Linux fred.bedrock 2.4.24 #3 Fri Feb 27 21:41:37 EST 2004 i686 unknown > unknown GNU/Linux > > /, Sat Feb 28 01:20:08 > (root@fred) file /bin/bash > /bin/bash: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 > (SYSV), for GNU/Linux 2.0.0, dynamically linked (uses shared libs), > stripped > > /, Sat Feb 28 01:20:15 > (root@fred) file /usr/bin/gcc > /usr/bin/gcc: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 > (SYSV), for GNU/Linux 2.0.0, dynamically linked (uses shared libs), > stripped > > /, Sat Feb 28 01:20:23 > (root@fred) /usr/bin/gcc -v > Reading specs from /usr/lib/gcc-lib/ppc-unknown-linux-gnu/3.3.3/specs > Configured with: ./configure --prefix=/usr --build=i686-pc-linux-gnu > --host=ppc-unknown-linux-gnu --target=ppc-unknown-linux-gnu --disable-nls > --enable-shared --enable-threads=posix --enable-languages=c,c++ > Thread model: posix > gcc version 3.3.3 > > -- > > James > > > > _______________________________________________ > Qemu-devel mailing list > Qemu-devel@nongnu.org > http://mail.nongnu.org/mailman/listinfo/qemu-devel