From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MfUxA-0001l5-Lm for qemu-devel@nongnu.org; Mon, 24 Aug 2009 04:31:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MfUx5-0001kr-Vg for qemu-devel@nongnu.org; Mon, 24 Aug 2009 04:31:00 -0400 Received: from [199.232.76.173] (port=54960 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfUx5-0001ko-Qq for qemu-devel@nongnu.org; Mon, 24 Aug 2009 04:30:55 -0400 Received: from an-out-0708.google.com ([209.85.132.242]:28311) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MfUx5-0004jV-CD for qemu-devel@nongnu.org; Mon, 24 Aug 2009 04:30:55 -0400 Received: by an-out-0708.google.com with SMTP id c38so701871ana.37 for ; Mon, 24 Aug 2009 01:30:54 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4A9245EA.9030108@redhat.com> References: <4A9245EA.9030108@redhat.com> Date: Mon, 24 Aug 2009 16:30:54 +0800 Message-ID: Subject: Re: [Qemu-devel] diskimage HOWTO From: Bai Shuwei Content-Type: multipart/alternative; boundary=001636b2b8e74f260a0471df09bc List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: buildroot@busybox.net, qemu-devel@nongnu.org --001636b2b8e74f260a0471df09bc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 8/24/09, Kevin Wolf wrote: > > Bai Shuwei schrieb: > > Hi, All: > > I want to build a test enviroment with QEMU and buildroot. But I don't > > know how to build the diskimage which same as linux-0.2.img offered by > > BUILD-ROOT. I build the diskimage following the > > buildroot-2009.05/docs/README.diskimage > > < > http://192.168.1.102/crosscopile/buildroot-2009.05/docs/README.diskimage>, > > but failure. > > > > The bellow is my process. > > > > # dd if=/dev/zero of=img bs=4096 count=16384 > > # echo -e "n\np\n1\n\nw\n" | fdisk -C 16065 -H 255 -S 63 ./img > > # losetup -o 512 /dev/loop0 img > > This looks like the wrong offset. The first partition usually starts at > sector 63. But probably you'll want to use kpartx which takes an image > and creates device nodes for each partition. This the result qemu/xtratum# fdisk -ul img You must set cylinders. You can do this from the extra functions menu. Disk rootfs: 0 MB, 0 bytes 255 heads, 63 sectors/track, 0 cylinders, total 0 sectors Units = sectors of 1 * 512 = 512 bytes Disk identifier: 0x545a5c26 Device Boot Start End Blocks Id System img1 63 258084224 129042081 83 Linux Partition 1 has different physical/logical endings: phys=(1023, 254, 63) logical=(16064, 254, 63) Kevin > -- Love other people, as same as love yourself! Don't think all the time, do it by your hands! Personal URL: http://dslab.lzu.edu.cn:8080/members/baishw/ E-Mail: baishuwei@gmail.com or baishuwei@dslab.lzu.edu.cn --001636b2b8e74f260a0471df09bc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 8/24/09, = Kevin Wolf <kwolf@redhat.com= > wrote:
Bai Shuwei schrieb:
> Hi, = All:
>=C2=A0=C2=A0 I want to build a test enviroment with QEMU and bu= ildroot. But I don't
> know how to build the diskimage which same as linux-0.2.img offered by=
> BUILD-ROOT. I build the diskimage following the
>=C2=A0=C2= =A0=C2=A0=C2=A0buildroot-2009.05/docs/README.diskimage
> <http://192.168.1.102/crosscopile/buildroot-2009.05/docs/README.diskimage= >,
> but failure.
>
>=C2=A0=C2=A0=C2=A0=C2=A0The bellow is my p= rocess.
>
>=C2=A0=C2=A0=C2=A0=C2=A0# dd if=3D/dev/zero of=3Dimg= bs=3D4096 count=3D16384
>=C2=A0=C2=A0=C2=A0=C2=A0# echo -e "n\n= p\n1\n\nw\n" | fdisk -C 16065 -H 255 -S 63 ./img
>=C2=A0=C2=A0= =C2=A0=C2=A0# losetup -o 512 /dev/loop0 img

This looks like the wrong offset. The first partition usually starts at=
sector 63. But probably you'll want to use kpartx which takes an im= age
and creates device nodes for each partition.
=C2=A0
This the result

qemu/xtratum# fdisk -ul img

You must set cylinders.
You can do this from the extra functions menu= .

Disk rootfs: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders, = total 0 sectors
Units =3D sectors of 1 * 512 =3D 512 bytes
Disk ident= ifier: 0x545a5c26

=C2=A0Device Boot=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Start=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 End=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Blocks=C2= =A0=C2=A0 Id=C2=A0 System
img1=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 63=C2=A0=C2=A0 258084224=C2=A0=C2=A0 1= 29042081=C2=A0=C2=A0 83=C2=A0 Linux
Partition 1 has different physical/l= ogical endings:
=C2=A0=C2=A0=C2=A0=C2=A0 phys=3D(1023, 254, 63) logical= =3D(16064, 254, 63)


Kevin

=

--
Love other people, as same as love yourself! Don't think all the time, do it by your hands!

Personal URL: http://dslab.lzu.edu.= cn:8080/members/baishw/
E-Mail: baishuwei@gmail.com or baishuwei@dslab.lzu.edu.cn
--001636b2b8e74f260a0471df09bc--