All of lore.kernel.org
 help / color / mirror / Atom feed
* Problem with gnu-setup
@ 2009-06-27 10:39 Yves BLUSSEAU
  2009-06-27 19:01 ` Vladimir 'phcoder' Serbinenko
  0 siblings, 1 reply; 2+ messages in thread
From: Yves BLUSSEAU @ 2009-06-27 10:39 UTC (permalink / raw)
  To: grub-devel

Hi,

i'm trying to install grub2  to a partition instead of the MBR (i  
known it's a bad idea, but i need to chainload grub2 from another  
bootloader).
The problem is when i try to install the boot stages with grub-setup i  
have this error:

/usr/local/sbin/grub2-setup -v --force --directory=/tmp/mnt/boot/grub2  
--device-map=/tmp/mnt/boot/grub2/device.map '(hd2,2)'

grub-setup: error: Cannot read `/tmp/mnt/boot/grub2/core.img' correctly


The problem came from line 405 of grub-setup.c
  core_path_dev = grub_util_get_path (dir, core_file);

core_path_dev need to contain the path AND the device to the core  
file, but it's only a "concatenation" of dir and core_file.

In my case it contain /tmp/mnt/boot/grub2/core.img so when grub try to  
read the core image FROM grub it can't: grub_file_open return with an  
error because it don't know the device.

core_path_dev need to be (hd2,2)//tmp/mnt/boot/grub2/core.img in my  
case to work.

Can someone fix this bug ?

Another think i don't understand is that i don't see where the  
blocklists are saved because at this end of grub-setup.c (line 520):
  fp = fopen (core_path, "r+b");
  if (! fp)
    grub_util_error ("Cannot open `%s'", core_path);

  grub_util_write_image (core_img, GRUB_DISK_SECTOR_SIZE * 2, fp);

the core file is open in read mode so no datas can be written.

I hope that this can help you.

Yves Blusseau



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

end of thread, other threads:[~2009-06-27 19:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-27 10:39 Problem with gnu-setup Yves BLUSSEAU
2009-06-27 19:01 ` Vladimir 'phcoder' Serbinenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.