diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-11-27 16:20:51 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-11-29 20:55:50 +0100 |
commit | 19a0c370aa0d575a17679a76f226b591e68c2ff7 (patch) | |
tree | 9372f0a5a23b37413c52d76750689c5f563bfece /commands | |
parent | 72bdddcca38dd8ad234c8a8d98651c01c503296a (diff) | |
download | barebox-19a0c370aa0d575a17679a76f226b591e68c2ff7.tar.gz barebox-19a0c370aa0d575a17679a76f226b591e68c2ff7.tar.xz |
bootm: do not require -L after -r
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/bootm.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/commands/bootm.c b/commands/bootm.c index 6255c03e7d..9ae4e2287c 100644 --- a/commands/bootm.c +++ b/commands/bootm.c @@ -149,11 +149,11 @@ static int do_bootm(struct command *cmdtp, int argc, char *argv[]) struct image_handle *os_handle = NULL; struct image_handler *handler; struct image_data data; - u32 initrd_start; int ret = 1; memset(&data, 0, sizeof(struct image_data)); data.verify = 1; + data.initrd_address = ~0; while ((opt = getopt(argc, argv, "nr:L:")) > 0) { switch(opt) { @@ -161,13 +161,7 @@ static int do_bootm(struct command *cmdtp, int argc, char *argv[]) data.verify = 0; break; case 'L': - if (!data.initrd) { - eprintf("Warning -L ingnored. Specify the initrd first\n"); - break; - } - initrd_start = simple_strtoul(optarg, NULL, 0); - printf("initrd_start=0x%x\n", initrd_start); - data.initrd->header.ih_load = cpu_to_uimage(initrd_start); + data.initrd_address = simple_strtoul(optarg, NULL, 0); break; case 'r': printf("use initrd %s\n", optarg); @@ -187,6 +181,9 @@ static int do_bootm(struct command *cmdtp, int argc, char *argv[]) } } + if (data.initrd && data.initrd_address != ~0) + data.initrd->header.ih_load = cpu_to_uimage(data.initrd_address); + if (optind == argc) { ret = COMMAND_ERROR_USAGE; goto err_out; |