From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QutIj-0003N8-Vu for qemu-devel@nongnu.org; Sat, 20 Aug 2011 17:41:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QutIi-0004wI-HA for qemu-devel@nongnu.org; Sat, 20 Aug 2011 17:41:57 -0400 Received: from mail-gw0-f45.google.com ([74.125.83.45]:50696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QutIi-0004wC-DY for qemu-devel@nongnu.org; Sat, 20 Aug 2011 17:41:56 -0400 Received: by gwb19 with SMTP id 19so2807678gwb.4 for ; Sat, 20 Aug 2011 14:41:55 -0700 (PDT) Message-ID: <4E502A20.8020505@landley.net> Date: Sat, 20 Aug 2011 16:41:52 -0500 From: Rob Landley MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Help]: How to setup a VM based on kernel source code. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Zhi Yong Wu Cc: Stefan Hajnoczi , qemu-devel@nongnu.org, kvm@vger.kernel.org On 08/19/2011 04:58 AM, Zhi Yong Wu wrote: > HI, > > I have met one scenario; currently i want to set up a VM based on > latest kernel tree; but i only have latest kernel source code and > compiled it on one fedora 15 workstation. To achieve the objective, > what actions should i take next step? use -kernel -initrd options? > other ways? > > If you have this experience, pls give me one hand. thanks. I've done this, the project is at http://landley.net/aboriginal It a big bash script that: A) downloads source code B) builds a cross compiler (for any of a dozen targets) C) builds a new root filesystem and kernel E) packages it up into a system image qemu can boot. The system images include shell scripts that invoke qemu with the appropriate command line arguments. You can download the build scritps here: http://landley.net/aboriginal/downloads You can download prebuilt binary tarballs for each supported target here: http://landley.net/aboriginal/downloads/binaries What you probably want to do is grab something like system-image-armv5l.tar.bz2, extract it, "./run-emulator.sh" (which should give you a shell prompt inside the emulator, type "exit" when done), and then once you're happy it works for you look at the run-emulator.sh script to see how it's invoking qemu, then look at the build scripts to see how it's compiling everything. (There's no make magic or python or anything in there, it's all just bash scripts.) Each of those system images has the relevant config files used to build the kernel, uClibc, and busybox in the /usr/src directory. A few years ago I wrote up a giant lump of documentation here: http://landley.net/aboriginal/downloads/presentation.pdf I'm putting together a 1.0.3 release with Linux 3.0, busybox 1.19.0, and uClibc 0.9.32 this weekend. If you don't want to wait for the release, go to http;//landley.net/hg/aboriginal and click on one of the download links near the top to get a tarball of the current build scripts from source control. Rob