* 1.2 Generates separated OOB data, if needed. (oloh)
* 1.3 Padds data/oob to a given size. (oloh)
* 1.4 Removed argp because we want to use uClibc.
+ * 1.5 Minor cleanup
*/
#include <unistd.h>
#include "config.h"
#include "nandecc.h"
-#define PROGRAM_VERSION "1.4"
+#define PROGRAM_VERSION "1.5"
#define CHECK_ENDP(option, endp) do { \
if (*endp) { \
#define PADDING 0 /* 0 means, do not adjust anything */
#define BUFSIZE 4096
-extern char *optarg;
-extern int optind;
-
static char doc[] = "\nVersion: " PROGRAM_VERSION "\n\tBuilt on "
BUILD_CPU" "BUILD_OS" at "__DATE__" "__TIME__"\n"
"\n"
* Create boot-parameter/pdd data from an ASCII-text input file.
*
* 1.2 Removed argp because we want to use uClibc.
+ * 1.3 Minor cleanup
*/
#include <stdio.h>
#include "bootenv.h"
#include "error.h"
-#define PROGRAM_VERSION "1.2"
-
-extern char *optarg;
-extern int optind;
+#define PROGRAM_VERSION "1.3"
static char doc[] = "\nVersion: " PROGRAM_VERSION "\n\tBuilt on "
BUILD_CPU" "BUILD_OS" at "__DATE__" "__TIME__"\n"
* An utility to decompose NAND images and strip OOB off. Not yet finished ...
*
* 1.2 Removed argp because we want to use uClibc.
+ * 1.3 Minor cleanup
*/
#include <config.h>
#include "config.h"
#include "nandecc.h"
-#define PROGRAM_VERSION "1.2"
+#define PROGRAM_VERSION "1.3"
#define MAXPATH 1024
#define MIN(x,y) ((x)<(y)?(x):(y))
-extern char *optarg;
-extern int optind;
-
struct args {
const char *oob_file;
const char *output_file;
/*
* @brief Parse the arguments passed into the test case.
*
- * @param key The parameter.
- * @param arg Argument passed to parameter.
- * @param state Location to put information on parameters.
+ * @param argc The number of arguments
+ * @param argv The argument list
+ * @param args Pointer to program args structure
*
* @return error
*
- * Get the `input' argument from `argp_parse', which we know is a
- * pointer to our arguments structure.
*/
static int
parse_opt(int argc, char **argv, struct args *args)
* PDD modification.
*
* 1.3 Removed argp because we want to use uClibc.
+ * 1.4 Minor cleanups
*/
#include <stdio.h>
#include "libubi.h"
#include "ubimirror.h"
-#define PROGRAM_VERSION "1.3"
+#define PROGRAM_VERSION "1.4"
typedef enum action_t {
ACT_NORMAL = 0,
args->action = ACT_ARGP_ERR; \
} while (0)
-extern char *optarg;
-extern int optind;
-
static char doc[] = "\nVersion: " PROGRAM_VERSION "\n\tBuilt on "
BUILD_CPU" "BUILD_OS" at "__DATE__" "__TIME__"\n"
"\n"
" -V, --version Print program version\n";
static const char *usage =
-"Usage: pddcustomize.orig [-bclx?V] [-i <input>] [-o <output>] [-s <seqnum>]\n"
+"Usage: pddcustomize [-bclx?V] [-i <input>] [-o <output>] [-s <seqnum>]\n"
" [--both] [--copyright] [--input=<input>] [--list]\n"
" [--output=<output>] [--side=<seqnum>] [--host] [--help] [--usage]\n"
" [--version] [key=value] [...]\n";
args->file_out = optarg;
break;
case '?': /* help */
- err_msg("Usage: pddcustomize.orig [OPTION...] "
+ err_msg("Usage: pddcustomize [OPTION...] "
"[key=value] [...]");
err_msg("%s", doc);
err_msg("%s", optionsstr);
* required to add the right OOB data to the binary image.
*
* 1.3 Removed argp because we want to use uClibc.
+ * 1.4 Minor cleanups
*/
#include <stdlib.h>
#include "peb.h"
#include "crc32.h"
-#define PROGRAM_VERSION "1.3"
+#define PROGRAM_VERSION "1.4"
#define MAX_FNAME 255
#define DEFAULT_ERASE_COUNT 0 /* Hmmm.... Perhaps */
#define MIN(a,b) ((a) < (b) ? (a) : (b))
-extern char *optarg;
-extern int optind;
-
static uint32_t crc32_table[256];
static char err_buf[ERR_BUF_SIZE];
" -V, --version Print program version\n";
static const char *usage =
-"Usage: pfi2bin.orig [-cv?V] [-j pdd-file] [-o filename] [--copyright]\n"
+"Usage: pfi2bin [-cv?V] [-j pdd-file] [-o filename] [--copyright]\n"
" [--verbose] [--platform=pdd-file] [--output=filename] [--help]\n"
" [--usage] [--version] pfifile\n";
* 1.1 fixed output to stderr and stdout in logfile mode.
* 1.2 updated.
* 1.3 removed argp parsing to be able to use uClib.
+ * 1.4 Minor cleanups
*/
#include <unistd.h>
#include "error.h"
#include "config.h"
-#define PROGRAM_VERSION "1.3"
-
-extern char *optarg;
-extern int optind;
+#define PROGRAM_VERSION "1.4"
static char doc[] = "\nVersion: " PROGRAM_VERSION "\n\tBuilt on "
BUILD_CPU" "BUILD_OS" at "__DATE__" "__TIME__"\n"
" -V, --version Print program version\n";
static const char *usage =
-"Usage: pfiflash.orig [-cvC?V] [-l <file>] [-p <type>] [-r <dev>] [-s <seqnum>]\n"
+"Usage: pfiflash [-cvC?V] [-l <file>] [-p <type>] [-r <dev>] [-s <seqnum>]\n"
" [--copyright] [--logfile=<file>] [--verbose] [--complete]\n"
" [--pdd-update=<type>] [--raw-flash=<dev>] [--side=<seqnum>]\n"
" [--help] [--usage] [--version] [pfifile]\n";
* 1.0 Initial version
* 1.1 Different CRC32 start value
* 1.2 Removed argp because we want to use uClibc.
+ * 1.3 Minor cleanups
*/
#include <stdlib.h>
#include "ubigen.h"
#include "config.h"
-#define PROGRAM_VERSION "1.2"
+#define PROGRAM_VERSION "1.3"
typedef enum action_t {
ACT_NORMAL = 0x00000001,
ACT_BROKEN_UPDATE = 0x00000002,
} action_t;
-extern char *optarg;
-extern int optind;
-
static char doc[] = "\nVersion: " PROGRAM_VERSION "\n\tBuilt on "
BUILD_CPU" "BUILD_OS" at "__DATE__" "__TIME__"\n"
"\n"
" -V, --version Print program version\n";
static const char *usage =
-"Usage: ubigen.orig [-cdv?V] [-A <num>] [-B <num>] [-E <num>] [-I <num>]\n"
+"Usage: ubigen [-cdv?V] [-A <num>] [-B <num>] [-E <num>] [-I <num>]\n"
" [-O <num>] [-T <num>] [-X <num>] [-i <filename>] [-o <filename>]\n"
" [-U <leb>] [--copyright] [--debug] [--verbose] [--alignment=<num>]\n"
" [--blocksize=<num>] [--erasecount=<num>] [--id=<num>]\n"
* Author: Oliver Lohmann
*
* 1.2 Removed argp because we want to use uClibc.
+ * 1.3 Minor cleanups
*/
#include <stdio.h>
#include "example_ubi.h"
#include "ubimirror.h"
-#define PROGRAM_VERSION "1.2"
+#define PROGRAM_VERSION "1.3"
typedef enum action_t {
ACT_NORMAL = 0,
#define VOL_ARGS_MAX 2
-extern char *optarg;
-extern int optind;
-
static char doc[] = "\nVersion: " PROGRAM_VERSION "\n\tBuilt on "
BUILD_CPU" "BUILD_OS" at "__DATE__" "__TIME__"\n"
"\n"
* the number of bytes.
* 1.2 Reworked the user-interface to use argp.
* 1.3 Removed argp because we want to use uClibc.
+ * 1.4 Minor cleanups
*/
#include <stdio.h>
#include <config.h>
#include <libubi.h>
-#define PROGRAM_VERSION "1.3"
-
-extern char *optarg;
-extern int optind;
+#define PROGRAM_VERSION "1.4"
/*
* The variables below are set by command line arguments.
/*
* @brief Parse the arguments passed into the test case.
*
- * @param key The parameter.
- * @param arg Argument passed to parameter.
- * @param state Location to put information on parameters.
+ * @param argc The number of arguments
+ * @param argv The list of arguments
+ * @param args Pointer to argument structure
*
* @return error
*
- * Get the `input' argument from `argp_parse', which we know is a
- * pointer to our arguments structure.
*/
static int
parse_opt(int argc, char **argv, struct args *args)
else if (!strcmp(optarg, "static"))
args->vol_type = UBI_STATIC_VOLUME;
else {
- fprintf(stderr, "Bad volume type: \"%s\"\n",
- optarg);
+ fprintf(stderr,
+ "Bad volume type: \"%s\"\n",
+ optarg);
goto out;
}
break;
case 's':
args->bytes = strtoull(optarg, &endp, 0);
if (endp == optarg || args->bytes < 0) {
- fprintf(stderr, "Bad volume size: \"%s\"\n",
- optarg);
+ fprintf(stderr,
+ "Bad volume size: \"%s\"\n",
+ optarg);
goto out;
}
if (endp != '\0') {
break;
case 'd': /* --devn=<device number> */
args->devn = strtoul(optarg, &endp, 0);
- if (*endp != '\0' || endp == optarg || args->devn < 0) {
- fprintf(stderr, "Bad UBI device number: "
- "\"%s\"\n", optarg);
+ if (*endp != '\0' || endp == optarg ||
+ args->devn < 0) {
+ fprintf(stderr,
+ "Bad UBI device number: "
+ "\"%s\"\n", optarg);
goto out;
}
break;
goto out;
case '?': /* help */
- fprintf(stderr, "Usage: ubimkvol [OPTION...]\n");
+ fprintf(stderr,
+ "Usage: ubimkvol [OPTION...]\n");
fprintf(stderr, "%s", doc);
fprintf(stderr, "%s", optionsstr);
fprintf(stderr, "\nReport bugs to %s\n",
*
* 1.1 Reworked the userinterface to use argp.
* 1.2 Removed argp because we want to use uClibc.
+ * 1.3 Minor cleanups
*/
#include <stdio.h>
#include <config.h>
#include <libubi.h>
-#define PROGRAM_VERSION "1.2"
-
-extern char *optarg;
-extern int optind;
+#define PROGRAM_VERSION "1.3"
/*
* The below variables are set by command line options.
/*
* @brief Parse the arguments passed into the test case.
*
- * @param key The parameter.
- * @param arg Argument passed to parameter.
- * @param state Location to put information on parameters.
+ * @param argc The number of arguments
+ * @param argv The list of arguments
+ * @param args Pointer to argument structure
*
* @return error
*
- * Get the `input' argument from `argp_parse', which we know is a
- * pointer to our arguments structure.
*/
static int
parse_opt(int argc, char **argv, struct args *args)
switch (key) {
case 'd': /* --devn=<device number> */
args->devn = strtoul(optarg, &endp, 0);
- if (*endp != '\0' || endp == optarg || args->devn < 0) {
- fprintf(stderr, "Bad UBI device number: "
- "\"%s\"\n", optarg);
+ if (*endp != '\0' || endp == optarg ||
+ args->devn < 0) {
+ fprintf(stderr,
+ "Bad UBI device number: "
+ "\"%s\"\n", optarg);
goto out;
}
break;
fprintf(stderr, "Parameter is missing\n");
goto out;
case '?': /* help */
- fprintf(stderr, "Usage: ubirmvol [OPTION...]\n");
+ fprintf(stderr,
+ "Usage: ubirmvol [OPTION...]\n");
fprintf(stderr, "%s", doc);
fprintf(stderr, "%s", optionsstr);
fprintf(stderr, "\nReport bugs to %s\n",
*
* 1.0 Reworked the userinterface to use argp.
* 1.1 Removed argp parsing because we want to use uClib.
+ * 1.2 Minor cleanups
*/
#include <errno.h>
#include <config.h>
#include <libubi.h>
-#define PROGRAM_VERSION "1.1"
+#define PROGRAM_VERSION "1.2"
#define MAXPATH 1024
#define BUFSIZE 128 * 1024
#define MIN(x,y) ((x)<(y)?(x):(y))
-/* FIXME is this not covered by including getopt.h? */
-extern char *optarg;
-extern int optind;
-
struct args {
int devn;
int vol_id;
* Drake Dowsett, dowsett@de.ibm.com
*
* 1.2 Removed argp because we want to use uClibc.
+ * 1.3 Minor cleanups
*/
/*
#define EXEC "unubi"
#define CONTACT "haver@vnet.ibm.com"
-#define VERSION "1.0"
-
-extern char *optarg;
-extern int optind;
+#define VERSION "1.3"
static char doc[] = "\nVersion: " VERSION "\n\t"
BUILD_OS" "BUILD_CPU" at "__DATE__" "__TIME__"\n"
return num;
}
-
-/**
- * parses the arguments passed into the program
- * get the input argument from argp_parse, which we know is a
- * pointer to our arguments structure;
- **/
static int
parse_opt(int argc, char **argv, struct args *args)
{
args->vol_split = SPLIT_RAW;
break;
case '?': /* help */
- fprintf(stderr, "Usage: unubi [OPTION...] image-file\n");
+ fprintf(stderr,
+ "Usage: unubi [OPTION...] "
+ "image-file\n");
fprintf(stderr, "%s", doc);
fprintf(stderr, "%s", optionsstr);
- fprintf(stderr, "\nReport bugs to %s\n", CONTACT);
+ fprintf(stderr,
+ "\nReport bugs to %s\n", CONTACT);
exit(0);
break;
case 'J':