From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1OeMUy-0000Eo-B8 for mharc-grub-devel@gnu.org; Thu, 29 Jul 2010 02:21:44 -0400 Received: from [140.186.70.92] (port=59591 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OeMUv-0000Ej-0U for grub-devel@gnu.org; Thu, 29 Jul 2010 02:21:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OeMUt-0007s3-Vl for grub-devel@gnu.org; Thu, 29 Jul 2010 02:21:40 -0400 Received: from mail-iw0-f169.google.com ([209.85.214.169]:49773) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OeMUt-0007rq-Si for grub-devel@gnu.org; Thu, 29 Jul 2010 02:21:39 -0400 Received: by iwn2 with SMTP id 2so326321iwn.0 for ; Wed, 28 Jul 2010 23:21:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type; bh=AP8fxZg3760Z141x7VanFErAXdtOaLvpeoW0foacWg0=; b=EDtoDHRQWF3meZMF26jYyldx2Id+4VSMrzFeZqfdMknIlCycSjHHq9qCQa/Lzt+1ya FyAYSVSrp7TR9PVTLN2GMWJuGDlYQZqKzV+A1tOp2H04EGZ/qWj6ETb3rNqN0tOg9yZ0 LfDqtDHso2QI4+O8+xb1gL3SJCn4e96kSXrR8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; b=m202s/3rHuLsulmwqiQUwEWn/q2+qhVun900lQ6CJbnO2Nm+rKK2hV/EZE68jtSv0i E3mNIIl+c8VvblIAmKhirUcbTssUgb2F7PsfClOgz7npB+b+6aj/DLdWezvqTexFAWF8 T23Tvg6kRHlMGJXvzAorfY0IuvnwwI7zZ6KKQ= Received: by 10.231.14.201 with SMTP id h9mr11928522iba.135.1280384498975; Wed, 28 Jul 2010 23:21:38 -0700 (PDT) Received: from [192.168.21.179] (bas1-toronto05-1177663517.dsl.bell.ca [70.49.184.29]) by mx.google.com with ESMTPS id h8sm478347ibk.15.2010.07.28.23.21.37 (version=SSLv3 cipher=RC4-MD5); Wed, 28 Jul 2010 23:21:38 -0700 (PDT) Message-ID: <4C511DF0.3080306@gmail.com> Date: Thu, 29 Jul 2010 02:21:36 -0400 From: Doug Nazar User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.7) Gecko/20100713 Thunderbird/3.1.1 MIME-Version: 1.0 To: grub-devel@gnu.org, Lennart Sorensen Content-Type: multipart/mixed; boundary="------------090300080003090206010603" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: Subject: Fallback to scanning OF tree if no devaliases X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2010 06:21:42 -0000 This is a multi-part message in MIME format. --------------090300080003090206010603 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Lennart, try giving this patch a whirl. In the case after we scan the aliases list and we haven't found any block devices it will now try to scan the entire tree. It kinda worked under OpenBios although I ran into another bug where it can't open a device path that it gave me for the pci ide controller. It found the other 2 drives fine. I think this maintains the correct balance of using short pretty names if available but working if they are not available. There is a case where it will mess up however. If you only specify an alias for one device but need another device to build a raid or lvm it will fail. Although, thinking about it, this already would happen. As always, you can specify the either path manually. Doug --------------090300080003090206010603 Content-Type: text/plain; name="grub-fallback-to-scanning-of-tree.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="grub-fallback-to-scanning-of-tree.diff" === modified file 'disk/ieee1275/ofdisk.c' --- disk/ieee1275/ofdisk.c 2010-07-29 03:58:16 +0000 +++ disk/ieee1275/ofdisk.c 2010-07-29 06:02:06 +0000 @@ -76,6 +76,9 @@ grub_ofdisk_iterate (int (*hook) (const char *name)) { auto int dev_iterate (struct grub_ieee1275_devalias *alias); + int disks_found = 0; + int use_path = 0; + int result; int dev_iterate (struct grub_ieee1275_devalias *alias) { @@ -110,11 +113,20 @@ if (! grub_strcmp (alias->type, "block") && grub_strncmp (alias->name, "cdrom", 5)) - ret = hook (alias->name); + { + disks_found++; + ret = hook (use_path ? alias->path : alias->name); + } return ret; } - return grub_devalias_iterate (dev_iterate); + result = grub_devalias_iterate (dev_iterate); + if (!disks_found) + { + use_path = 1; + result = grub_ieee1275_devices_iterate (dev_iterate); + } + return result; } static char * --------------090300080003090206010603--