Changes in tools/mkuimage.py [28f4adb:928d983] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/mkuimage.py

    r28f4adb r928d983  
    7272                        start_addr = (int)(optarg, 0)
    7373                else:
    74                         print(base_name + ": Unrecognized option.")
     74                        print base_name + ": Unrecognized option."
    7575                        print_syntax(cmd_name)
    7676                        return
    7777
    7878        if len(args) < 2:
    79                 print(base_name + ": Argument missing.")
     79                print base_name + ": Argument missing."
    8080                print_syntax(cmd_name)
    8181                return
     
    9191
    9292def mkuimage(inf_name, outf_name, image_name, load_addr, start_addr):
    93         inf = open(inf_name, 'rb')
    94         outf = open(outf_name, 'wb')
     93        inf = file(inf_name, 'rb')
     94        outf = file(outf_name, 'wb')
    9595
    9696        header = xstruct.create(UIMAGE_HEADER)
     
    140140        signed_crc = zlib.crc32(byteseq, 0)
    141141        if signed_crc < 0:
    142                 return (long(signed_crc) + (long(2) ** long(32))) # 2^32L
     142                return (long(signed_crc) + 4294967296L) # 2^32L
    143143        else:
    144144                return signed_crc
     
    147147#
    148148def print_syntax(cmd):
    149         print("syntax: " + cmd + " [<options>] <raw_image> <uImage>")
     149        print "syntax: " + cmd + " [<options>] <raw_image> <uImage>"
    150150        print
    151         print("\traw_image\tInput image name (raw binary data)")
    152         print("\tuImage\t\tOutput uImage name (U-Boot image)")
     151        print "\traw_image\tInput image name (raw binary data)"
     152        print "\tuImage\t\tOutput uImage name (U-Boot image)"
    153153        print
    154         print("options:")
    155         print("\t-name <name>\tImage name (default: 'Noname')")
    156         print("\t-laddr <name>\tLoad address (default: 0x00000000)")
    157         print("\t-saddr <name>\tStart address (default: 0x00000000)")
     154        print "options:"
     155        print "\t-name <name>\tImage name (default: 'Noname')"
     156        print "\t-laddr <name>\tLoad address (default: 0x00000000)"
     157        print "\t-saddr <name>\tStart address (default: 0x00000000)"
    158158
    159159if __name__ == '__main__':
Note: See TracChangeset for help on using the changeset viewer.