Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Creating a filesystem for QEMU
@ 2009-11-12 14:23 Bogdan Cristea
  2009-11-12 14:58 ` Lionel Landwerlin
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Bogdan Cristea @ 2009-11-12 14:23 UTC (permalink / raw)
  To: buildroot

    I am trying to use QEMU for development of embedded systems using Real 
Time Linux. Buildroot seems to be the tool I need, but I still don't know how 
to build a disk image recognized by QEMU. Right now I am trying to use only 
x86 and x86_64 architectures.
    Does anyone know how to build a file system usable in QEMU ?

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

* [Buildroot] Creating a filesystem for QEMU
  2009-11-12 14:23 [Buildroot] Creating a filesystem for QEMU Bogdan Cristea
@ 2009-11-12 14:58 ` Lionel Landwerlin
  2009-11-12 15:03   ` Bogdan Cristea
  2009-11-12 15:04 ` Chris Packham
       [not found] ` <4AFC1FC8.3020305@gmail.com>
  2 siblings, 1 reply; 14+ messages in thread
From: Lionel Landwerlin @ 2009-11-12 14:58 UTC (permalink / raw)
  To: buildroot

Hi Bogdan,

You have a lot of option :


   - You can generate a cloop root filesystem using buildroot, and then
   convert it to the format you want using qemu-img
   - Create an initramfs, and boot it using qemu
   - Create an ext2 filesystem and write it on a qemu disk through an
   install cdrom
   - and so on....

Regards,

--
Lionel

On Thu, Nov 12, 2009 at 3:23 PM, Bogdan Cristea <cristeab@gmail.com> wrote:

>    I am trying to use QEMU for development of embedded systems using Real
> Time Linux. Buildroot seems to be the tool I need, but I still don't know
> how
> to build a disk image recognized by QEMU. Right now I am trying to use only
> x86 and x86_64 architectures.
>    Does anyone know how to build a file system usable in QEMU ?
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20091112/bbb95787/attachment.htm>

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

* [Buildroot] Creating a filesystem for QEMU
  2009-11-12 14:58 ` Lionel Landwerlin
@ 2009-11-12 15:03   ` Bogdan Cristea
  2009-11-12 15:14     ` Lionel Landwerlin
  2009-11-12 15:22     ` Mark Constable
  0 siblings, 2 replies; 14+ messages in thread
From: Bogdan Cristea @ 2009-11-12 15:03 UTC (permalink / raw)
  To: buildroot

On Thursday 12 November 2009 16:58:15 you wrote:
>   - You can generate a cloop root filesystem using buildroot, and then
>    convert it to the format you want using qemu-img
>    - Create an initramfs, and boot it using qemu
>    - Create an ext2 filesystem and write it on a qemu disk through an
>    install cdrom
>    - and so on....
> 
   Thank you for your feedback, I'll try to explore these options in the next 
days. IMHO it could be extremely useful to have these indications into the 
help page of buildroot.
   Could you expand a little more the last option (Create an ext2 filesystem 
and write it on a qemu disk through an install cdrom). I don't understand that 
part.

thanks
Bogdan

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

* [Buildroot] Creating a filesystem for QEMU
  2009-11-12 14:23 [Buildroot] Creating a filesystem for QEMU Bogdan Cristea
  2009-11-12 14:58 ` Lionel Landwerlin
@ 2009-11-12 15:04 ` Chris Packham
       [not found] ` <4AFC1FC8.3020305@gmail.com>
  2 siblings, 0 replies; 14+ messages in thread
From: Chris Packham @ 2009-11-12 15:04 UTC (permalink / raw)
  To: buildroot

On Thu, Nov 12, 2009 at 9:23 AM, Bogdan Cristea <cristeab@gmail.com> wrote:
> ? ?I am trying to use QEMU for development of embedded systems using Real
> Time Linux. Buildroot seems to be the tool I need, but I still don't know how
> to build a disk image recognized by QEMU. Right now I am trying to use only
> x86 and x86_64 architectures.
> ? ?Does anyone know how to build a file system usable in QEMU ?
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>

I've just started doing the same thing myself.  After a bit of googling
the trick I found was to ask buildroot to generate a cpio target file
system. Start with the i386_defconfig or i686_defconfig and set
BR2_TARGET_ROOTFS_CPIO=y (or use "make menuconfig" an find the cpio
option under the "Target file system" menu)

