Port-i386 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Add a "scroll" keyword to boot.cfg



Hi folks,

I've got an almost useful serial BIOS redirection on one board here, but
the biggest usability problem is that the NetBSD bootloader starts in
the middle of the screen without clearing it.  To work around this, I'm
using the attached patch which adds a "scroll" keyword which just prints
that many blank lines before it does anything else.

Any interest in adding this to the source tree (and of course an
update to share/man/man5/boot.cfg.5)?  Or put another way, any active
disinterest in not adding it?  :)

Cheers,
Simon.
Index: boot/boot2.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/stand/boot/boot2.c,v
retrieving revision 1.31
diff -d -p -u -r1.31 boot2.c
--- boot/boot2.c        21 May 2008 01:51:34 -0000      1.31
+++ boot/boot2.c        21 May 2008 08:34:50 -0000
@@ -160,6 +160,7 @@ struct bootconf_def {
        char *desc[MAXMENU];            /* Menu text per entry */
        int nummenu;                    /* Number of menu items */
        int timeout;                    /* Timeout in seconds */
+       int scroll;                     /* Number of blank lines to scroll */
 } bootconf;
 #endif /* !SMALL */
 
@@ -267,7 +268,11 @@ void
 print_banner(void)
 {
 #ifndef SMALL
-       int n;
+       int i, n;
+
+       if (bootconf.scroll > 0)
+               for (i = 0; i < bootconf.scroll; i++)
+                       printf("\n");
        if (bootconf.banner[0]) {
                for (n = 0; bootconf.banner[n] && n < MAXBANNER; n++) 
                        printf("%s\n", bootconf.banner[n]);
@@ -311,6 +316,7 @@ atoi(const char *in)
  * The recognised keywords are:
  * banner: text displayed instead of the normal welcome text
  * menu: Descriptive text:command to use
+ * scroll: number of blank lines to print before banner
  * timeout: Timeout in seconds (overrides that set by installboot)
  * default: the default menu option to use if Return is pressed
  * consdev: the console device to use
@@ -322,6 +328,7 @@ atoi(const char *in)
  * menu=Boot into single user mode:boot netbsd -s
  * menu=:boot hd1a:netbsd -cs
  * menu=Goto boot comand line:prompt
+ * scroll=24
  * timeout=10
  * consdev=com0
  * default=1
@@ -440,6 +447,8 @@ parsebootconf(const char *conf)
                                bootconf.timeout = atoi(value);
                } else if (!strncmp(key, "default", 7)) {
                        bootconf.def = atoi(value) - 1;
+               } else if (!strncmp(key, "scroll", 6)) {
+                       bootconf.scroll = atoi(value);
                } else if (!strncmp(key, "consdev", 7)) {
                        bootconf.consdev = value;
                } else if (!strncmp(key, "load", 6)) {


Home | Main Index | Thread Index | Old Index