qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] diskimage HOWTO
@ 2009-08-24  5:39 Bai Shuwei
  2009-08-24  7:48 ` Kevin Wolf
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Bai Shuwei @ 2009-08-24  5:39 UTC (permalink / raw)
  To: buildroot, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1561 bytes --]

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
   # mkfs.ext2 -m0 -Lslash /dev/loop0
   # mount -oloop,rw /dev/loop0 fs/
   # cp -a ../root/* fs/
..root is the filesystem built by BUILD-ROOT and the bzImage has been copied
into root/boot/, grub.lst has been created too.
  # umount fs/
  # losetup -d /dev/loop0
  # losetup /dev/loop0 img
  # grub --device-map=/dev/null
grub> device (hd0) img
device (hd0) img
grub> geometry (hd0) 16065 255 63
geometry (hd0) 16065 255 63
drive 0x80: C/H/S = 16065/255/63, The number of sectors = 258084225, img
   Partition num: 0,  Filesystem type unknown, partition type 0x83
grub> root (hd0,0)
root (hd0,0)
 Filesystem type unknown, partition type 0x83
grub> setup (hd0)
setup (hd0)

*Error 17: Cannot mount selected partition*
I don't know why it is error. Gald if you can help or give me some document
on it.

Best Regards!

Bai SHuwei






-- 
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

[-- Attachment #2: Type: text/html, Size: 2178 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Qemu-devel] diskimage HOWTO
  2009-08-24  5:39 [Qemu-devel] diskimage HOWTO Bai Shuwei
@ 2009-08-24  7:48 ` Kevin Wolf
  2009-08-24  8:30   ` Bai Shuwei
                     ` (2 more replies)
  2009-08-24 18:13 ` [Qemu-devel] Re: [Buildroot] " Steve Calfee
  2009-09-11  9:32 ` [Qemu-devel] " Richard W.M. Jones
  2 siblings, 3 replies; 15+ messages in thread
From: Kevin Wolf @ 2009-08-24  7:48 UTC (permalink / raw)
  To: Bai Shuwei; +Cc: buildroot, qemu-devel

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.

Kevin

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Qemu-devel] diskimage HOWTO
  2009-08-24  7:48 ` Kevin Wolf
@ 2009-08-24  8:30   ` Bai Shuwei
  2009-08-24 17:04   ` Mulyadi Santosa
  2009-08-25  7:28   ` Laurent Vivier
  2 siblings, 0 replies; 15+ messages in thread
From: Bai Shuwei @ 2009-08-24  8:30 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: buildroot, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1555 bytes --]

On 8/24/09, Kevin Wolf <kwolf@redhat.com> 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

[-- Attachment #2: Type: text/html, Size: 2465 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Qemu-devel] diskimage HOWTO
  2009-08-24  7:48 ` Kevin Wolf
  2009-08-24  8:30   ` Bai Shuwei
@ 2009-08-24 17:04   ` Mulyadi Santosa
  2009-08-25  3:55     ` Bai Shuwei
  2009-08-25  7:06     ` Kevin Wolf
  2009-08-25  7:28   ` Laurent Vivier
  2 siblings, 2 replies; 15+ messages in thread
From: Mulyadi Santosa @ 2009-08-24 17:04 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: buildroot, qemu-devel, Bai Shuwei

On Mon, Aug 24, 2009 at 2:48 PM, Kevin Wolf<kwolf@redhat.com> 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.

I agree, perhaps Bai should instead use 32256.

>From "man losetup":
-o, --offset offset
              The  data start is moved offset bytes into the specified file or
              device

So it has to be converted into bytes.

Bai, that could be the answer. Please kindly try it.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer
blog: the-hydra.blogspot.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Qemu-devel] Re: [Buildroot] diskimage HOWTO
  2009-08-24  5:39 [Qemu-devel] diskimage HOWTO Bai Shuwei
  2009-08-24  7:48 ` Kevin Wolf
@ 2009-08-24 18:13 ` Steve Calfee
  2009-09-11  9:32 ` [Qemu-devel] " Richard W.M. Jones
  2 siblings, 0 replies; 15+ messages in thread
From: Steve Calfee @ 2009-08-24 18:13 UTC (permalink / raw)
  To: buildroot, qemu-devel, Bai Shuwei

--- On Sun, 8/23/09, Bai Shuwei <baishuwei@gmail.com> wrote:

> From: Bai Shuwei <baishuwei@gmail.com>
> Subject: [Buildroot] diskimage HOWTO
> To: buildroot@busybox.net, qemu-devel@nongnu.org
> Date: Sunday, August 23, 2009, 10:39 PM
> 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,
> but failure. 
>  
Hi Bai,

I tried following those instructions and failed too. It is very complicated. There are 4 things that must be correct and in sync, the kernel, busybox, uclibc (compiler and filesystem), and bootstrap. 

Yesterday I did get things to run with qemu. I intend to update the docs when I can systematically get everything to work. For one thing on Ubuntu Jaunty I have not figured out how to get kqemu to install or work.... I have not mastered emulated ethernet either.

Anyway I built buildroot from a fairly recent git version - I suspect any older release will work. I took the defaults in all the configurations, the built-in configs are missing lots of the new options. This is curious, you do a make, it starts menuconfig, it thinks awhile and then another of the 4 main things wants to be menuconfiged. Anyway, I selected plain old 386 as my cpu and built with all the built in minimal options. It built the first time (way to go Peter!).

Originally, either by default or I mistakenly selected it, I built a rootfs.i386.jffs2 file system (from the buildroot make menuconfig). This did not work because the kernel did not know how to boot from anything but an ext2 or cramfs file system. There must be a kernel parameter to fix this, but I don't know what it is. So to get things going select an ext2 file system.

I discovered a gui interface for qemu, called "qemu launcher". Use that it simplifies things. You no longer have to build another disk image with your bootstrap and kernel inside with your root filesystem. No partitioning required etc. 

IN the GUI:

I pointed hard disk 0 to "/home/calfee/buildroot/buildroot/binaries/uclibc/rootfs.i386.ext2" boot disk: "Hard disk 0".

Then on the linux boot tab I checked "boot linux kernel directly", removing the need to fiddle with grub.

I put in kernel image "/home/calfee/buildroot/buildroot/binaries/uclibc/bzImage"

Then on the kernel command line I put root=/dev/hda

At this point press the launch button, and linux will boot and ask for your login. By default your username is root, with no password. Now you are running your built system!

I would like to get the diskimage instructions to work, people like me want to test on a known platform (their development PC) before jumping directly to test hardware, it reduces the unknowns.

If you get qemu ethernet working, please post an email with instructions.

Regards, Steve


      

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Qemu-devel] diskimage HOWTO
  2009-08-24 17:04   ` Mulyadi Santosa
