From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K6xFQ-00070M-Hi for qemu-devel@nongnu.org; Thu, 12 Jun 2008 20:34:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K6xFP-0006ze-QY for qemu-devel@nongnu.org; Thu, 12 Jun 2008 20:34:32 -0400 Received: from [199.232.76.173] (port=53117 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6xFP-0006zY-O1 for qemu-devel@nongnu.org; Thu, 12 Jun 2008 20:34:31 -0400 Received: from an-out-0708.google.com ([209.85.132.251]:25959) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K6xFP-0004b9-NK for qemu-devel@nongnu.org; Thu, 12 Jun 2008 20:34:31 -0400 Received: by an-out-0708.google.com with SMTP id d18so1281998and.130 for ; Thu, 12 Jun 2008 17:34:30 -0700 (PDT) Message-ID: <804dabb00806121734x6724b556j4c18a0af0cb94a5c@mail.gmail.com> Date: Fri, 13 Jun 2008 08:34:30 +0800 From: "Peter Teoh" In-Reply-To: <804dabb00806121014o3833c844l2ba7206cb17ed8dd@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <804dabb00806121014o3833c844l2ba7206cb17ed8dd@mail.gmail.com> Subject: [Qemu-devel] Re: requirements of root filesystem image when passed to qemu Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Fri, Jun 13, 2008 at 1:14 AM, Peter Teoh wrote: > First, after installing debian (8.04) on a qemu image - debian.cow - I > then used it to mount the latest kernel: > > qemu -kernel /boot/vmlinuz-2.6.26-rc5 -hda debian.cow -append > "root=/dev/hda console=ttyS0" -nographic > > [ 5.493332] 0300 1331200 hda driver: ide-disk > [ 5.494978] 0301 248976 hda1 > [ 5.496151] 0302 1076355 hda2 > [ 5.497403] No filesystem could mount root, tried: ext3 ext2 iso9660 > [ 5.499552] Kernel panic - not syncing: VFS: Unable to mount root > fs on unknown-block(3,0) > > But when I downloaded the root filesystem image at: > > http://bellard.org/qemu/download.html > > for linux-0.2.img, and execute: > > qemu -kernel /boot/vmlinuz-2.6.26-rc5 -hda linux-0.2.img -append > "root=/dev/hda console=ttyS0" -nographic > > everything went through to the root prompt level, even though the > linux-0.2.img image has its own kernel version (0.2). And I noticed > that (using "file"): > > linux-0.2.img: x86 boot sector, LInux i386 boot LOader > debian.cow: QEMU Copy-On-Write disk image version 1, size 0 + 1363148800 > > Next, using another rootfs image: > > file FedoraCore5-x86-root_fs > FedoraCore5-x86-root_fs: x86 boot sector > > I run qemu successfully. > > Next I entered ubuntu installation image: > > ubuntu-8.04-desktop-i386.iso: ISO 9660 CD-ROM filesystem data UDF > filesystem data (unknown version, id 'NSR01') 'Ubuntu 8.04 i386 > ' (bootable) > > qemu -kernel /boot/vmlinuz-2.6.26-rc5 -hda > ubuntu-8.04-desktop-i386.iso -append "root=/dev/hda console=ttyS0" > -nographic > > And the result is: > > [ 6.136373] Unable to load NLS charset utf8 > [ 6.144019] VFS: Mounted root (iso9660 filesystem) readonly. > [ 6.144826] debug: unmapping init memory c0795000..c07d4000 > [ 6.145575] Write protecting the kernel text: 2352k > [ 6.146417] Write protecting the kernel read-only data: 1068k > [ 6.147388] Warning: unable to open an initial console. > [ 6.148323] Kernel panic - not syncing: No init found. Try passing > init= option to kernel. > > So what is the requirement for -hda then? 1. presence of > bootsector image 2. presence of /sbin/init??? > > Next I created the busybox rootfs image following this instruction: > > http://dev.gentoo.org/~solar/busybox/bbemu > > And run qemu as before, just substituting only the -hda option, it result in: > > [ 5.564894] debug: unmapping init memory c0795000..c07d4000 > [ 5.565539] Write protecting the kernel text: 2352k > [ 5.565891] Write protecting the kernel read-only data: 1068k > [ 5.656106] mount used greatest stack depth: 2240 bytes left > Bummer, could not run '/bin/sh': No such file or directory > Bummer, could not run '/bin/sh': No such file or directory > Bummer, could not run '/etc/init.d/rcS': No such file or directory > Bummer, could not run '/bin/sh': No such file or directory > Bummer, could not run '/bin/sh': No such file or directory > Bummer, could not run '/bin/sh': No such file or directory > > Endless repetition here.. > > Why? > > Why the difference? (ie, why can't I mount the latest kernel on the > debian image) How to resolve the error as shown above? > > -- That was the last stage of booting - /sbin/init was executed, and endless repetition is due to the inittab's respawn mechanism. and instead of /bin/sh, which not sure was not created by bbemu, i changed it to /bin/msh, and it goes into a prompt. Thanks. -- Regards, Peter Teoh