[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Installing GrUB into a file

From: Alwin Leerling
Subject: Installing GrUB into a file
Date: Tue, 04 Mar 2008 16:07:47 +1300
User-agent: Thunderbird (X11/20071019)


I am an embedded system programmer. I create a complete flash image on my development machine and use the BIOS utilities to flash the image into the NAND flash on my device. I'd like to install GrUB into my image file before I flashing. I have tried the following (with my file attached to a loop device: losetup /dev/loop0 device.img )
grub> device (hd0) /dev/loop0

grub> root (hd0,0)

grub> setup (hd0)

This fails because grub cannot find /boot/grub/stage1 or /grub/stage1

My image file contains 3 ext3 partitions, the first is my boot partition with the grub directory and contents (stage1, stage2, menu.lst and e2fs_stage1_5). I also created a softlink to itself (ln -s . boot). My kernel files are all in the root of the first partition.

My next try was to access the file directly. I detached to loop device and ran:

grub> device (hd0) (path to file)/device.img

grub> root (hd0,0)

grub> setup ( hd0)

This failed with the same reason (file not found)

I tried the same again but this time with the file mounted into my file system. Again this failed.

So my question is, is it possible to load GrUB into an image file, and if so how do I do it.

Any help is greatly appreciated.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]