summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/kwboot.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/kwboot.c b/scripts/kwboot.c
index 9dfaf4a8df..0a089b5936 100644
--- a/scripts/kwboot.c
+++ b/scripts/kwboot.c
@@ -9,6 +9,7 @@
* 2008. Chapter 24.2 "BootROM Firmware".
*/
+#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -285,12 +286,20 @@ kwboot_bootmsg(int tty, void *msg)
}
rc = kwboot_tty_recv(tty, &c, 1, KWBOOT_MSG_RSP_TIMEO);
-
- kwboot_spinner();
+ while (!rc && c != NAK) {
+ if (c == '\\')
+ kwboot_printv("\\\\", c);
+ else if (isprint(c) || c == '\r' || c == '\n')
+ kwboot_printv("%c", c);
+ else
+ kwboot_printv("\\x%02hhx", c);
+
+ rc = kwboot_tty_recv(tty, &c, 1, KWBOOT_MSG_RSP_TIMEO);
+ }
} while (rc || c != NAK);
- kwboot_printv("\n");
+ kwboot_printv("\nGot expected NAK\n");
return rc;
}