Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NHXOu-0003DP-0P for mharc-grub-devel@gnu.org; Mon, 07 Dec 2009 01:48:52 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHXOs-0003D8-J8 for grub-devel@gnu.org; Mon, 07 Dec 2009 01:48:50 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHXOr-0003Cw-Bd for grub-devel@gnu.org; Mon, 07 Dec 2009 01:48:50 -0500 Received: from [199.232.76.173] (port=42800 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHXOr-0003Ct-5e for grub-devel@gnu.org; Mon, 07 Dec 2009 01:48:49 -0500 Received: from 74-93-104-97-washington.hfc.comcastbusiness.net ([74.93.104.97]:33354 helo=sunset.davemloft.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHXOq-0004Bp-Ob for grub-devel@gnu.org; Mon, 07 Dec 2009 01:48:48 -0500 Received: from localhost (localhost [127.0.0.1]) by sunset.davemloft.net (Postfix) with ESMTP id 6952A24C6E2 for ; Sun, 6 Dec 2009 22:48:47 -0800 (PST) Date: Sun, 06 Dec 2009 22:48:47 -0800 (PST) Message-Id: <20091206.224847.24234540.davem@davemloft.net> To: grub-devel@gnu.org From: David Miller X-Mailer: Mew version 6.2 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [PATCH]: Fix CDROM skipping in ieee1275 ofdisk iterator. 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: Mon, 07 Dec 2009 06:48:50 -0000 We skip CDROMs in the block device iterator because they simply can't be openned safely unless we absolutely know there is a CDROM drive there and there is in fact a disc in the drive. Openning it blindly results in either a 10 second hang during the open call, or even worse a crash in OpenFirmware. My SunBlade100 wouldn't boot a kernel properly because not only does it by default have a "cdrom" alias, it also has two others named "cdrom1" and "cdrom2". So to cover all cases, match "cdrom" as a 5 character prefix of the alias name in the check. I tried to surmise other ways to do this more cleanly, such as resolving the path and looking for some device property inside of the resulting node, but there simply isn't anything we can check for. BTW, if people want to look at some OpenFirmware device tree dumps on just about every sparc64 system type there is a GIT repo where we maintain such things contributed by various sparc64 Linux users at: git://git.kernel.org/pub/scm/linux/kernel/git/davem/prtconfs.git There are some 32-bit sparc dumps in there, but the majority are 64-bit systems. Anyways, here is the fix, please apply thanks! 2009-12-06 David S. Miller * disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Recognize anything even prefixed with 'cdrom' as a cdrom. === modified file 'disk/ieee1275/ofdisk.c' --- disk/ieee1275/ofdisk.c 2009-06-10 21:04:23 +0000 +++ disk/ieee1275/ofdisk.c 2009-12-07 02:13:52 +0000 @@ -107,7 +107,7 @@ } if (! grub_strcmp (alias->type, "block") && - grub_strcmp (alias->name, "cdrom")) + grub_strncmp (alias->name, "cdrom", 5)) ret = hook (alias->name); return ret; }