Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] diskimage HOWTO
@ 2009-08-24  5:39 Bai Shuwei
       [not found] ` <4A9245EA.9030108@redhat.com>
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Bai Shuwei @ 2009-08-24  5:39 UTC (permalink / raw)
  To: buildroot

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 at gmail.com or baishuwei at dslab.lzu.edu.cn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20090824/2908e3cd/attachment.htm>

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

* [Buildroot] [Qemu-devel] diskimage HOWTO
       [not found] ` <4A9245EA.9030108@redhat.com>
@ 2009-08-24  8:30   ` Bai Shuwei
       [not found]   ` <f284c33d0908241004g3eb4608dga6acc979d0547c6a@mail.gmail.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Bai Shuwei @ 2009-08-24  8:30 UTC (permalink / raw)
  To: buildroot

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 at gmail.com or baishuwei at dslab.lzu.edu.cn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20090824/0b2ad94c/attachment.htm>

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

* [Buildroot] diskimage HOWTO
  2009-08-24  5:39 [Buildroot] diskimage HOWTO Bai Shuwei
       [not found] ` <4A9245EA.9030108@redhat.com>
@ 2009-08-24 18:13 ` Steve Calfee
       [not found] ` <20090911093217.GA2342@amd.home.annexia.org>
  2 siblings, 0 replies; 5+ messages in thread
From: Steve Calfee @ 2009-08-24 18:13 UTC (permalink / raw)
  To: buildroot

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

> From: Bai Shuwei <baishuwei@gmail.com>
> Subject: [Buildroot] diskimage HOWTO
> To: buildroot at busybox.net, qemu-devel at 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] 5+ messages in thread

* [Buildroot] [Qemu-devel] diskimage HOWTO
       [not found]   ` <f284c33d0908241004g3eb4608dga6acc979d0547c6a@mail.gmail.com>
@ 2009-08-25  3:55     ` Bai Shuwei
  0 siblings, 0 replies; 5+ messages in thread
From: Bai Shuwei @ 2009-08-25  3:55 UTC (permalink / raw)
  To: buildroot

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 at gmail.com or baishuwei at dslab.lzu.edu.cn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20090825/36c929a7/attachment.htm>

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

* [Buildroot] [Qemu-devel] diskimage HOWTO
       [not found] ` <20090911093217.GA2342@amd.home.annexia.org>
@ 2009-09-11 11:27   ` Peter Korsgaard
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2009-09-11 11:27 UTC (permalink / raw)
  To: buildroot

>>>>> "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 ;)

-- 
Bye, Peter Korsgaard

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

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-24  5:39 [Buildroot] diskimage HOWTO Bai Shuwei
     [not found] ` <4A9245EA.9030108@redhat.com>
2009-08-24  8:30   ` [Buildroot] [Qemu-devel] " Bai Shuwei
     [not found]   ` <f284c33d0908241004g3eb4608dga6acc979d0547c6a@mail.gmail.com>
2009-08-25  3:55     ` Bai Shuwei
2009-08-24 18:13 ` [Buildroot] " Steve Calfee
     [not found] ` <20090911093217.GA2342@amd.home.annexia.org>
2009-09-11 11:27   ` [Buildroot] [Qemu-devel] " Peter Korsgaard

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