mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 14:59:34 +00:00
Preliminary non-interactive use support
This commit is contained in:
1 parent
8c2e2a840c
commit
be705674e1
6 files changed
+129
-43
No files matched your search
@@ -191,7 +191,7 @@ restart:
|
||||
if (password || errnum == ERR_BOOT_COMMAND)
|
||||
{
|
||||
printf("Press any key to continue...");
|
||||
(void) getc ();
|
||||
(void) getkey ();
|
||||
returnit:
|
||||
return 0;
|
||||
}
|
||||
@@ -273,7 +273,7 @@ returnit:
|
||||
}
|
||||
else if (substring("pause", cur_heap) < 1)
|
||||
{
|
||||
if (getc() == 27)
|
||||
if (ASCII_CHAR (getkey ()) == 27)
|
||||
return 1;
|
||||
}
|
||||
else if (substring("uppermem", cur_heap) < 1)
|
||||
|
||||
+8
-4
@@ -282,6 +282,14 @@ extern unsigned long boot_drive;
|
||||
extern char version_string[];
|
||||
extern char *config_file;
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
/* If not using config file, this variable is set to zero,
|
||||
otherwise non-zero. */
|
||||
extern int use_config_file;
|
||||
/* If not using curses, this variable is set to zero, otherwise non-zero. */
|
||||
extern int use_curses;
|
||||
#endif
|
||||
|
||||
#ifndef STAGE1_5
|
||||
/* GUI interface variables. */
|
||||
extern int fallback;
|
||||
@@ -427,10 +435,6 @@ void grub_putchar (int c);
|
||||
Use ASCII_CHAR(ret) to extract the ASCII code. */
|
||||
int getkey (void);
|
||||
|
||||
/* returns 0 if non-ASCII character */
|
||||
#undef getc
|
||||
#define getc() ASCII_CHAR (getkey ())
|
||||
|
||||
/* Like GETKEY, but doesn't block, and returns -1 if no keystroke is
|
||||
available. */
|
||||
int checkkey (void);
|
||||
|
||||
@@ -527,7 +527,11 @@ cmain(void)
|
||||
* Here load the configuration file.
|
||||
*/
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
if (use_config_file && grub_open (config_file))
|
||||
#else
|
||||
if (grub_open (config_file))
|
||||
#endif
|
||||
{
|
||||
int state = 0, prev_config_len = 0, prev_menu_len = 0;
|
||||
char cmdline[1502], *ptr;
|
||||
|
||||
Reference in new issue
Block a user