.node = NULL,
};
-static const char *doc = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
" - a tool to print MTD information.";
-static const char *optionsstr =
+static const char optionsstr[] =
"-m, --mtdn=<MTD device number> MTD device number to get information about\n"
"-u, --ubi-info print what would UBI layout be if it was put\n"
" on this MTD device\n"
"-h, --help print help message\n"
"-V, --version print program version";
-static const char *usage =
+static const char usage[] =
"Usage 1: " PROGRAM_NAME " [-m <MTD device number>] [-u] [-h] [-V] [--mtdn <MTD device number>]\n"
"\t\t[--ubi-info] [--help] [--version]\n"
"Usage 2: " PROGRAM_NAME " <MTD device node file name> [-u] [-h] [-V] [--ubi-info] [--help]\n"
.dev = NULL,
};
-static const char *doc = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
" - a tool to attach MTD device to UBI.";
-static const char *optionsstr =
+static const char optionsstr[] =
"-d, --devn=<number> the number to assign to the newly created UBI device\n"
" (assigned automatically if this is not specified)\n"
"-p, --dev-path=<path> path to MTD device node to attach\n"
"-h, --help print help message\n"
"-V, --version print program version";
-static const char *usage =
+static const char usage[] =
"Usage: " PROGRAM_NAME " [<UBI control device node file name>]\n"
"\t[-m <MTD device number>] [-d <UBI device number>] [-p <path to device>]\n"
"\t[--mtdn=<MTD device number>] [--devn=<UBI device number>]\n"
#define BUFSIZE 4096
-static const char *doc = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
" - a tool to calculate CRC32 with UBI start value (0xFFFFFFFF)";
-static const char *optionsstr =
+static const char optionsstr[] =
"-h, --help print help message\n"
"-V, --version print program version";
-static const char *usage =
+static const char usage[] =
"Usage: " PROGRAM_NAME " <file to calculate CRC32 for> [-h] [--help]";
static const struct option long_options[] = {
.dev = NULL,
};
-static const char *doc = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
" - tool to remove UBI devices (detach MTD devices from UBI)";
-static const char *optionsstr =
+static const char optionsstr[] =
"-d, --devn=<UBI device number> UBI device number to delete\n"
"-p, --dev-path=<path to device> or alternatively, MTD device node path to detach\n"
"-m, --mtdn=<MTD device number> or alternatively, MTD device number to detach\n"
"-h, --help print help message\n"
"-V, --version print program version";
-static const char *usage =
+static const char usage[] =
"Usage: " PROGRAM_NAME " [<UBI control device node file name>]\n"
"\t[-d <UBI device number>] [-m <MTD device number>] [-p <path to device>]\n"
"\t[--devn=<UBI device number>] [--mtdn=<MTD device number>]\n"
.ubi_ver = 1,
};
-static const char *doc = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
" - a tool to format MTD devices and flash UBI images";
-static const char *optionsstr =
+static const char optionsstr[] =
"-s, --sub-page-size=<bytes> minimum input/output unit used for UBI\n"
" headers, e.g. sub-page size in case of NAND\n"
" flash (equivalent to the minimum input/output\n"
"-h, -?, --help print help message\n"
"-V, --version print program version\n";
-static const char *usage =
+static const char usage[] =
"Usage: " PROGRAM_NAME " <MTD device node file name> [-s <bytes>] [-O <offs>] [-n]\n"
"\t\t\t[-f <file>] [-S <bytes>] [-e <value>] [-x <num>] [-y] [-q] [-v] [-h] [-v]\n"
"\t\t\t[--sub-page-size=<bytes>] [--vid-hdr-offset=<offs>] [--no-volume-table]\n"
.vol_id = UBI_VOL_NUM_AUTO,
};
-static const char *doc = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
" - a tool to create UBI volumes.";
-static const char *optionsstr =
+static const char optionsstr[] =
"-a, --alignment=<alignment> volume alignment (default is 1)\n"
"-n, --vol_id=<volume ID> UBI volume ID, if not specified, the volume ID\n"
" will be assigned automatically\n"
"-V, --version print program version";
-static const char *usage =
+static const char usage[] =
"Usage: " PROGRAM_NAME " <UBI device node file name> [-h] [-a <alignment>] [-n <volume ID>] [-N <name>]\n"
"\t\t\t[-s <bytes>] [-S <LEBs>] [-t <static|dynamic>] [-V] [-m]\n"
"\t\t\t[--alignment=<alignment>][--vol_id=<volume ID>] [--name=<name>]\n"
.vol_name = NULL,
};
-static const char *doc = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
" - a tool to print UBI information.";
-static const char *optionsstr =
+static const char optionsstr[] =
"-d, --devn=<UBI device number> UBI device number to get information about\n"
"-n, --vol_id=<volume ID> ID of UBI volume to print information about\n"
"-N, --name=<volume name> name of UBI volume to print information about\n"
"-h, --help print help message\n"
"-V, --version print program version";
-static const char *usage =
+static const char usage[] =
"Usage 1: " PROGRAM_NAME " [-d <UBI device number>] [-n <volume ID> | -N <volume name>] [-a] [-h] [-V]\n"
"\t\t[--vol_id=<volume ID> | --name <volume name>] [--devn <UBI device number>] [--all] [--help] [--version]\n"
"Usage 2: " PROGRAM_NAME " <UBI device node file name> [-a] [-h] [-V] [--all] [--help] [--version]\n"
#include "common.h"
#include "ubiutils-common.h"
-static const char *doc = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
" - a tool to generate UBI images. An UBI image may contain one or more UBI "
"volumes which have to be defined in the input configuration ini-file. The "
"ini file defines all the UBI volumes - their characteristics and the and the "
"the command-line options. Note, if not sure about some of the command-line "
"parameters, do not specify them and let the utility to use default values.";
-static const char *optionsstr =
+static const char optionsstr[] =
"-o, --output=<file name> output file name\n"
"-p, --peb-size=<bytes> size of the physical eraseblock of the flash\n"
" this UBI image is created for in bytes,\n"
"-h, --help print help message\n"
"-V, --version print program version";
-static const char *usage =
+static const char usage[] =
"Usage: " PROGRAM_NAME " [-o filename] [-p <bytes>] [-m <bytes>] [-s <bytes>] [-O <num>] [-e <num>]\n"
"\t\t[-x <num>] [-Q <num>] [-v] [-h] [-V] [--output=<filename>] [--peb-size=<bytes>]\n"
"\t\t[--min-io-size=<bytes>] [--sub-page-size=<bytes>] [--vid-hdr-offset=<num>]\n"
"Example: " PROGRAM_NAME " -o ubi.img -p 16KiB -m 512 -s 256 cfg.ini - create UBI image\n"
" 'ubi.img' as described by configuration file 'cfg.ini'";
-static const char *ini_doc = "INI-file format.\n"
+static const char ini_doc[] = "INI-file format.\n"
"The input configuration ini-file describes all the volumes which have to\n"
"be included to the output UBI image. Each volume is described in its own\n"
"section which may be named arbitrarily. The section consists on\n"
" put all the volumes which are described by these section to the output\n"
" UBI image file.";
-struct option long_options[] = {
+static const struct option long_options[] = {
{ .name = "output", .has_arg = 1, .flag = NULL, .val = 'o' },
{ .name = "peb-size", .has_arg = 1, .flag = NULL, .val = 'p' },
{ .name = "min-io-size", .has_arg = 1, .flag = NULL, .val = 'm' },
#include <libubi.h>
#include "common.h"
-static const char *usage =
+static const char usage[] =
"Usage: " PROGRAM_NAME " <UBI device node file name> [<old name> <new name>|...]\n\n"
"Example: " PROGRAM_NAME "/dev/ubi0 A B C D - rename volume A to B, and C to D\n\n"
"This utility allows re-naming several volumes in one go atomically.\n"
.vol_id = -1,
};
-static const char *doc = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
" - a tool to remove UBI volumes.";
-static const char *optionsstr =
+static const char optionsstr[] =
"-n, --vol_id=<volume id> volume ID to remove\n"
"-N, --name=<volume name> volume name to remove\n"
"-h, -?, --help print help message\n"
"-V, --version print program version";
-static const char *usage =
+static const char usage[] =
"Usage: " PROGRAM_NAME " <UBI device node file name> [-n <volume id>] [--vol_id=<volume id>]\n\n"
" [-N <volume name>] [--name=<volume name>] [-h] [--help]\n\n"
"Example: " PROGRAM_NAME "/dev/ubi0 -n 1 - remove UBI volume 1 from UBI device corresponding\n"
.lebs = -1,
};
-static const char *doc = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
" - a tool to resize UBI volumes.";
-static const char *optionsstr =
+static const char optionsstr[] =
"-n, --vol_id=<volume id> volume ID to resize\n"
"-N, --name=<volume name> volume name to resize\n"
"-s, --size=<bytes> volume size volume size in bytes, kilobytes (KiB)\n"
"-V, --version print program version";
-static const char *usage =
+static const char usage[] =
"Usage: " PROGRAM_NAME " <UBI device node file name> [-n <volume id>] [--vol_id=<volume id>]\n\n"
" [-N <volume name>] [--name=<volume name>] [-s <bytes>] [-S <LEBs>] [-h] [--help]\n\n"
"Example: " PROGRAM_NAME " /dev/ubi0 -n 1 -s 1MiB resize UBI volume 1 to 1 MiB on\n"
static struct args args;
-static const char *doc = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
" - a tool to write data to UBI volumes.";
-static const char *optionsstr =
+static const char optionsstr[] =
"-t, --truncate truncate volume (wipe it out)\n"
"-s, --size=<bytes> bytes in input, if not reading from file\n"
"-h, --help print help message\n"
"-V, --version print program version";
-static const char *usage =
+static const char usage[] =
"Usage: " PROGRAM_NAME " <UBI volume node file name> [-t] [-s <size>] [-h] [-V] [--truncate]\n"
"\t\t\t[--size=<size>] [--help] [--version] <image file>\n\n"
"Example 1: " PROGRAM_NAME " /dev/ubi0_1 fs.img - write file \"fs.img\" to UBI volume /dev/ubi0_1\n"
"Example 2: " PROGRAM_NAME " /dev/ubi0_1 -t - wipe out UBI volume /dev/ubi0_1";
-struct option long_options[] = {
+static const struct option long_options[] = {
{ .name = "truncate", .has_arg = 0, .flag = NULL, .val = 't' },
{ .name = "help", .has_arg = 0, .flag = NULL, .val = 'h' },
{ .name = "version", .has_arg = 0, .flag = NULL, .val = 'V' },