spl: Allow disabling binman symbols in SPL
[platform/kernel/u-boot.git] / tools / fit_common.c
index 4370de2..0164976 100644 (file)
@@ -134,7 +134,7 @@ int copyfile(const char *src, const char *dst)
                goto out;
        }
 
-       fd_dst = open(dst, O_WRONLY | O_CREAT, 0666);
+       fd_dst = open(dst, O_WRONLY | O_CREAT | O_TRUNC, 0666);
        if (fd_dst < 0) {
                printf("Can't open file %s (%s)\n", dst, strerror(errno));
                goto out;
@@ -175,3 +175,16 @@ int copyfile(const char *src, const char *dst)
 
        return ret;
 }
+
+void summary_show(struct image_summary *summary, const char *imagefile,
+                 const char *keydest)
+{
+       if (summary->sig_offset) {
+               printf("Signature written to '%s', node '%s'\n", imagefile,
+                      summary->sig_path);
+               if (keydest) {
+                       printf("Public key written to '%s', node '%s'\n",
+                              keydest, summary->keydest_path);
+               }
+       }
+}