Changeset 2444acb in rtems-tools


Ignore:
Timestamp:
Mar 4, 2020, 10:56:20 PM (4 months ago)
Author:
Amar Takhar <amar@…>
Branches:
5, master
Children:
00b9f1d
Parents:
9c7be8b
git-author:
Amar Takhar <amar@…> (03/04/20 22:56:20)
git-committer:
Amar Takhar <verm@…> (03/04/20 23:07:45)
Message:

Add print statement similar to the original mkimage.

This is limited to Python 2.6+

File:
1 edited

Legend:

Unmodified
Added
Removed
  • misc/tools/mkimage.py

    r9c7be8b r2444acb  
    2828# POSSIBILITY OF SUCH DAMAGE.
    2929
     30# We support Python 2.6+ so this is okay.
     31from __future__ import print_function
    3032
    3133import argparse
     
    3537import time
    3638import binascii
     39
     40
    3741
    3842MAGIC = 0x27051956
     
    126130inputcrc = inputcrc & 0xffffffff
    127131
    128 structdata = struct.pack(MAGIC, 0, int(time.time()), inputsize,
     132timestamp = int(time.time())
     133
     134structdata = struct.pack(MAGIC, 0, timestamp, inputsize,
    129135                int(options.addr,16), int(options.ep,16), inputcrc,
    130136                oss[options.os], archs[options.arch], types[options.type],
     
    133139headercrc = binascii.crc32(structdata) & 0xFFFFFFFF
    134140
    135 structdata =  struct.pack(MAGIC, headercrc, int(time.time()), inputsize,
     141structdata =  struct.pack(MAGIC, headercrc, timestamp, inputsize,
    136142                int(options.addr,16), int(options.ep,16), inputcrc,
    137143                oss[options.os], archs[options.arch], types[options.type],
     
    142148outputfile.close()
    143149inputfile.close()
     150
     151print("Image Name:   ", options.name)
     152print("Created:      ", time.ctime(timestamp))
     153print("Image Type:   ", options.comp)
     154print("Data Size:    ", inputsize)
     155print("Load Address: ", options.addr)
     156print("Entry Point:  ", options.ep)
Note: See TracChangeset for help on using the changeset viewer.