gptboot parse error

From: John Hay <jhay_at_meraka.org.za>
Date: Mon, 10 Aug 2009 15:05:38 +0200
Hi,

When experimenting with gptboot to boot different partitions, I found
that its parse() function was broken. Using 'p' to seperate the units
from the partition did not work, neither did a ','.

Here is a fix to make it work with 'p' like it is suggested in main().
Any comments? Should we try to get it in before 8.0?

This allows me to use boot.config to select different partitions to boot
from. Something like "ad(0p3)/boot/loader" for instance.

John
-- 
John Hay -- jhay_at_meraka.csir.co.za / jhay_at_FreeBSD.org

Index: gptboot.c
===================================================================
RCS file: /home/ncvs/src/sys/boot/i386/gptboot/gptboot.c,v
retrieving revision 1.86.2.3
diff -u -r1.86.2.3 gptboot.c
--- gptboot.c	15 Aug 2008 19:31:12 -0000	1.86.2.3
+++ gptboot.c	7 Aug 2009 10:27:09 -0000
_at__at_ -466,16 +466,13 _at__at_
 		dsk.type = i;
 		arg += 3;
 		dsk.unit = *arg - '0';
-		if (arg[1] != ',' || dsk.unit > 9)
+		if (arg[1] != 'p' || dsk.unit > 9)
 		    return -1;
 		arg += 2;
-		dsk.part = -1;
-		if (arg[1] == ',') {
-		    dsk.part = *arg - '0';
-		    if (dsk.part < 1 || dsk.part > 9)
-			return -1;
-		    arg += 2;
-		}
+		dsk.part = *arg - '0';
+		if (dsk.part < 1 || dsk.part > 9)
+		    return -1;
+		arg++;
 		if (arg[0] != ')')
 		    return -1;
 		arg++;
Received on Mon Aug 10 2009 - 11:05:51 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:53 UTC