@ 2009-08-25  3:55     ` Bai Shuwei
  2009-08-25  5:03       ` Mulyadi Santosa
  2009-08-25  7:06     ` Kevin Wolf
  1 sibling, 1 reply; 15+ messages in thread
From: Bai Shuwei @ 2009-08-25  3:55 UTC (permalink / raw)
  To: Mulyadi Santosa; +Cc: Kevin Wolf, buildroot, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1503 bytes --]

On 8/25/09, Mulyadi Santosa <mulyadi.santosa@gmail.com> wrote:
>
> On Mon, Aug 24, 2009 at 2:48 PM, Kevin Wolf<kwolf@redhat.com> 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.
>
> I agree, perhaps Bai should instead use 32256.
>
> From "man losetup":
> -o, --offset offset
>              The  data start is moved offset bytes into the specified file
> or
>              device
>
> So it has to be converted into bytes.
>
> Bai, that could be the answer. Please kindly try it.


Hi, all!
   Thanks!
   Yes, It's work now. I try 32256!

--
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer
> blog: the-hydra.blogspot.com
>



-- 
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

[-- Attachment #2: Type: text/html, Size: 2542 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Qemu-devel] diskimage HOWTO
  2009-08-25  3:55     ` Bai Shuwei
@ 2009-08-25  5:03       ` Mulyadi Santosa
  0 siblings, 0 replies; 15+ messages in thread
From: Mulyadi Santosa @ 2009-08-25  5:03 UTC (permalink / raw)
  To: Bai Shuwei; +Cc: Kevin Wolf, qemu-devel

On Tue, Aug 25, 2009 at 10:55 AM, Bai Shuwei<baishuwei@gmail.com> wrote:
> Hi, all!
>    Thanks!
>    Yes, It's work now. I try 32256!

Glad you make it! If you don't mind, perhaps you can write it down as
short HOWTO and post it to Qemu Wiki. Just to prevent others repeating
this mistake.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer
blog: the-hydra.blogspot.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Qemu-devel] diskimage HOWTO
  2009-08-24 17:04   ` Mulyadi Santosa
  2009-08-25  3:55     ` Bai Shuwei
@ 2009-08-25  7:06     ` Kevin Wolf
  2009-08-25  7:32       ` Mulyadi Santosa
  1 sibling, 1 reply; 15+ messages in thread
From: Kevin Wolf @ 2009-08-25  7:06 UTC (permalink / raw)
  To: Mulyadi Santosa; +Cc: qemu-devel, Bai Shuwei

Mulyadi Santosa schrieb:
> On Mon, Aug 24, 2009 at 2:48 PM, Kevin Wolf<kwolf@redhat.com> 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.
> 
> I agree, perhaps Bai should instead use 32256.
> 
> From "man losetup":
> -o, --offset offset
>               The  data start is moved offset bytes into the specified file or
>               device
> 
> So it has to be converted into bytes.
> 
> Bai, that could be the answer. Please kindly try it.

You shouldn't have removed half of my answer. Using kpartx is so much
easier than fiddling around with offsets.

Kevin

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Qemu-devel] diskimage HOWTO
  2009-08-24  7:48 ` Kevin Wolf
  2009-08-24  8:30   ` Bai Shuwei
  2009-08-24 17:04   ` Mulyadi Santosa
