size = imagetool_get_filesize(params, params->datafile);
if (size < 0)
return -1;
-
total_size = size;
+
+ if (params->fit_ramdisk) {
+ size = imagetool_get_filesize(params, params->fit_ramdisk);
+ if (size < 0)
+ return -1;
+ total_size += size;
+ }
+
for (cont = params->content_head; cont; cont = cont->next) {
size = imagetool_get_filesize(params, cont->fname);
if (size < 0)
fdt_end_node(fdt);
}
+ /* And a ramdisk file if available */
+ if (params->fit_ramdisk) {
+ fdt_begin_node(fdt, FIT_RAMDISK_PROP "@1");
+
+ fdt_property_string(fdt, "type", FIT_RAMDISK_PROP);
+ fdt_property_string(fdt, "os", genimg_get_os_short_name(params->os));
+
+ ret = fdt_property_file(params, fdt, "data", params->fit_ramdisk);
+ if (ret)
+ return ret;
+
+ fdt_end_node(fdt);
+ }
+
fdt_end_node(fdt);
return 0;
snprintf(str, sizeof(str), "%s@1", typename);
fdt_property_string(fdt, typename, str);
+ if (params->fit_ramdisk)
+ fdt_property_string(fdt, FIT_RAMDISK_PROP,
+ FIT_RAMDISK_PROP "@1");
+
snprintf(str, sizeof(str), FIT_FDT_PROP "@%d", upto);
fdt_property_string(fdt, FIT_FDT_PROP, str);
fdt_end_node(fdt);
}
+
if (!upto) {
fdt_begin_node(fdt, "conf@1");
typename = genimg_get_type_short_name(params->fit_image_type);
snprintf(str, sizeof(str), "%s@1", typename);
fdt_property_string(fdt, typename, str);
+
+ if (params->fit_ramdisk)
+ fdt_property_string(fdt, FIT_RAMDISK_PROP,
+ FIT_RAMDISK_PROP "@1");
+
fdt_end_node(fdt);
}
int orig_file_size; /* Original size for file before padding */
bool auto_its; /* Automatically create the .its file */
int fit_image_type; /* Image type to put into the FIT */
+ char *fit_ramdisk; /* Ramdisk file to include */
struct content_info *content_head; /* List of files to include */
struct content_info *content_tail;
bool external_data; /* Store data outside the FIT */
" -x ==> set XIP (execute in place)\n",
params.cmdname);
fprintf(stderr,
- " %s [-D dtc_options] [-f fit-image.its|-f auto|-F] [-b <dtb> [-b <dtb>]] fit-image\n"
+ " %s [-D dtc_options] [-f fit-image.its|-f auto|-F] [-b <dtb> [-b <dtb>]] [-i <ramdisk.cpio.gz>] fit-image\n"
" <dtb> file is used with -f auto, it may occur multiple times.\n",
params.cmdname);
fprintf(stderr,
" -D => set all options for device tree compiler\n"
- " -f => input filename for FIT source\n");
+ " -f => input filename for FIT source\n"
+ " -i => input filename for ramdisk file\n");
#ifdef CONFIG_FIT_SIGNATURE
fprintf(stderr,
"Signing / verified boot options: [-E] [-k keydir] [-K dtb] [ -c <comment>] [-p addr] [-r]\n"
int opt;
while ((opt = getopt(argc, argv,
- "a:A:b:c:C:d:D:e:Ef:Fk:K:ln:p:O:rR:qsT:vVx")) != -1) {
+ "a:A:b:c:C:d:D:e:Ef:Fk:i:K:ln:p:O:rR:qsT:vVx")) != -1) {
switch (opt) {
case 'a':
params.addr = strtoull(optarg, &ptr, 16);
params.type = IH_TYPE_FLATDT;
params.fflag = 1;
break;
+ case 'i':
+ params.fit_ramdisk = optarg;
+ break;
case 'k':
params.keydir = optarg;
break;