help-grub
[Top][All Lists]
Advanced

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

Re: Creating a image with grub.


From: Jordan Uggla
Subject: Re: Creating a image with grub.
Date: Sat, 3 Mar 2012 18:20:21 -0800

On Sun, Feb 26, 2012 at 10:42 AM, satish kondapalli
<address@hidden> wrote:
> Hi,
>
> I am new to GRUB.
>
> I want to do one experiment with my Embedded system:
>
> i want to put GRUB and Kernel with initramfs file system in to the NOR
> flash.  I want to represent this NOR flash as a bootable hard disk to the
> UEFI.  I have written on BLOCK_IO_PROTOCOL driver in the UEFI that will
> represent my NOR flash as Hard disk.
>
> With GRUB one i have done this steps:
>
> 1) First I created one 6MB partition on USB disk with FAT file system
> (/dev/sda1) and I copied all the grub files  and  kernel image in to the
> partition.
> 2) I installed the grub on /dev/sda.( grub-install /dev/sda) and able to
> boot with this USB disk.

There are many things wrong here. First, if you want a self contained
image then the grub directory, where grub's modules are stored and
where grub looks for a grub.cfg, will need to be on this USB disk
also. Since you didn't pass a --boot-directory= argument instead
grub's modules will be stored in /boot/grub/, meaning literally
whatever happens to be at the path /boot/grub/ right now, meaning most
likely on your system's root filesystem. Second you passed an argument
"/dev/sda", which is only a valid argument for grub-pc, not for
grub-efi. UEFI does not have boot sectors. Third, once you are sure
you're using grub-efi, you'll want to use the --removable argument to
grub-install.

> 3))  Next step, i taken this USB disk and created a image from it ( dd
> if=/dev/sda of=file.img bs=1MB count=8). This image i am  programming in to
> my NOR flash and i am able to boot my system From NOR flash.
>
> Question:
> 1) When i installed my grub on disk I given /dev/sda. we are writing MBR on
> LBA0.  My partition is starting at LBA16.  so in my NOR flash from LBA1 to
> LBA15 are unuse. How to avoid this problem? I dont want to waste any of my
> NOR flash. But i have to represent this NOR flash as Bootable disk. Please
> give me some pointers to solve this issue.

Again if you were using grub-efi, which you need to use if you want to
boot via UEFI, then grub-install would not be touching LBA0 as UEFI
does not use boot sectors.

> 2) Is there a way to put the parttion table and created Partition in
> contiguous LBAs? (Beacuse  UEFI  will not execute MBR code.._ )

Yes, simply start your first partition immediately after the GPT label
and it will work fine (I would *not* recommend doing this for normal
systems though, as the alignment will be terrible).

You seem to be pretty confused at the moment. I would recommend that
you make sure you're grabbing your distro's grub-efi packages rather
than grub-pc, or that you're passing the correct options to
./configure for efi if you're building from source. Also, it would
probably be easier to help you if you joined #grub on irc.freenode.net
since this sounds like it would be easier to explain/resolve in real
time.

-- 
Jordan Uggla (Jordan_U on irc.freenode.net)



reply via email to

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