From: Stefan E. <se...@us...> - 2003-03-11 19:36:29
|
Update of /cvsroot/blob/blob/src/blob In directory sc8-pr-cvs1:/tmp/cvs-serv28370 Modified Files: flash-commands.c Log Message: - changed flash command to allow flashing to arbitary partitions, i.e. "flash kernel zImage" flashes the kernel into the zImage partition. If the partition argument is missing, it assumes the 1st argument is also the partition name, which is exactly the old behavior. Index: flash-commands.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/flash-commands.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- flash-commands.c 29 Jan 2003 23:55:49 -0000 1.6 +++ flash-commands.c 11 Mar 2003 19:36:25 -0000 1.7 @@ -67,14 +67,21 @@ u32 numBytes = 0; u32 maxSize = 0; u32 nwords; + char *dest_part; block_source_t type = fromFlash; if(argc < 2) return -ENOPARAMS; - rv = parse_partition(argv[1], &dst, &maxSize); + if ( argc>2 ) { + dest_part = argv[2]; + } else { + dest_part = argv[1]; + } + + rv = parse_partition(dest_part, &dst, &maxSize); if (rv < 0) { - printerror(rv, argv[1]); + printerror(rv, dest_part); return 0; } @@ -122,8 +129,9 @@ return 0; } -static char flashhelp[] = "flash {blob|param|kernel|ramdisk}\n" -"Write <argument> image to flash\n"; +static char flashhelp[] = "flash {blob|param|kernel|ramdisk} [part]\n" +"Write <argument> image to flash using partition <part>. If <part> is omitted\n" +"assume <part>==<argument>\n"; __commandlist(Flash, "flash", flashhelp); |