summaryrefslogtreecommitdiff
path: root/kexec/arch/i386/kexec-multiboot-x86.c
diff options
context:
space:
mode:
authorMatt Evans <matt@ozlabs.org>2010-05-14 14:15:09 +1000
committerSimon Horman <horms@verge.net.au>2010-05-19 12:18:29 +0900
commit436f1376e1621aeba54d8253244955df4865d5e9 (patch)
treeab557c57d939167e8a3217b960e7a54b95fcf18a /kexec/arch/i386/kexec-multiboot-x86.c
parentb1dcc08ea79ca96256a9ae6ef59e5ea4e217ef1d (diff)
kexec-tools: Fix option/argument parsing
The argument parsing is currently a bit broken as main()'s getopt_long() knows nothing about either the architecture-specific options or, even more specifically, the architecture-and-loader-specific options. This patch introduces new #defines for all architectures, KEXEC_ALL_OPTIONS and KEXEC_ALL_OPT_STR. These contain all possible options for a given build, and the getopt_long() passes in main() and arch_process_options() will now recognise arch- and loader-specific options; these will not be re-ordered in argv[], there is no confusion over which argv[] entry is the kernel filename, and using '--opt=foo' and '--opt foo' both work. All architectures have command line options (and #define OPT_BLAHs) consolidated into their include/arch/option.h files. x86_64 builds parts of i386/ as well, so now both share a single option.h file (with a symlink). Signed-off-by: Matt Evans <matt@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/arch/i386/kexec-multiboot-x86.c')
-rw-r--r--kexec/arch/i386/kexec-multiboot-x86.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/kexec/arch/i386/kexec-multiboot-x86.c b/kexec/arch/i386/kexec-multiboot-x86.c
index 970de2a..23dab7b 100644
--- a/kexec/arch/i386/kexec-multiboot-x86.c
+++ b/kexec/arch/i386/kexec-multiboot-x86.c
@@ -157,10 +157,7 @@ int multiboot_x86_load(int argc, char **argv, const char *buf, off_t len,
uint32_t u;
int opt;
int modules, mod_command_line_space;
-#define OPT_CL (OPT_ARCH_MAX+0)
-#define OPT_REUSE_CMDLINE (OPT_ARCH_MAX+1)
-#define OPT_MOD (OPT_ARCH_MAX+2)
-#define OPT_VGA (OPT_ARCH_MAX+3)
+ /* See options.h -- add any more there, too. */
static const struct option options[] = {
KEXEC_ARCH_OPTIONS
{ "command-line", 1, 0, OPT_CL },