Subject: port-macppc/31972: typo in netbsd/macppc ofwboot.c
To: None <port-macppc-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: None <cmue81@gmx.de>
List: netbsd-bugs
Date: 11/01/2005 18:53:00
>Number:         31972
>Category:       port-macppc
>Synopsis:       typo in netbsd/macppc ofwboot.c
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-macppc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 01 18:53:00 +0000 2005
>Originator:     Christian Müller
>Release:        2.0.2
>Organization:
private
>Environment:
don't need this, bug is at a point where there is no (kernel) environment yet - in the boot code
>Description:
Full listing: 
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/macppc/stand/ofwboot/ofdev.c?rev=1.15&content-type=text/x-cvsweb-markup

static char *
filename(char *str, char *ppart)
{
[...]
	for (cp = str; *cp; lp = cp) {
		/* For each component of the path name... */
		while (*++cp && *cp != '/')
			;
		savec = *cp;
		*cp = 0;
		/* ...look whether there is a device with this name */

[NEXT LINE: SHOULD IT NOT BE cp INSTEAD OF str?  Why else would you save cp in savec?]

		dhandle = OF_finddevice(str);
		*cp = savec;
[...]
	}
	return 0;
}

>How-To-Repeat:
Boot on an oldworld powermac machine and let ofwboot ask you for the kernel to load - when using a device in the OF-path you supply it will only work when the (block) device is on root of the openfirmware path.  The bug is obvious, you can see that it was intended different, just a typo...
>Fix:
see full description, also posted this to ports/macppc mailing list