2569 |
}; |
}; |
2570 |
|
|
2571 |
|
|
2572 |
|
/* pager [on|off] */ |
2573 |
|
static int |
2574 |
|
pager_func (char *arg, int flags) |
2575 |
|
{ |
2576 |
|
/* If ARG is empty, toggle the flag. */ |
2577 |
|
if (! *arg) |
2578 |
|
use_pager = ! use_pager; |
2579 |
|
else if (grub_memcmp (arg, "on", 2) == 0) |
2580 |
|
use_pager = 1; |
2581 |
|
else if (grub_memcmp (arg, "off", 3) == 0) |
2582 |
|
use_pager = 0; |
2583 |
|
else |
2584 |
|
{ |
2585 |
|
errnum = ERR_BAD_ARGUMENT; |
2586 |
|
return 1; |
2587 |
|
} |
2588 |
|
|
2589 |
|
grub_printf (" Internal pager is now %s\n", use_pager ? "on" : "off"); |
2590 |
|
return 0; |
2591 |
|
} |
2592 |
|
|
2593 |
|
static struct builtin builtin_pager = |
2594 |
|
{ |
2595 |
|
"pager", |
2596 |
|
pager_func, |
2597 |
|
BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST, |
2598 |
|
"pager [FLAG]", |
2599 |
|
"Toggle pager mode with no argument. If FLAG is given and its value" |
2600 |
|
" is `on', turn on the mode. If FLAG is `off', turn off the mode." |
2601 |
|
}; |
2602 |
|
|
2603 |
|
|
2604 |
/* partnew PART TYPE START LEN */ |
/* partnew PART TYPE START LEN */ |
2605 |
static int |
static int |
2606 |
partnew_func (char *arg, int flags) |
partnew_func (char *arg, int flags) |
3898 |
int to = -1; |
int to = -1; |
3899 |
int dumb = 0; |
int dumb = 0; |
3900 |
int saved_terminal = terminal; |
int saved_terminal = terminal; |
3901 |
|
int lines = 0; |
3902 |
|
|
3903 |
/* Get GNU-style long options. */ |
/* Get GNU-style long options. */ |
3904 |
while (1) |
while (1) |
3912 |
if (! safe_parse_maxint (&val, &to)) |
if (! safe_parse_maxint (&val, &to)) |
3913 |
return 1; |
return 1; |
3914 |
} |
} |
3915 |
|
else if (grub_memcmp (arg, "--lines=", sizeof ("--lines=") - 1) == 0) |
3916 |
|
{ |
3917 |
|
char *val = arg + sizeof ("--lines=") - 1; |
3918 |
|
|
3919 |
|
if (! safe_parse_maxint (&val, &lines)) |
3920 |
|
return 1; |
3921 |
|
|
3922 |
|
/* Probably less than four is meaningless.... */ |
3923 |
|
if (lines < 4) |
3924 |
|
{ |
3925 |
|
errnum = ERR_BAD_ARGUMENT; |
3926 |
|
return 1; |
3927 |
|
} |
3928 |
|
} |
3929 |
else |
else |
3930 |
break; |
break; |
3931 |
|
|
4045 |
} |
} |
4046 |
#endif /* SUPPORT_SERIAL */ |
#endif /* SUPPORT_SERIAL */ |
4047 |
|
|
4048 |
|
if (lines) |
4049 |
|
max_lines = lines; |
4050 |
|
else |
4051 |
|
/* 24 would be a good default value. */ |
4052 |
|
max_lines = 24; |
4053 |
|
|
4054 |
return 0; |
return 0; |
4055 |
} |
} |
4056 |
|
|
4059 |
"terminal", |
"terminal", |
4060 |
terminal_func, |
terminal_func, |
4061 |
BUILTIN_MENU | BUILTIN_CMDLINE | BUILTIN_HELP_LIST, |
BUILTIN_MENU | BUILTIN_CMDLINE | BUILTIN_HELP_LIST, |
4062 |
"terminal [--dumb] [--timeout=SECS] [console] [serial]", |
"terminal [--dumb] [--timeout=SECS] [--lines=LINES] [console] [serial]", |
4063 |
"Select a terminal. When serial is specified, wait until you push any key" |
"Select a terminal. When serial is specified, wait until you push any key" |
4064 |
" to continue. If both console and serial are specified, the terminal" |
" to continue. If both console and serial are specified, the terminal" |
4065 |
" to which you input a key first will be selected. If no argument is" |
" to which you input a key first will be selected. If no argument is" |
4066 |
" specified, print current setting. The option --dumb speicifies that" |
" specified, print current setting. The option --dumb specifies that" |
4067 |
" your terminal is dumb, otherwise, vt100-compatibility is assumed." |
" your terminal is dumb, otherwise, vt100-compatibility is assumed." |
4068 |
" If --timeout is present, this command will wait at most for SECS" |
" If --timeout is present, this command will wait at most for SECS" |
4069 |
" seconds." |
" seconds. The option --lines specifies the maximum number of lines." |
4070 |
}; |
}; |
4071 |
#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES */ |
#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES */ |
4072 |
|
|
4387 |
struct vbe_controller controller; |
struct vbe_controller controller; |
4388 |
unsigned short *mode_list; |
unsigned short *mode_list; |
4389 |
int mode_number = -1; |
int mode_number = -1; |
|
int count = 1; |
|
4390 |
|
|
4391 |
auto unsigned long vbe_far_ptr_to_linear (unsigned long); |
auto unsigned long vbe_far_ptr_to_linear (unsigned long); |
4392 |
|
|
4468 |
|
|
4469 |
if (mode_number != -1) |
if (mode_number != -1) |
4470 |
break; |
break; |
|
|
|
|
count++; |
|
|
|
|
|
/* XXX: arbitrary. */ |
|
|
if (count == 22) |
|
|
{ |
|
|
grub_printf ("\nHit any key to continue.\n"); |
|
|
count = 0; |
|
|
getkey (); |
|
|
} |
|
4471 |
} |
} |
4472 |
} |
} |
4473 |
|
|
4536 |
#endif /* USE_MD5_PASSWORDS */ |
#endif /* USE_MD5_PASSWORDS */ |
4537 |
&builtin_module, |
&builtin_module, |
4538 |
&builtin_modulenounzip, |
&builtin_modulenounzip, |
4539 |
|
&builtin_pager, |
4540 |
&builtin_partnew, |
&builtin_partnew, |
4541 |
&builtin_parttype, |
&builtin_parttype, |
4542 |
&builtin_password, |
&builtin_password, |