grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

`"prefix" is not set` error message in early GRUB startup


From: Seth Goldberg
Subject: `"prefix" is not set` error message in early GRUB startup
Date: Sat, 25 Dec 2010 23:02:46 -0800 (PST)
User-agent: Alpine 2.00 (GSO 1167 2008-08-23)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]