Making use of qemus ability to replace the bootloader you can invoke
qemu with

   qemu -kernel output/images/bzImage \
        -initrd output/images/rootfs.i686.cpio

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

* [Buildroot] Creating a filesystem for QEMU
  2009-11-12 15:03   ` Bogdan Cristea
@ 2009-11-12 15:14     ` Lionel Landwerlin
  2009-11-12 15:22     ` Mark Constable
  1 sibling, 0 replies; 14+ messages in thread
From: Lionel Landwerlin @ 2009-11-12 15:14 UTC (permalink / raw)
  To: buildroot

Once your have created an ext2 filesystem you can boot a debian cdrom image
(for example), edit partitions from the debian rescue console and write the
ext2 filesystem using dd.
Then mount the filesystem and run some grub-install to get the bootloader
installed.
Or just boot with a vmlinux using the -kernel qemu option (if I remember
correctly).

Regards,

On Thu, Nov 12, 2009 at 4:03 PM, Bogdan Cristea <cristeab@gmail.com> wrote:

> On Thursday 12 November 2009 16:58:15 you wrote:
> >   - You can generate a cloop root filesystem using buildroot, and then
> >    convert it to the format you want using qemu-img
> >    - Create an initramfs, and boot it using qemu
> >    - Create an ext2 filesystem and write it on a qemu disk through an
> >    install cdrom
> >    - and so on....
> >
>    Thank you for your feedback, I'll try to explore these options in the
> next
> days. IMHO it could be extremely useful to have these indications into the
> help page of buildroot.
>   Could you expand a little more the last option (Create an ext2 filesystem
> and write it on a qemu disk through an install cdrom). I don't understand
> that
> part.
>
> thanks
> Bogdan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20091112/0123f1c1/attachment.htm>

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

* [Buildroot] Creating a filesystem for QEMU
  2009-11-12 15:03   ` Bogdan Cristea
  2009-11-12 15:14     ` Lionel Landwerlin
@ 2009-11-12 15:22     ` Mark Constable
  1 sibling, 0 replies; 14+ messages in thread
From: Mark Constable @ 2009-11-12 15:22 UTC (permalink / raw)
  To: buildroot

Bogdan Cristea wrote:
>    Thank you for your feedback, I'll try to explore these options in the next 
> days. IMHO it could be extremely useful to have these indications into the 
> help page of buildroot.
>    Could you expand a little more the last option (Create an ext2 filesystem 
> and write it on a qemu disk through an install cdrom). I don't understand that 
> part.

It's also possible to loop mount a qemu image if you do not
use -f qcow...

> qemu-img create qemu.img 4G
> mount -o loop,offset=32256 qemu.img /mnt

then, for instance, if you created a tarball from Buildroot
then you should be able to extract the tarball to a temp
directory and rsync -av /temp/ /mnt

I haven't tried this but it might work.

--markc

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

* [Buildroot] Creating a filesystem for QEMU
       [not found] ` <4AFC1FC8.3020305@gmail.com>
@ 2009-11-13 13:18   ` Bogdan Cristea
  2009-11-13 13:56     ` Lionel Landwerlin
       [not found]     ` <a038bef50911130559i31605c47k57d27e91d95b28f8@mail.gmail.com>
  0 siblings, 2 replies; 14+ messages in thread
From: Bogdan Cristea @ 2009-11-13 13:18 UTC (permalink / raw)
  To: buildroot

On Thursday 12 November 2009 16:46:32 you wrote:
> I've just started doing the same thing myself.  After a bit of googling
> the trick I found was to ask buildroot to generate a cpio target file
> system. Start with the i386_defconfig or i686_defconfig and set
> BR2_TARGET_ROOTFS_CPIO=y (or use "make menuconfig" an find the cpio
> option under the "Target file system" menu)
> 
> Making use of qemus ability to replace the bootloader you can invoke
> qemu with
>     qemu -kernel output/images/bzImage \
>          -initrd output/images/rootfs.i686.cpio
> 
     I have tried this approach, but it does not seem to work. First 
inconvenient is that rootfs.i686.cpio file is very large (600 MB) and when 
using the above command I only get a black screen from QEMU while the entire 
computer seems to be slower. 
    Lionel, suggested other approaches but till now I have no luck. Trying to 
obtain first a cloop root filesystem and then convert that to a QEMU format 
seem to work and the file size is small (3 MB), but still when using that disk 
image, QEMU is not able to recognize any root partition.
    If you have any other suggestion it would be helpful.

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

