grub-devel
[Top][All Lists]
Advanced

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

Problem with gnu-setup


From: Yves BLUSSEAU
Subject: Problem with gnu-setup
Date: Sat, 27 Jun 2009 12:39:45 +0200

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




reply via email to

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