Rename ofconsole to console.
* grub-core/commands/terminal.c (handle_command): Handle ofconsole as sysnonym to console. * grub-core/term/ieee1275/ofconsole.c: Renamed to .. * grub-core/term/ieee1275/console.c: ... this. All users updated. Rename grub_ofconsole_ to grub_console_. All users updated (grub_console_term_output): Rename "ofconsole" to "console". * grub-core/term/terminfo.c (grub_cmd_terminfo): Handle "ofconsole" as "console".
This commit is contained in:
parent
64c8b8f64c
commit
ca8c0baf25
5 changed files with 67 additions and 38 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
2012-01-29 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Rename ofconsole to console.
|
||||
|
||||
* grub-core/commands/terminal.c (handle_command): Handle ofconsole
|
||||
as sysnonym to console.
|
||||
* grub-core/term/ieee1275/ofconsole.c: Renamed to ..
|
||||
* grub-core/term/ieee1275/console.c: ... this. All users updated.
|
||||
Rename grub_ofconsole_ to grub_console_. All users updated
|
||||
(grub_console_term_output): Rename "ofconsole" to "console".
|
||||
* grub-core/term/terminfo.c (grub_cmd_terminfo): Handle "ofconsole"
|
||||
as "console".
|
||||
|
||||
2012-01-29 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/loader/i386/pc/plan9.c (grub_cmd_plan9): Remove PXE
|
||||
|
|
|
@ -113,7 +113,7 @@ kernel = {
|
|||
ieee1275 = kern/ieee1275/ieee1275.c;
|
||||
ieee1275 = kern/ieee1275/mmap.c;
|
||||
ieee1275 = kern/ieee1275/openfw.c;
|
||||
ieee1275 = term/ieee1275/ofconsole.c;
|
||||
ieee1275 = term/ieee1275/console.c;
|
||||
ieee1275 = kern/ieee1275/init.c;
|
||||
|
||||
terminfoinkernel = term/terminfo.c;
|
||||
|
|
|
@ -95,11 +95,15 @@ handle_command (int argc, char **args, struct abstract_terminal **enabled,
|
|||
while (1)
|
||||
{
|
||||
for (term = *disabled; term; term = term->next)
|
||||
if (grub_strcmp (args[i], term->name) == 0)
|
||||
if (grub_strcmp (args[i], term->name) == 0
|
||||
|| (grub_strcmp (args[i], "ofconsole") == 0
|
||||
&& grub_strcmp ("console", term->name) == 0))
|
||||
break;
|
||||
if (term == 0)
|
||||
for (term = *enabled; term; term = term->next)
|
||||
if (grub_strcmp (args[i], term->name) == 0)
|
||||
if (grub_strcmp (args[i], term->name) == 0
|
||||
|| (grub_strcmp (args[i], "ofconsole") == 0
|
||||
&& grub_strcmp ("console", term->name) == 0))
|
||||
break;
|
||||
if (term)
|
||||
break;
|
||||
|
@ -108,6 +112,8 @@ handle_command (int argc, char **args, struct abstract_terminal **enabled,
|
|||
args[i]);
|
||||
for (aut = autoloads; aut; aut = aut->next)
|
||||
if (grub_strcmp (args[i], aut->name) == 0
|
||||
|| (grub_strcmp (args[i], "ofconsole") == 0
|
||||
&& grub_strcmp ("console", aut->name) == 0)
|
||||
|| (aut->name[0] && aut->name[grub_strlen (aut->name) - 1] == '*'
|
||||
&& grub_memcmp (args[i], aut->name,
|
||||
grub_strlen (aut->name) - 1) == 0))
|
||||
|
@ -131,7 +137,9 @@ handle_command (int argc, char **args, struct abstract_terminal **enabled,
|
|||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
for (term = *disabled; term; term = term->next)
|
||||
if (grub_strcmp (args[i], term->name) == 0)
|
||||
if (grub_strcmp (args[i], term->name) == 0
|
||||
|| (grub_strcmp (args[i], "ofconsole") == 0
|
||||
&& grub_strcmp ("console", term->name) == 0))
|
||||
break;
|
||||
if (term)
|
||||
{
|
||||
|
@ -150,7 +158,9 @@ handle_command (int argc, char **args, struct abstract_terminal **enabled,
|
|||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
for (term = *enabled; term; term = term->next)
|
||||
if (grub_strcmp (args[i], term->name) == 0)
|
||||
if (grub_strcmp (args[i], term->name) == 0
|
||||
|| (grub_strcmp (args[i], "ofconsole") == 0
|
||||
&& grub_strcmp ("console", term->name) == 0))
|
||||
break;
|
||||
if (term)
|
||||
{
|
||||
|
@ -168,7 +178,9 @@ handle_command (int argc, char **args, struct abstract_terminal **enabled,
|
|||
for (i = 0; i < argc; i++)
|
||||
{
|
||||
for (term = *disabled; term; term = term->next)
|
||||
if (grub_strcmp (args[i], term->name) == 0)
|
||||
if (grub_strcmp (args[i], term->name) == 0
|
||||
|| (grub_strcmp (args[i], "ofconsole") == 0
|
||||
&& grub_strcmp ("console", term->name) == 0))
|
||||
break;
|
||||
if (term)
|
||||
{
|
||||
|
@ -186,7 +198,9 @@ handle_command (int argc, char **args, struct abstract_terminal **enabled,
|
|||
{
|
||||
next = term->next;
|
||||
for (i = 0; i < argc; i++)
|
||||
if (grub_strcmp (args[i], term->name) == 0)
|
||||
if (grub_strcmp (args[i], term->name) == 0
|
||||
|| (grub_strcmp (args[i], "ofconsole") == 0
|
||||
&& grub_strcmp ("console", term->name) == 0))
|
||||
break;
|
||||
if (i == argc)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* ofconsole.c -- Open Firmware console for GRUB. */
|
||||
/* console.c -- Open Firmware console for GRUB. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc.
|
||||
|
@ -29,7 +29,7 @@
|
|||
static grub_ieee1275_ihandle_t stdout_ihandle;
|
||||
static grub_ieee1275_ihandle_t stdin_ihandle;
|
||||
|
||||
extern struct grub_terminfo_output_state grub_ofconsole_terminfo_output;
|
||||
extern struct grub_terminfo_output_state grub_console_terminfo_output;
|
||||
|
||||
struct color
|
||||
{
|
||||
|
@ -74,7 +74,7 @@ readkey (struct grub_term_input *term __attribute__ ((unused)))
|
|||
}
|
||||
|
||||
static void
|
||||
grub_ofconsole_dimensions (void)
|
||||
grub_console_dimensions (void)
|
||||
{
|
||||
grub_ieee1275_ihandle_t options;
|
||||
grub_ssize_t lval;
|
||||
|
@ -90,7 +90,7 @@ grub_ofconsole_dimensions (void)
|
|||
|
||||
if (! grub_ieee1275_get_property (options, "screen-#columns",
|
||||
val, lval, 0))
|
||||
grub_ofconsole_terminfo_output.width
|
||||
grub_console_terminfo_output.width
|
||||
= (grub_uint8_t) grub_strtoul (val, 0, 10);
|
||||
}
|
||||
if (! grub_ieee1275_get_property_length (options, "screen-#rows", &lval)
|
||||
|
@ -99,20 +99,20 @@ grub_ofconsole_dimensions (void)
|
|||
char val[lval];
|
||||
if (! grub_ieee1275_get_property (options, "screen-#rows",
|
||||
val, lval, 0))
|
||||
grub_ofconsole_terminfo_output.height
|
||||
grub_console_terminfo_output.height
|
||||
= (grub_uint8_t) grub_strtoul (val, 0, 10);
|
||||
}
|
||||
}
|
||||
|
||||
/* Use a small console by default. */
|
||||
if (! grub_ofconsole_terminfo_output.width)
|
||||
grub_ofconsole_terminfo_output.width = 80;
|
||||
if (! grub_ofconsole_terminfo_output.height)
|
||||
grub_ofconsole_terminfo_output.height = 24;
|
||||
if (! grub_console_terminfo_output.width)
|
||||
grub_console_terminfo_output.width = 80;
|
||||
if (! grub_console_terminfo_output.height)
|
||||
grub_console_terminfo_output.height = 24;
|
||||
}
|
||||
|
||||
static void
|
||||
grub_ofconsole_setcursor (struct grub_term_output *term,
|
||||
grub_console_setcursor (struct grub_term_output *term,
|
||||
int on)
|
||||
{
|
||||
grub_terminfo_setcursor (term, on);
|
||||
|
@ -128,7 +128,7 @@ grub_ofconsole_setcursor (struct grub_term_output *term,
|
|||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_ofconsole_init_input (struct grub_term_input *term)
|
||||
grub_console_init_input (struct grub_term_input *term)
|
||||
{
|
||||
grub_ssize_t actual;
|
||||
|
||||
|
@ -141,7 +141,7 @@ grub_ofconsole_init_input (struct grub_term_input *term)
|
|||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_ofconsole_init_output (struct grub_term_output *term)
|
||||
grub_console_init_output (struct grub_term_output *term)
|
||||
{
|
||||
grub_ssize_t actual;
|
||||
|
||||
|
@ -168,7 +168,7 @@ grub_ofconsole_init_output (struct grub_term_output *term)
|
|||
grub_terminfo_setcolorstate (term, GRUB_TERM_COLOR_NORMAL);
|
||||
}
|
||||
|
||||
grub_ofconsole_dimensions ();
|
||||
grub_console_dimensions ();
|
||||
|
||||
grub_terminfo_output_init (term);
|
||||
|
||||
|
@ -177,39 +177,39 @@ grub_ofconsole_init_output (struct grub_term_output *term)
|
|||
|
||||
|
||||
|
||||
struct grub_terminfo_input_state grub_ofconsole_terminfo_input =
|
||||
struct grub_terminfo_input_state grub_console_terminfo_input =
|
||||
{
|
||||
.readkey = readkey
|
||||
};
|
||||
|
||||
struct grub_terminfo_output_state grub_ofconsole_terminfo_output =
|
||||
struct grub_terminfo_output_state grub_console_terminfo_output =
|
||||
{
|
||||
.put = put,
|
||||
.width = 80,
|
||||
.height = 24
|
||||
};
|
||||
|
||||
static struct grub_term_input grub_ofconsole_term_input =
|
||||
static struct grub_term_input grub_console_term_input =
|
||||
{
|
||||
.name = "ofconsole",
|
||||
.init = grub_ofconsole_init_input,
|
||||
.name = "console",
|
||||
.init = grub_console_init_input,
|
||||
.getkey = grub_terminfo_getkey,
|
||||
.data = &grub_ofconsole_terminfo_input
|
||||
.data = &grub_console_terminfo_input
|
||||
};
|
||||
|
||||
static struct grub_term_output grub_ofconsole_term_output =
|
||||
static struct grub_term_output grub_console_term_output =
|
||||
{
|
||||
.name = "ofconsole",
|
||||
.init = grub_ofconsole_init_output,
|
||||
.name = "console",
|
||||
.init = grub_console_init_output,
|
||||
.putchar = grub_terminfo_putchar,
|
||||
.getxy = grub_terminfo_getxy,
|
||||
.getwh = grub_terminfo_getwh,
|
||||
.gotoxy = grub_terminfo_gotoxy,
|
||||
.cls = grub_terminfo_cls,
|
||||
.setcolorstate = grub_terminfo_setcolorstate,
|
||||
.setcursor = grub_ofconsole_setcursor,
|
||||
.setcursor = grub_console_setcursor,
|
||||
.flags = GRUB_TERM_CODE_TYPE_ASCII,
|
||||
.data = &grub_ofconsole_terminfo_output,
|
||||
.data = &grub_console_terminfo_output,
|
||||
.normal_color = GRUB_TERM_DEFAULT_NORMAL_COLOR,
|
||||
.highlight_color = GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR,
|
||||
};
|
||||
|
@ -220,8 +220,8 @@ void grub_terminfo_init (void);
|
|||
void
|
||||
grub_console_init_early (void)
|
||||
{
|
||||
grub_term_register_input ("ofconsole", &grub_ofconsole_term_input);
|
||||
grub_term_register_output ("ofconsole", &grub_ofconsole_term_output);
|
||||
grub_term_register_input ("console", &grub_console_term_input);
|
||||
grub_term_register_output ("console", &grub_console_term_output);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -235,15 +235,15 @@ grub_console_init_lately (void)
|
|||
type = "ieee1275";
|
||||
|
||||
grub_terminfo_init ();
|
||||
grub_terminfo_output_register (&grub_ofconsole_term_output, type);
|
||||
grub_terminfo_output_register (&grub_console_term_output, type);
|
||||
}
|
||||
|
||||
void
|
||||
grub_console_fini (void)
|
||||
{
|
||||
grub_term_unregister_input (&grub_ofconsole_term_input);
|
||||
grub_term_unregister_output (&grub_ofconsole_term_output);
|
||||
grub_terminfo_output_unregister (&grub_ofconsole_term_output);
|
||||
grub_term_unregister_input (&grub_console_term_input);
|
||||
grub_term_unregister_output (&grub_console_term_output);
|
||||
grub_terminfo_output_unregister (&grub_console_term_output);
|
||||
|
||||
grub_terminfo_fini ();
|
||||
}
|
|
@ -673,7 +673,9 @@ grub_cmd_terminfo (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||
|
||||
for (cur = terminfo_outputs; cur;
|
||||
cur = ((struct grub_terminfo_output_state *) cur->data)->next)
|
||||
if (grub_strcmp (args[0], cur->name) == 0)
|
||||
if (grub_strcmp (args[0], cur->name) == 0
|
||||
|| (grub_strcmp (args[0], "ofconsole") == 0
|
||||
&& grub_strcmp ("console", cur->name) == 0))
|
||||
{
|
||||
cur->flags = (cur->flags & ~GRUB_TERM_CODE_TYPE_MASK) | encoding;
|
||||
|
||||
|
|
Loading…
Reference in a new issue