futility/updater_archive.c
/* Prints the information of objects in manifest (models and images) in JSON. */
Prints the information of objects in manifest (models and images) in JSON.
Prints the information of objects in manifest ( models and images ) in JSON .
void print_json_manifest(const struct manifest *manifest)
{
	int i, indent;
	struct archive *ar = manifest->archive;
	printf("{\n");
	for (i = 0, indent = 2; i < manifest->num; i++) {
		struct model_config *m = &manifest->models[i];
		printf("%s%*s\"%s\": {\n", i ? ",\n" : "", indent, "", m->name);
		indent += 2;
		print_json_image("host", m->image, m, ar, indent, 1);
		print_json_image("ec", m->ec_image, m, ar, indent, 0);
		print_json_image("pd", m->pd_image, m, ar, indent, 0);
		if (m->patches.rootkey) {
			struct patch_config *p = &m->patches;
			printf(",\n%*s\"patches\": { \"rootkey\": \"%s\", "
			       "\"vblock_a\": \"%s\", \"vblock_b\": \"%s\" }",
			       indent, "", p->rootkey, p->vblock_a,
			       p->vblock_b);
		}
		if (m->signature_id)
			printf(",\n%*s\"signature_id\": \"%s\"", indent, "",
			       m->signature_id);
		printf("\n  }");
		indent -= 2;
		assert(indent == 2);
	}
	printf("\n}\n");
}
void print_json_manifest ( const struct manifest * manifest ) { int i , indent ; struct archive * ar = manifest -> archive ; printf ( " \n " ) ; for ( i = 0 , indent = 2 ; i < manifest -> num ; i ++ ) { struct model_config * m = & manifest -> models [ i ] ; printf ( " \" \" \n " , i ? " \n " : " " , indent , " " , m -> name ) ; indent += 2 ; print_json_image ( " " , m -> image , m , ar , indent , 1 ) ; print_json_image ( " " , m -> ec_image , m , ar , indent , 0 ) ; print_json_image ( " " , m -> pd_image , m , ar , indent , 0 ) ; if ( m -> patches . rootkey ) { struct patch_config * p = & m -> patches ; printf ( " \n \" \" \" \" \" \" " " \" \" \" \" \" \" \" \" " , indent , " " , p -> rootkey , p -> vblock_a , p -> vblock_b ) ; } if ( m -> signature_id ) printf ( " \n \" \" \" \" " , indent , " " , m -> signature_id ) ; printf ( " \n " ) ; indent -= 2 ; assert ( indent == 2 ) ; } printf ( " \n \n " ) ; }
Prints the information of objects in manifest (models and images) in JSON.
Prints the information of objects in manifest ( models and images ) in JSON .