From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MKVKd-0001DS-2u for mharc-grub-devel@gnu.org; Sat, 27 Jun 2009 06:40:27 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MKVKa-0001Cx-Sr for grub-devel@gnu.org; Sat, 27 Jun 2009 06:40:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MKVKV-0001Bn-PO for grub-devel@gnu.org; Sat, 27 Jun 2009 06:40:24 -0400 Received: from [199.232.76.173] (port=45940 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MKVKV-0001Bk-N1 for grub-devel@gnu.org; Sat, 27 Jun 2009 06:40:19 -0400 Received: from sneakemail.com ([38.113.6.61]:34302 helo=sneak1.sneakemail.com) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MKVKV-0000oT-3I for grub-devel@gnu.org; Sat, 27 Jun 2009 06:40:19 -0400 Received: (qmail 30527 invoked by uid 508); 27 Jun 2009 10:40:17 -0000 Received: (sneakemail censored 24348-22543 #2); 27 Jun 2009 10:40:17 -0000 Received: (sneakemail censored 24348-22543 #1); 27 Jun 2009 10:40:17 -0000 Message-ID: <24348-22543@sneakemail.com> From: "Yves BLUSSEAU" To: grub-devel@gnu.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Sat, 27 Jun 2009 12:39:45 +0200 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Problem with gnu-setup X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jun 2009 10:40:25 -0000 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