Subject: port-sparc/15495: autoconf.c:bootpath_build does not handle multi-letter partition names correctly
To: None <gnats-bugs@gnats.netbsd.org>
From: None <bt@csfps.de>
List: netbsd-bugs
Date: 02/05/2002 05:09:58
>Number:         15495
>Category:       port-sparc
>Synopsis:       autoconf.c:bootpath_build does not handle multi-letter partition names correctly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-sparc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 05 05:10:02 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Volker Borchert
>Release:        1.5.1
>Organization:
>Environment:
Sparc-10/81, OpenBOOT 2.22.1,
netbooting off Sparc-10/81 running NetBSD-1.5.1

NetBSD Gaia 1.5.1 NetBSD 1.5.1 (DebugNCR.4m) #14: Sun Feb  3 06:18:36 CET 2002     system@Uranos:/usr/src/sys/arch/sparc/compile/DebugNCR.4m sparc unknown

kernel config file(s) available upon request

>Description:
OpenBOOT 2.22.1 does not seem to be able to come to a decision which
network port (AUI or TPE) to use. So I set boot-device to net-tpe.
The resulting boot path contains the following element with a three-
letter "partition" part: "ledma@f,400010:tpe". bootpath_build does
not handle this correctly. The consequence is that the boot process
stops asking for the root device with default "ledma0".
>How-To-Repeat:
On a Sparc-10 with OpenBOOT 2.22.1 (not tested with others), boot
using a boot-device of net-tpe.
>Fix:

The following hack seems to work for me:

------- autoconf.c -------
*** -	Sat Feb  2 09:43:47 2002
--- autoconf.c	Sat Feb  2 09:38:33 2002
***************
*** 379,387 ****
  				cp = str2hex(++cp, &bp->val[0]);
  				if (*cp == ',')
  					cp = str2hex(++cp, &bp->val[1]);
! 				if (*cp == ':')
  					/* XXX - we handle just one char */
  					bp->val[2] = *++cp - 'a', ++cp;
  			} else {
  				bp->val[0] = -1; /* no #'s: assume unit 0, no
  							sbus offset/adddress */
--- 379,392 ----
  				cp = str2hex(++cp, &bp->val[0]);
  				if (*cp == ',')
  					cp = str2hex(++cp, &bp->val[1]);
! 				if (*cp == ':') {
  					/* XXX - we handle just one char */
  					bp->val[2] = *++cp - 'a', ++cp;
+ 					/* XXX - skip remainder of paths */
+ 					/*       like "ledma@f,400010:tpe" */
+ 					while (*cp != '/' && *cp != '\0')
+ 						cp++;
+ 				}
  			} else {
  				bp->val[0] = -1; /* no #'s: assume unit 0, no
  							sbus offset/adddress */

>Release-Note:
>Audit-Trail:
>Unformatted: