[OpenBIOS] [commit] r831 - trunk/openbios-devel/arch/sparc32

repository service svn at openbios.org
Tue Aug 3 20:39:27 CEST 2010


Author: blueswirl
Date: Tue Aug  3 20:39:27 2010
New Revision: 831
URL: http://tracker.coreboot.org/trac/openbios/changeset/831

Log:
sparc32: fix NetBSD crash

Fix NetBSD crash when printing bootpath. Also fix generation of
compatibility paths when the bootpath includes partition
letter (e.g. 'disk:d'). Consider also 'cd' alias of 'cdrom'.

See also r244.

Signed-off-by: Blue Swirl <blauwirbel at gmail.com>

Modified:
   trunk/openbios-devel/arch/sparc32/boot.c

Modified: trunk/openbios-devel/arch/sparc32/boot.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/boot.c	Sun Aug  1 23:25:08 2010	(r830)
+++ trunk/openbios-devel/arch/sparc32/boot.c	Tue Aug  3 20:39:27 2010	(r831)
@@ -48,9 +48,12 @@
 	strncpy(bootargsbuf, prop, proplen);	
 
 	/* Set bootpath pointer used in romvec table to the bootpath */
-	bootpath = bootpathbuf;
+        push_str(bootpathbuf);
+        fword("pathres-resolve-aliases");
+        bootpath = pop_fstr_copy();
+        printk("bootpath: %s\n", bootpath);
 
-	if (!strcmp(bootpathbuf, "cdrom") || !strcmp(bootpathbuf, "disk")) {
+        if (!strncmp(bootpathbuf, "cd", 2) || !strncmp(bootpathbuf, "disk", 4)) {
 
 		/* Controller currently always 0 */
 		obp_arg.boot_dev_ctrl = 0;
@@ -70,10 +73,11 @@
 		/* Generate the "oldpath"
 		   FIXME: hardcoding this looks almost definitely wrong.
 		   With sd(0,2,0):b we get to see the solaris kernel though */
-		if (!strcmp(bootpathbuf, "disk"))
+                if (!strncmp(bootpathbuf, "disk", 4)) {
 			bootid = 'd';
-		else
+                } else {
 			bootid = 'b';
+                }
 
 		snprintf(buf, sizeof(buf), "sd(0,%d,%d):%c", unit, part, bootid);
 
@@ -82,7 +86,7 @@
 		obp_arg.argv[0] = buf;
         	obp_arg.argv[1] = bootargsbuf;
 
-	} else if (!strcmp(bootpathbuf, "floppy")) {
+        } else if (!strncmp(bootpathbuf, "floppy", 6)) {
 		
 		obp_arg.boot_dev_ctrl = 0;
 		obp_arg.boot_dev_unit = 0;
@@ -95,7 +99,7 @@
 		obp_arg.argv[0] = buf;
         	obp_arg.argv[1] = bootargsbuf;
 
-	} else if (!strcmp(bootpathbuf, "net")) {
+        } else if (!strncmp(bootpathbuf, "net", 3)) {
 
 		obp_arg.boot_dev_ctrl = 0;
 		obp_arg.boot_dev_unit = 0;



More information about the OpenBIOS mailing list