summaryrefslogtreecommitdiffstats
path: root/sys/boot/common/boot.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot/common/boot.c')
-rw-r--r--sys/boot/common/boot.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/boot/common/boot.c b/sys/boot/common/boot.c
index 315c039..c6ab681 100644
--- a/sys/boot/common/boot.c
+++ b/sys/boot/common/boot.c
@@ -162,6 +162,9 @@ autoboot(int timeout, char *prompt)
int c, yes;
char *argv[2], *cp, *ep;
char *kernelname;
+#ifdef BOOT_PROMPT_123
+ const char *seq = "123", *p = seq;
+#endif
autoboot_tried = 1;
@@ -192,14 +195,29 @@ autoboot(int timeout, char *prompt)
yes = 0;
+#ifdef BOOT_PROMPT_123
+ printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or "
+ "1 2 3 sequence for command prompt." : prompt);
+#else
printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or any other key for command prompt." : prompt);
+#endif
for (;;) {
if (ischar()) {
c = getchar();
+#ifdef BOOT_PROMPT_123
+ if ((c == '\r') || (c == '\n')) {
+ yes = 1;
+ break;
+ } else if (c != *p++)
+ p = seq;
+ if (*p == 0)
+ break;
+#else
if ((c == '\r') || (c == '\n'))
yes = 1;
break;
+#endif
}
ntime = time(NULL);
if (ntime >= when) {
OpenPOWER on IntegriCloud