3 @@ -37,6 +37,7 @@ struct mkimage_params params = {
5 .type = IH_TYPE_KERNEL,
8 .dtc = MKIMAGE_DEFAULT_DTC_OPTIONS,
11 @@ -180,6 +181,16 @@ main (int argc, char **argv)
12 genimg_get_comp_id (*++argv)) < 0)
18 + params.magic = strtoul (*++argv, &ptr, 16);
21 + "%s: invalid magic %s\n",
22 + params.cmdname, *argv);
28 @@ -580,12 +591,13 @@ usage ()
29 fprintf (stderr, "Usage: %s -l image\n"
30 " -l ==> list image header information\n",
32 - fprintf (stderr, " %s [-x] -A arch -O os -T type -C comp "
33 + fprintf (stderr, " %s [-x] -A arch -O os -T type -C comp -M magic "
34 "-a addr -e ep -n name -d data_file[:data_file...] image\n"
35 " -A ==> set architecture to 'arch'\n"
36 " -O ==> set operating system to 'os'\n"
37 " -T ==> set image type to 'type'\n"
38 " -C ==> set compression type 'comp'\n"
39 + " -M ==> set image magic to 'magic'\n"
40 " -a ==> set load address to 'addr' (hex)\n"
41 " -e ==> set entry point to 'ep' (hex)\n"
42 " -n ==> set image name to 'name'\n"
45 @@ -64,6 +64,7 @@ struct mkimage_params {
53 --- a/tools/default_image.c
54 +++ b/tools/default_image.c
55 @@ -110,7 +110,7 @@ static void image_set_header (void *ptr,
56 sbuf->st_size - sizeof(image_header_t));
58 /* Build new header */
59 - image_set_magic (hdr, IH_MAGIC);
60 + image_set_magic (hdr, params->magic);
61 image_set_time (hdr, sbuf->st_mtime);
62 image_set_size (hdr, sbuf->st_size - sizeof(image_header_t));
63 image_set_load (hdr, params->addr);