* [Buildroot] Creating a filesystem for QEMU
  2009-11-13 13:18   ` Bogdan Cristea
@ 2009-11-13 13:56     ` Lionel Landwerlin
  2009-11-13 13:57       ` Lionel Landwerlin
       [not found]     ` <a038bef50911130559i31605c47k57d27e91d95b28f8@mail.gmail.com>
  1 sibling, 1 reply; 14+ messages in thread
From: Lionel Landwerlin @ 2009-11-13 13:56 UTC (permalink / raw)
  To: buildroot

On Fri, Nov 13, 2009 at 2:18 PM, Bogdan Cristea <cristeab@gmail.com> wrote:

> On Thursday 12 November 2009 16:46:32 you wrote:
> > I've just started doing the same thing myself.  After a bit of googling
> > the trick I found was to ask buildroot to generate a cpio target file
> > system. Start with the i386_defconfig or i686_defconfig and set
> > BR2_TARGET_ROOTFS_CPIO=y (or use "make menuconfig" an find the cpio
> > option under the "Target file system" menu)
> >
> > Making use of qemus ability to replace the bootloader you can invoke
> > qemu with
> >     qemu -kernel output/images/bzImage \
> >          -initrd output/images/rootfs.i686.cpio
>

Shouldn't be the cpio image gunzipped ? :

$ file /boot/initrd.img-2.6.30-2-686
/boot/initrd.img-2.6.30-2-686: gzip compressed data, from Unix, last
modified: Fri Nov 13 09:08:02 2009
$ gunzip -c /boot/initrd.img-2.6.30-2-686 > test
$ file test
test: ASCII cpio archive (SVR4 with no CRC)



> >
>      I have tried this approach, but it does not seem to work. First
> inconvenient is that rootfs.i686.cpio file is very large (600 MB) and when
> using the above command I only get a black screen from QEMU while the
> entire
> computer seems to be slower.
>    Lionel, suggested other approaches but till now I have no luck. Trying
> to
> obtain first a cloop root filesystem and then convert that to a QEMU format
> seem to work and the file size is small (3 MB), but still when using that
> disk
> image, QEMU is not able to recognize any root partition.
>    If you have any other suggestion it would be helpful.
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20091113/44a0bbd1/attachment.htm>

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

* [Buildroot] Creating a filesystem for QEMU
  2009-11-13 13:56     ` Lionel Landwerlin
@ 2009-11-13 13:57       ` Lionel Landwerlin
  2009-11-13 14:03         ` Chris Packham
  0 siblings, 1 reply; 14+ messages in thread
From: Lionel Landwerlin @ 2009-11-13 13:57 UTC (permalink / raw)
  To: buildroot

On Fri, Nov 13, 2009 at 2:56 PM, Lionel Landwerlin <llandwerlin@gmail.com>wrote:

>
>
> On Fri, Nov 13, 2009 at 2:18 PM, Bogdan Cristea <cristeab@gmail.com>wrote:
>
>> On Thursday 12 November 2009 16:46:32 you wrote:
>> > I've just started doing the same thing myself.  After a bit of googling
>> > the trick I found was to ask buildroot to generate a cpio target file
>> > system. Start with the i386_defconfig or i686_defconfig and set
>> > BR2_TARGET_ROOTFS_CPIO=y (or use "make menuconfig" an find the cpio
>> > option under the "Target file system" menu)
>> >
>> > Making use of qemus ability to replace the bootloader you can invoke
>> > qemu with
>> >     qemu -kernel output/images/bzImage \
>> >          -initrd output/images/rootfs.i686.cpio
>>
>
> Shouldn't be the cpio image gunzipped ? :
>

I mean gzipped of course...


>
> $ file /boot/initrd.img-2.6.30-2-686
> /boot/initrd.img-2.6.30-2-686: gzip compressed data, from Unix, last
> modified: Fri Nov 13 09:08:02 2009
> $ gunzip -c /boot/initrd.img-2.6.30-2-686 > test
> $ file test
> test: ASCII cpio archive (SVR4 with no CRC)
>
>
>
>>  >
>>      I have tried this approach, but it does not seem to work. First
>> inconvenient is that rootfs.i686.cpio file is very large (600 MB) and when
>> using the above command I only get a black screen from QEMU while the
>> entire
>> computer seems to be slower.
>>    Lionel, suggested other approaches but till now I have no luck. Trying
>> to
>> obtain first a cloop root filesystem and then convert that to a QEMU
>> format
>> seem to work and the file size is small (3 MB), but still when using that
>> disk
>> image, QEMU is not able to recognize any root partition.
>>    If you have any other suggestion it would be helpful.
>> _______________________________________________
>> buildroot mailing list
>> buildroot at busybox.net
>> http://lists.busybox.net/mailman/listinfo/buildroot
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20091113/600e9bb1/attachment.htm>

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

* [Buildroot] Creating a filesystem for QEMU
  2009-11-13 13:57       ` Lionel Landwerlin