@ 2009-08-25  7:28   ` Laurent Vivier
  2 siblings, 0 replies; 15+ messages in thread
From: Laurent Vivier @ 2009-08-25  7:28 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: buildroot, qemu-devel, Bai Shuwei

Le lundi 24 août 2009 à 09:48 +0200, Kevin Wolf a écrit :
> 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.

You can also use loop module with max_part parameter (on a recent
kernel, 2.6.26, I think):

# rmmod loop
# modprobe loop max_part=16
# losetup -f /dev/loop0
# mount /dev/loop0p1 /mnt

If the disk image format is qcow2 you can use nbd module with max_part
parameter and qemu-nbd.

Regards,
Laurent
-- 
--------------------- laurent@vivier.eu ----------------------
"Tout ce qui est impossible reste à accomplir"    Jules Verne
"Things are only impossible until they're not" Jean-Luc Picard

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Qemu-devel] diskimage HOWTO
  2009-08-25  7:06     ` Kevin Wolf
@ 2009-08-25  7:32       ` Mulyadi Santosa
  2009-08-25  7:37         ` Kevin Wolf
  0 siblings, 1 reply; 15+ messages in thread
From: Mulyadi Santosa @ 2009-08-25  7:32 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel, Bai Shuwei

On Tue, Aug 25, 2009 at 2:06 PM, Kevin Wolf<kwolf@redhat.com> wrote:
> You shouldn't have removed half of my answer. Using kpartx is so much
> easier than fiddling around with offsets.

Sorry for that Kevin. I was focusing on losetup, because that's the
one I am familiar of. Could you kindly demonstrate how to use kpartx
in this case? Thanks in advance...


-- 
regards,

Mulyadi Santosa
Freelance Linux trainer
blog: the-hydra.blogspot.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Qemu-devel] diskimage HOWTO
  2009-08-25  7:32       ` Mulyadi Santosa
@ 2009-08-25  7:37         ` Kevin Wolf
  2009-08-25  7:41           ` Mulyadi Santosa
  0 siblings, 1 reply; 15+ messages in thread
From: Kevin Wolf @ 2009-08-25  7:37 UTC (permalink / raw)
  To: Mulyadi Santosa; +Cc: qemu-devel, Bai Shuwei

Mulyadi Santosa schrieb:
> On Tue, Aug 25, 2009 at 2:06 PM, Kevin Wolf<kwolf@redhat.com> wrote:
>> You shouldn't have removed half of my answer. Using kpartx is so much
>> easier than fiddling around with offsets.
> 
> Sorry for that Kevin. I was focusing on losetup, because that's the
> one I am familiar of. Could you kindly demonstrate how to use kpartx
> in this case? Thanks in advance...

You would use "kpartx -a test.img" which creates devices like
/dev/mapper/loop0p1 for each partition. You can work with it like you
would do with losetup and afterwards remove it with "kpartx -d test.img".

But actually Laurent's solution doesn't look too bad either. Didn't know
about it until now.

Kevin

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Qemu-devel] diskimage HOWTO
  2009-08-25  7:37         ` Kevin Wolf
@ 2009-08-25  7:41           ` Mulyadi Santosa
  2009-08-25  8:48             ` Bai Shuwei
  0 siblings, 1 reply; 15+ messages in thread
From: Mulyadi Santosa @ 2009-08-25  7:41 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel, Bai Shuwei

On Tue, Aug 25, 2009 at 2:37 PM, Kevin Wolf<kwolf@redhat.com> wrote:

> You would use "kpartx -a test.img" which creates devices like
> /dev/mapper/loop0p1 for each partition. You can work with it like you
> would do with losetup and afterwards remove it with "kpartx -d test.img".
>
> But actually Laurent's solution doesn't look too bad either. Didn't know
> about it until now.
>
> Kevin
>

Thanks for the kind example, Kevin. Couple nice lessons I got today :)
Not bad to me too as well

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer
blog: the-hydra.blogspot.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Qemu-devel] diskimage HOWTO
  2009-08-25  7:41           ` Mulyadi Santosa
@ 2009-08-25  8:48             ` Bai Shuwei
  0 siblings, 0 replies; 15+ messages in thread
From: Bai Shuwei @ 2009-08-25  8:48 UTC (permalink / raw)
  To: Mulyadi Santosa; +Cc: Kevin Wolf, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1496 bytes --]

