Subject: install/30422: sysinst overrides default boot countdown timeout on i386
To: None <,,>
From: None <>
List: netbsd-bugs
Date: 06/04/2005 05:16:01
>Number:         30422
>Category:       install
>Synopsis:       sysinst overrides default boot countdown timeout on i386
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    install-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 04 05:16:01 +0000 2005
>Originator:     John Darrow
>Release:        NetBSD 2.0 and later; offending changed occurred 2003-07-25
Computing Services, Wheaton College, Wheaton, IL
Architecture: i386
Machine: i386
The default bootblocks for i386 use, and have always used, a countdown
timeout of 5 seconds (see sys/arch/i386/stand/lib/boot_params.S, and
before that PROMPTWAIT in sys/arch/i386/boot/boot.c).

However, sysinst in NetBSD 2.0 and later uses custom code in
distrib/utils/sysinst/arch/i386/md.c:md_post_newfs() to install the
bootblocks, under the dubious comment of:
	/* Copy bootstrap in by hand - /sbin/installboot explodes ramdisks */

That custom code uses a custom struct x86_boot_params, with a timeout
of 10.  There are no comments in the source, nor annotations in the
cvs history, to explain why this value was chosen - it just appeared
with the addition of the line in revision 1.94 (2003-07-25 by dsl).

Get annoyed by extra-long timeout on boot countdown on every new install.
Go tracking through code trying to find where it is set.  Find that
bootblock default is 5, scratch head trying to find where 10 comes from.
Major aggravation upon locating the undocumented culprit.

Short-term fix is to change "10" to "5" in the offending line of md.c:
--- src/distrib/utils/sysinst/arch/i386/md.c_v1.106	Sat Aug 14 11:06:40 2004
+++ src/distrib/utils/sysinst/arch/i386/md.c	Sat Jun  4 00:05:41 2005
@@ -300,7 +300,7 @@
 	char bootxx[8192 + 4];
 	char *bootxx_filename;
 	static struct x86_boot_params boottype =
-		{sizeof boottype, 0, 10, 0, 9600, { '\0' }};
+		{sizeof boottype, 0, 5, 0, 9600, { '\0' }};
 	static int conmib[] = {CTL_MACHDEP, CPU_CONSDEV};
 	struct termios t;
 	dev_t condev;

Longer-term fix is to change i386 sysinst to properly use installboot
like it uses on most other arches.

Please pull at least the short-term fix up to netbsd-2 and netbsd-3