@ 2009-11-13 14:03         ` Chris Packham
  2009-11-13 14:10           ` Lionel Landwerlin
  0 siblings, 1 reply; 14+ messages in thread
From: Chris Packham @ 2009-11-13 14:03 UTC (permalink / raw)
  To: buildroot

On Fri, Nov 13, 2009 at 8:57 AM, Lionel Landwerlin
<llandwerlin@gmail.com> wrote:
>>> > Making use of qemus ability to replace the bootloader you can invoke
>>> > qemu with
>>> > ? ? qemu -kernel output/images/bzImage \
>>> > ? ? ? ? ?-initrd output/images/rootfs.i686.cpio
>>
>> Shouldn't be the cpio image gunzipped ? :
>
> I mean gzipped of course...

Unzipped works for me. The cpio target makes 2 files. rootfs.ARCH.cpio
and rootfs.ARCH.cpio.gz.
I just tried the .gz file and that works too.

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

* [Buildroot] Creating a filesystem for QEMU
  2009-11-13 14:03         ` Chris Packham
@ 2009-11-13 14:10           ` Lionel Landwerlin
  0 siblings, 0 replies; 14+ messages in thread
From: Lionel Landwerlin @ 2009-11-13 14:10 UTC (permalink / raw)
  To: buildroot

On Fri, Nov 13, 2009 at 3:03 PM, Chris Packham <judge.packham@gmail.com>wrote:

> On Fri, Nov 13, 2009 at 8:57 AM, Lionel Landwerlin
> <llandwerlin@gmail.com> wrote:
> >>> > Making use of qemus ability to replace the bootloader you can invoke
> >>> > qemu with
> >>> >     qemu -kernel output/images/bzImage \
> >>> >          -initrd output/images/rootfs.i686.cpio
> >>
> >> Shouldn't be the cpio image gunzipped ? :
> >
> > I mean gzipped of course...
>
> Unzipped works for me. The cpio target makes 2 files. rootfs.ARCH.cpio
> and rootfs.ARCH.cpio.gz.
> I just tried the .gz file and that works too.
>

In fact the 600Mb cpio archive is probably the problem ;)
Maybe the Qemu hardware configuation hasn't enough ram.

Bogdan: You should probably avoid building things like WebKit at least in
initrd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20091113/3cd96b81/attachment-0001.htm>

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

* [Buildroot] Creating a filesystem for QEMU
       [not found]     ` <a038bef50911130559i31605c47k57d27e91d95b28f8@mail.gmail.com>
@ 2009-11-13 14:46       ` Bogdan Cristea
  2009-11-13 15:14         ` Chris Packham
  0 siblings, 1 reply; 14+ messages in thread
From: Bogdan Cristea @ 2009-11-13 14:46 UTC (permalink / raw)
  To: buildroot

On Friday 13 November 2009 15:59:46 you wrote:
> On Fri, Nov 13, 2009 at 8:18 AM, Bogdan Cristea <cristeab@gmail.com> wrote:
> > On Thursday 12 November 2009 16:46:32 you wrote:
> >> I've just started doing the same thing myself.  After a bit of googling
> >> the trick I found was to ask buildroot to generate a cpio target file
> >> system. Start with the i386_defconfig or i686_defconfig and set
> >> BR2_TARGET_ROOTFS_CPIO=y (or use "make menuconfig" an find the cpio
> >> option under the "Target file system" menu)
> >>
> >> Making use of qemus ability to replace the bootloader you can invoke
> >> qemu with
> >>     qemu -kernel output/images/bzImage \
> >>          -initrd output/images/rootfs.i686.cpio
> >
> >     I have tried this approach, but it does not seem to work. First
> > inconvenient is that rootfs.i686.cpio file is very large (600 MB) and
> > when using the above command I only get a black screen from QEMU while
> > the entire computer seems to be slower.
> >    Lionel, suggested other approaches but till now I have no luck. Trying
> > to obtain first a cloop root filesystem and then convert that to a QEMU
> > format seem to work and the file size is small (3 MB), but still when
> > using that disk image, QEMU is not able to recognize any root partition.
> >    If you have any other suggestion it would be helpful.
> 
> I'd double check your configuration. I must admit I started hacking
> away without looking at the i686_defconfig. But I've got a rootfs
> thats only 3M and a kernel thats just under 4M. I've attached my
> buildroot config (.config) and kernel config (i386_defconfig) for your
> reference.
> 
> Also when you are hacking away re-configuring buildroot doesn't know
> to remove something up if you've de-selected it so you may need to
> manually clean out output/target/ manually (or start from fresh each
> time).
> 

when using your .config file my compilation fails due to a missing patch file
mpfr-2.4.1.patch. What is the role of that patch ?

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

* [Buildroot] Creating a filesystem for QEMU
  2009-11-13 14:46       ` Bogdan Cristea
