Date: Mon, 10 Aug 2009 15:05:38 +0200 From: John Hay <jhay@meraka.org.za> To: freebsd-current@freebsd.org Subject: gptboot parse error Message-ID: <20090810130538.GA62008@zibbi.meraka.csir.co.za>
next in thread | raw e-mail | index | archive | help
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@meraka.csir.co.za / jhay@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 @@ -466,16 +466,13 @@ 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++;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090810130538.GA62008>