2010-01-07 Robert Millan <rmh.grub@aybabtu.com>
2010-01-07 Vladimir Serbinenko <phcoder@gmail.com> Fix breakage introduced with previous commit. * normal/dyncmd.c (read_command_list): Avoid unregistering kernel commands. * normal/handler.c (read_handler_list): Revert part of previous commit affecting this file. * normal/main.c (read_lists): Move read_handler_list() call back to ... (grub_normal_execute): ... here.
This commit is contained in:
commit
53108d92ba
4 changed files with 32 additions and 16 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2010-01-07 Robert Millan <rmh.grub@aybabtu.com>
|
||||
2010-01-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Fix breakage introduced with previous commit.
|
||||
|
||||
* normal/dyncmd.c (read_command_list): Avoid unregistering kernel
|
||||
commands.
|
||||
* normal/handler.c (read_handler_list): Revert part of previous commit
|
||||
affecting this file.
|
||||
* normal/main.c (read_lists): Move read_handler_list() call back to ...
|
||||
(grub_normal_execute): ... here.
|
||||
|
||||
2010-01-07 Robert Millan <rmh.grub@aybabtu.com>
|
||||
|
||||
Merge prefix-redefinition-fix branch.
|
||||
|
|
|
@ -79,14 +79,22 @@ read_command_list (void)
|
|||
if (file)
|
||||
{
|
||||
char *buf = NULL;
|
||||
grub_command_t ptr, last = 0, next;
|
||||
|
||||
/* Override previous commands.lst. */
|
||||
while (grub_command_list)
|
||||
for (ptr = grub_command_list; ptr; ptr = next)
|
||||
{
|
||||
grub_command_t tmp;
|
||||
tmp = grub_command_list->next;
|
||||
grub_free (grub_command_list);
|
||||
grub_command_list = tmp;
|
||||
next = ptr->next;
|
||||
if (ptr->func == grub_dyncmd_dispatcher)
|
||||
{
|
||||
if (last)
|
||||
last->next = ptr->next;
|
||||
else
|
||||
grub_command_list = ptr->next;
|
||||
grub_free (ptr);
|
||||
}
|
||||
else
|
||||
last = ptr;
|
||||
}
|
||||
|
||||
for (;; grub_free (buf))
|
||||
|
|
|
@ -135,6 +135,7 @@ void
|
|||
read_handler_list (void)
|
||||
{
|
||||
const char *prefix;
|
||||
static int first_time = 1;
|
||||
const char *class_name;
|
||||
|
||||
auto int iterate_handler (grub_handler_t handler);
|
||||
|
@ -161,6 +162,11 @@ read_handler_list (void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Make sure that this function does not get executed twice. */
|
||||
if (! first_time)
|
||||
return;
|
||||
first_time = 0;
|
||||
|
||||
prefix = grub_env_get ("prefix");
|
||||
if (prefix)
|
||||
{
|
||||
|
@ -176,16 +182,6 @@ read_handler_list (void)
|
|||
if (file)
|
||||
{
|
||||
char *buf = NULL;
|
||||
|
||||
/* Override previous handler.lst. */
|
||||
while (grub_handler_class_list)
|
||||
{
|
||||
grub_handler_class_t tmp;
|
||||
tmp = grub_handler_class_list->next;
|
||||
grub_free (grub_handler_class_list);
|
||||
grub_handler_class_list = tmp;
|
||||
}
|
||||
|
||||
for (;; grub_free (buf))
|
||||
{
|
||||
char *p;
|
||||
|
|
|
@ -424,7 +424,6 @@ read_lists (struct grub_env_var *var __attribute__ ((unused)),
|
|||
{
|
||||
read_command_list ();
|
||||
read_fs_list ();
|
||||
read_handler_list ();
|
||||
read_crypto_list ();
|
||||
return val ? grub_strdup (val) : NULL;
|
||||
}
|
||||
|
@ -437,6 +436,7 @@ grub_normal_execute (const char *config, int nested, int batch)
|
|||
grub_menu_t menu = 0;
|
||||
|
||||
read_lists (NULL, NULL);
|
||||
read_handler_list ();
|
||||
grub_register_variable_hook ("prefix", NULL, read_lists);
|
||||
grub_command_execute ("parser.grub", 0, 0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue