Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1PWkfB-0002uE-92 for mharc-grub-devel@gnu.org; Sun, 26 Dec 2010 02:05:05 -0500 Received: from [140.186.70.92] (port=48715 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PWkf8-0002u9-NB for grub-devel@gnu.org; Sun, 26 Dec 2010 02:05:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PWkf7-0007I9-HA for grub-devel@gnu.org; Sun, 26 Dec 2010 02:05:02 -0500 Received: from rcsinet10.oracle.com ([148.87.113.121]:30952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PWkf7-0007Hd-Bu for grub-devel@gnu.org; Sun, 26 Dec 2010 02:05:01 -0500 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id oBQ74vDZ010913 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 26 Dec 2010 07:04:58 GMT Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id oBQ74rml015337 for ; Sun, 26 Dec 2010 07:04:56 GMT Received: from abhmt006.oracle.com by acsmt354.oracle.com with ESMTP id 905952751293347050; Sat, 25 Dec 2010 23:04:10 -0800 Received: from rebs (/10.142.243.74) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 25 Dec 2010 23:04:09 -0800 Date: Sat, 25 Dec 2010 23:02:46 -0800 (PST) From: Seth Goldberg X-X-Sender: sethg@bergsoft To: grub-devel@gnu.org Message-ID: User-Agent: Alpine 2.00 (GSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: `"prefix" is not set` error message in early GRUB startup 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: Sun, 26 Dec 2010 07:05:03 -0000 Hi, Recently, I've been seeing the error message in the subject line while GRUB2 is starting. I've tracked it down to code in normal.mod (specifically, the code in GRUB_MOD_INIT(normal) that tries to grub_dl_load the gzio module. Since normal.mod is loaded by the call to grub_load_modules() in main() and that call is BEFORE the call to grub_machine_set_prefix(), the prefix is not used to find gzio (another interesting thing to note is that even if gzio is embedded in the core image, if it is present AFTER normal.mod, the loader does not realize this and tries to load it from the prefix directory -- that should probably be fixed also). Another interesting thing to note is that normal's init function, by virtue of calling grub_context_init(), calls grub_env_export for both prefix and root (which has the side effect of setting them to the empty string if they don't exist at the time). This can also cause subtle problems if other modules access root or prefix during the course of grub_load_modules(). My suggested fix is to move the calls to grub_machine_set_prefix() and grub_set_root_dev before grub_load_modules(). A cursory examination of these functions doesn't reveal any dependence on any loadable modules, but I'm not 100% sure about that. Were these two functions put after grub_load_modules() before they might require modules loaded there? --S