@ 2009-11-13 15:14         ` Chris Packham
  2009-11-13 17:45           ` Bogdan Cristea
  0 siblings, 1 reply; 14+ messages in thread
From: Chris Packham @ 2009-11-13 15:14 UTC (permalink / raw)
  To: buildroot

On Fri, Nov 13, 2009 at 9:46 AM, Bogdan Cristea <cristeab@gmail.com> wrote:
>
> when using your .config file my compilation fails due to a missing patch file
> mpfr-2.4.1.patch. What is the role of that patch ?
>

mpfr is used when generating gcc with floating point support. Its not
something I've added locally.

My buildroot repository is based off the commit id 5e5f3209f which has
got numerous changes since the 2009.08 release (including some in
mpfr). If you do want to persue using my config you may want to get
fresh git clone and seek to the same point as me. i.e.

   git clone  http://git.buildroot.net/buildroot
   cd buildroot
   git checkout -b test 5e5f3209f

Failing that maybe you just want to compare your config to mine and
see if you have a bunch of extra packages that are causing your target
file system to be so big.

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

* [Buildroot] Creating a filesystem for QEMU
  2009-11-13 15:14         ` Chris Packham
@ 2009-11-13 17:45           ` Bogdan Cristea
  0 siblings, 0 replies; 14+ messages in thread
From: Bogdan Cristea @ 2009-11-13 17:45 UTC (permalink / raw)
  To: buildroot

On Friday 13 November 2009 17:14:59 you wrote:
> On Fri, Nov 13, 2009 at 9:46 AM, Bogdan Cristea <cristeab@gmail.com> wrote:
> > when using your .config file my compilation fails due to a missing patch
> > file mpfr-2.4.1.patch. What is the role of that patch ?
> 
> mpfr is used when generating gcc with floating point support. Its not
> something I've added locally.
> 
> My buildroot repository is based off the commit id 5e5f3209f which has
> got numerous changes since the 2009.08 release (including some in
> mpfr). If you do want to persue using my config you may want to get
> fresh git clone and seek to the same point as me. i.e.
> 
>    git clone  http://git.buildroot.net/buildroot
>    cd buildroot
>    git checkout -b test 5e5f3209f
> 
> Failing that maybe you just want to compare your config to mine and
> see if you have a bunch of extra packages that are causing your target
> file system to be so big.
> 

Thank you Chris, finally I have managed to boot a linux image in QEMU. The 
problem seems to be the version of buidroot I have used: 2009.08

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

end of thread, other threads:[~2009-11-13 17:45 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-12 14:23 [Buildroot] Creating a filesystem for QEMU Bogdan Cristea
2009-11-12 14:58 ` Lionel Landwerlin
2009-11-12 15:03   ` Bogdan Cristea
2009-11-12 15:14     ` Lionel Landwerlin
2009-11-12 15:22     ` Mark Constable
2009-11-12 15:04 ` Chris Packham
     [not found] ` <4AFC1FC8.3020305@gmail.com>
2009-11-13 13:18   ` Bogdan Cristea
2009-11-13 13:56     ` Lionel Landwerlin
2009-11-13 13:57       ` Lionel Landwerlin
2009-11-13 14:03         ` Chris Packham
2009-11-13 14:10           ` Lionel Landwerlin
     [not found]     ` <a038bef50911130559i31605c47k57d27e91d95b28f8@mail.gmail.com>
2009-11-13 14:46       ` Bogdan Cristea
2009-11-13 15:14         ` Chris Packham
2009-11-13 17:45           ` Bogdan Cristea

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox