Author: mcayland Date: Fri Mar 22 15:16:46 2013 New Revision: 1103 URL: http://tracker.coreboot.org/trac/openbios/changeset/1103
Log: mac-parts.c: Fix auto-partition selection for the dir word.
Commit r1100 fixed the quik bootloader but broke automatic partition selection for the dir word.
Differentiate between the package having no arguments (argstr == NULL) and the package having empty arguments (argstr == ""), and alter the dir word to use the latter version to invoke the automatic partition selection code when required.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk CC: Alexander Graf agraf@suse.de
Modified: trunk/openbios-devel/forth/debugging/client.fs trunk/openbios-devel/packages/mac-parts.c
Modified: trunk/openbios-devel/forth/debugging/client.fs ============================================================================== --- trunk/openbios-devel/forth/debugging/client.fs Sat Mar 9 00:37:44 2013 (r1102) +++ trunk/openbios-devel/forth/debugging/client.fs Fri Mar 22 15:16:46 2013 (r1103) @@ -126,7 +126,7 @@
: dir ( "{paths}<cr>" -- ) linefeed parse - ascii , left-split + ascii , split-after 2dup open-dev dup 0= if drop cr ." Unable to locate device " type
Modified: trunk/openbios-devel/packages/mac-parts.c ============================================================================== --- trunk/openbios-devel/packages/mac-parts.c Sat Mar 9 00:37:44 2013 (r1102) +++ trunk/openbios-devel/packages/mac-parts.c Fri Mar 22 15:16:46 2013 (r1103) @@ -79,6 +79,10 @@ } else { argstr = str; } + + /* Make sure argstr is not null */ + if (argstr == NULL) + argstr = strdup(""); /* Convert the id to a partition number */ if (parstr && strlen(parstr)) @@ -89,10 +93,6 @@ want_bootcode = 1; }
- /* Make sure argstr is not null */ - if (argstr == NULL) - argstr = strdup(""); - DPRINTF("parstr: %s argstr: %s parnum: %d\n", parstr, argstr, parnum);
DPRINTF("want_bootcode %d\n", want_bootcode); @@ -126,7 +126,7 @@ * Implement partition selection as per the PowerPC Microprocessor CHRP bindings */
- if (str == NULL || parnum == 0) { + if (argstr == NULL || parnum == 0) { /* According to the spec, partition 0 as well as no arguments means the whole disk */ offs = (long long)0; size = (long long)__be32_to_cpu(dmap.sbBlkCount) * bs;