Help Getting RAMFS version booting

rtmistler - November 5, 2010

Using MVL6.0 for Z530 I've built a version to boot from RAM disk using the Quickstart initramfs recommendations.

I installed grub2 onto a compact flash and end up at the grub> prompt.

From there I can issue a kernel line to point to my vmLinuz and boot.

There are two problems.

1.) I do not know how to configure grub to just boot and not stick at the prompt; unless there's an error seen in the grub.cfg or other files; hence why it does that.

2.) I do not know how to properly issue the kernel or boot lines so that I can get it fully booted.

I've tried:

"kernel /boot/vmLinuz root=/dev/sda ro" - tells me it can't mount the file system and I end up at the root of the RAM FS

"kernel /boot/vmLinuz root=/dev/sda1 ro" - caused a panic and stuck there about the time it was going to try and mount root

"kernel /boot/vmLinux root=/ ro" - same as the first one, can't mount the file system and drops me to "/" for the RAM FS.

Should I try a different bootloader, or what grub2 configurations am I missing?

I AM a little wary about the grub instal.  I did perform grub-install to the mounted /dev/sdx from my development machine and I did modify the device.map to only have /dev/sda - figuring that when I boot my embedded target, the first and only IDE (Compact Flash) will be that device for (hd0).  And I did modify the device.map on my development machine prior to doing this because I realize that is where grub-install grabs that information.  The other reason is that the /boot/grub directory on the compact flash had very little.  I've had to construct a grub.cfg file for it manually; and in comparison to the /boot/grub directory on my development system (Ubuntu 9.10) there are a lot of files not present.  Development system has many .mod files, target disk had default, xxx_stage1_5 files only.

Here's what I ended up creating for my grub.cfg:

set default="0"

insmod ext2

set root=(hd0,0)

search --no-floppy

set timeout=0

menuentry "MVL6" {

set quiet=1

insmod ext2

set root=(hd0,0)

search --no-floppy

linux /boot/vmLinuz root=/dev/sda ro

}

Any suggestions?

Share this

Comments

For booting automatically

For booting automatically without stuck at the prompt, you can copy grub.cfg to /boot/grub and grub will pick it up.

For the grub boot command, my system has 2 partitions - (hd0,1) and (hd0,2).  Grub and kernel are on (hd0,1).  My rootfs is on (hd0,2).  Here are the command I use to boot linux.

linux (hd0,1)/bzImage console=ttyS1,115200n8 noinitrd rw root=/dev/sda2

boot

I used bzImage and rootfs straight out of MVL6 bitbake.

Hope that helps.

Steve

By the way, my grub.cfg looks

By the way, my grub.cfg looks like

set timeout=3
set default=0

menuentry "MVL6-Intel-Atom-Z530" {
        linux (hd0,1)/bzImage console=ttyS1,115200n8 noinitrd rw root=/dev/sda2
}

Steve

It helps a bit; however I

It helps a bit; however I still have some difficulties.

There is no way a grub.cfg seems to work for me.  I have to use a menu.lst file.  Is there a particular reason for that?

I've taken an 8 GB Compact Flash and partitioned it to have two primary ext2 partitions, and make the first partition bootable.

In the menu.lst I have the following:

title        MVL-6.0

kernel    (hd0,0)/boot/bzImage-2.6.31-r1-intel-atom-z530-initramfs.bin noinitrd root=/dev/sda2 rw quiet

boot

 

My presumption is that when grub runs it detects the sole drive (Compact Flash via IDE) as /dev/sda.

 

The misunderstanding on my part is the root file system.

Bitbake creates a gz file for that.

Do I place that on the compact flash intact?  And if so, do I place it on /dev/sda2, or in the /dev/sda1/boot directory where my bzImage file is located?

Or ... do I not do that at all and extract that image and copy it recursively onto that second partition?  I thought that you could use a compressed file system, but perhaps I'm confused.

If I am supposed to copy that file system onto the compact flash what are the steps?  gunzip it first?  mount it as a loop? (recommendations needed for how to do that), or gunzip and extract it fully and then cp -R from dev machine to target compact flash?

What happens now is that it boots and when it goes to switch root, it says it sees no /dev/console and then panics.

> There is no way a grub.cfg

> There is no way a grub.cfg seems to work for me.  I have to use a menu.lst file. Is there a particular reason for that?

That means you are using older version of GRUB.

> Bitbake creates a gz file for that.  Do I place that on the compact flash intact?  And if so, do I place it on /dev/sda2, or in the /dev/sda1/boot directory where my bzImage file is located?

The general steps I took to get the filesystem to compactFLASH are

1.  Uncompress with with gunzip.

2.  Loop mount the uncompressed file

3.  Extract the files into a tar.gz with tar -czf

4.  Copy the files to /dev/sda2 with tar -xzf

Steve