Hi, Kevin:
   I am not familiar the kpartx too. this is the result, I think I should
rebuild my kernel to support device-mapper :(

weslab:/home/baishw/crosscompile/qemu/xtratum# kpartx -l rootfs
/proc/misc: No entry for device-mapper found
Is device-mapper driver missing from kernel?
Failure to communicate with kernel device-mapper driver.
/proc/misc: No entry for device-mapper found
Is device-mapper driver missing from kernel?
Failure to communicate with kernel device-mapper driver.
Incompatible libdevmapper 1.02.27 (2008-06-25)(compat) and kernel driver
loop1p1 : 0 128457 /dev/loop1 63




On 8/25/09, Mulyadi Santosa <mulyadi.santosa@gmail.com> wrote:
>
> On Tue, Aug 25, 2009 at 2:37 PM, Kevin Wolf<kwolf@redhat.com> wrote:
>
> > You would use "kpartx -a test.img" which creates devices like
> > /dev/mapper/loop0p1 for each partition. You can work with it like you
> > would do with losetup and afterwards remove it with "kpartx -d test.img".
> >
> > But actually Laurent's solution doesn't look too bad either. Didn't know
> > about it until now.
> >
> > Kevin
> >
>
> Thanks for the kind example, Kevin. Couple nice lessons I got today :)
> Not bad to me too as well
>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer
> blog: the-hydra.blogspot.com
>



-- 
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

[-- Attachment #2: Type: text/html, Size: 2240 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Qemu-devel] diskimage HOWTO
  2009-08-24  5:39 [Qemu-devel] diskimage HOWTO Bai Shuwei
  2009-08-24  7:48 ` Kevin Wolf
  2009-08-24 18:13 ` [Qemu-devel] Re: [Buildroot] " Steve Calfee
@ 2009-09-11  9:32 ` Richard W.M. Jones
       [not found]   ` <87ab11vhza.fsf@macbook.be.48ers.dk>
  2 siblings, 1 reply; 15+ messages in thread
From: Richard W.M. Jones @ 2009-09-11  9:32 UTC (permalink / raw)
  To: Bai Shuwei; +Cc: buildroot, qemu-devel

On Mon, Aug 24, 2009 at 01:39:53PM +0800, Bai Shuwei wrote:
> 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
>    # mkfs.ext2 -m0 -Lslash /dev/loop0
>    # mount -oloop,rw /dev/loop0 fs/

You may find that libguestfs is better for this sort of thing.  It
doesn't need you to be root for a start.

You'd do something like:

$ guestfish <<EOF
alloc img 64M
run
sfdiskM /dev/sda ,
mkfs ext2 /dev/sda1
EOF

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 75 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Qemu-devel] diskimage HOWTO
       [not found]   ` <87ab11vhza.fsf@macbook.be.48ers.dk>
@ 2009-09-11 11:38     ` Richard W.M. Jones
  0 siblings, 0 replies; 15+ messages in thread
From: Richard W.M. Jones @ 2009-09-11 11:38 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: buildroot, qemu-devel, Bai Shuwei

On Fri, Sep 11, 2009 at 01:27:53PM +0200, Peter Korsgaard wrote:
> >>>>> "Richard" == Richard W M Jones <rjones@redhat.com> writes:
> 
> Hi,
> 
>  Richard> You may find that libguestfs is better for this sort of thing.  It
>  Richard> doesn't need you to be root for a start.
> 
> Nice - Never heard about libguestfs before, and it isn't in Debian - You
> should get non-redhat dists to include it as well ;)

It's in Debian, although not in the formal repositories yet:

http://libguestfs.org/FAQ.html#binaries
http://pkg-libvirt.alioth.debian.org/packages/unstable/

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2009-09-11 11:38 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-24  5:39 [Qemu-devel] diskimage HOWTO Bai Shuwei
2009-08-24  7:48 ` Kevin Wolf
2009-08-24  8:30   ` Bai Shuwei
2009-08-24 17:04   ` Mulyadi Santosa
2009-08-25  3:55     ` Bai Shuwei
2009-08-25  5:03       ` Mulyadi Santosa
2009-08-25  7:06     ` Kevin Wolf
2009-08-25  7:32       ` Mulyadi Santosa
2009-08-25  7:37         ` Kevin Wolf
2009-08-25  7:41           ` Mulyadi Santosa
2009-08-25  8:48             ` Bai Shuwei
2009-08-25  7:28   ` Laurent Vivier
2009-08-24 18:13 ` [Qemu-devel] Re: [Buildroot] " Steve Calfee
2009-09-11  9:32 ` [Qemu-devel] " Richard W.M. Jones
     [not found]   ` <87ab11vhza.fsf@macbook.be.48ers.dk>
2009-09-11 11:38     ` Richard W.M. Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).