From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Il8kL-0004yn-5a for mharc-grub-devel@gnu.org; Thu, 25 Oct 2007 15:52:01 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Il8kI-0004uc-Hg for grub-devel@gnu.org; Thu, 25 Oct 2007 15:51:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Il8kF-0004mW-7y for grub-devel@gnu.org; Thu, 25 Oct 2007 15:51:57 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Il8kF-0004lw-4Q for grub-devel@gnu.org; Thu, 25 Oct 2007 15:51:55 -0400 Received: from mailout05.sul.t-online.de ([194.25.134.82] helo=mailout05.sul.t-online.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Il8kE-0004jz-FP for grub-devel@gnu.org; Thu, 25 Oct 2007 15:51:54 -0400 Received: from fwd33.aul.t-online.de by mailout05.sul.t-online.com with smtp id 1Il8kD-0005qC-00; Thu, 25 Oct 2007 21:51:53 +0200 Received: from [10.3.2.2] (V+fIgmZ6Yhwni+QZm-wz4Dgkkoxm8qTNhOixIwAyoy9fg0kl7Huma1HLSe2R0+EwOl@[217.235.252.212]) by fwd33.aul.t-online.de with esmtp id 1Il8ju-05jpHk0; Thu, 25 Oct 2007 21:51:34 +0200 Message-ID: <4720F3CA.7070804@t-online.de> Date: Thu, 25 Oct 2007 21:51:38 +0200 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4 MIME-Version: 1.0 To: grub-devel@gnu.org Content-Type: multipart/mixed; boundary="------------070102080007070600050506" X-ID: V+fIgmZ6Yhwni+QZm-wz4Dgkkoxm8qTNhOixIwAyoy9fg0kl7Huma1HLSe2R0+EwOl X-TOI-MSGID: 21d4c1b3-445c-4d09-be11-c8976231cc05 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [PATCH] Add host open devicename check 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: Thu, 25 Oct 2007 19:51:59 -0000 This is a multi-part message in MIME format. --------------070102080007070600050506 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit grub-emu ls command does not list any partitions. Device scan in grub_disk_open() stops early because grub_host_open() returns success on all device names. Christian 2007-10-25 Christian Franke * disk/host.c (grub_host_open): Add check for "host". This fixes the problem that grub-emu does not find partitions. --------------070102080007070600050506 Content-Type: text/x-patch; name="grub2-host_open.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="grub2-host_open.patch" --- grub2.orig/disk/host.c 2007-08-02 19:24:05.000000000 +0200 +++ grub2/disk/host.c 2007-10-13 15:11:18.000000000 +0200 @@ -34,8 +34,11 @@ grub_host_iterate (int (*hook) (const ch } static grub_err_t -grub_host_open (const char *name __attribute((unused)), grub_disk_t disk) +grub_host_open (const char *name, grub_disk_t disk) { + if (grub_strcmp(name, "host")) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a host disk"); + disk->total_sectors = 0; disk->id = (int) "host"; --------------070102080007070600050506--