Changes in tools/mkuimage.py [5711f6e:a44ae3dd] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/mkuimage.py
r5711f6e ra44ae3dd 60 60 load_addr = 0 61 61 start_addr = 0 62 os_type = 5 #Linux is the default63 62 64 63 while len(args) >= 2 and args[0][0] == '-': … … 72 71 elif opt == 'saddr': 73 72 start_addr = (int)(optarg, 0) 74 elif opt == 'ostype':75 os_type = (int)(optarg, 0)76 73 else: 77 74 print(base_name + ": Unrecognized option.") … … 88 85 89 86 try: 90 mkuimage(inf_name, outf_name, image_name, load_addr, start_addr , os_type)87 mkuimage(inf_name, outf_name, image_name, load_addr, start_addr) 91 88 except: 92 89 os.remove(outf_name) 93 90 raise 94 91 95 def mkuimage(inf_name, outf_name, image_name, load_addr, start_addr , os_type):92 def mkuimage(inf_name, outf_name, image_name, load_addr, start_addr): 96 93 inf = open(inf_name, 'rb') 97 94 outf = open(outf_name, 'wb') … … 123 120 header.start_addr = start_addr # Address of entry point 124 121 header.data_crc = data_crc 125 header.os = os_type122 header.os = 2 # NetBSD 126 123 header.arch = 2 # ARM 127 124 header.img_type = 2 # Kernel 128 125 header.compression = 0 # None 129 header.img_name = image_name .encode('ascii')126 header.img_name = image_name 130 127 131 128 header_crc = calc_crc32(header.pack()) … … 143 140 signed_crc = zlib.crc32(byteseq, 0) 144 141 if signed_crc < 0: 145 return signed_crc + (1 << 32)142 return (long(signed_crc) + (long(2) ** long(32))) # 2^32L 146 143 else: 147 144 return signed_crc … … 151 148 def print_syntax(cmd): 152 149 print("syntax: " + cmd + " [<options>] <raw_image> <uImage>") 153 print ()150 print 154 151 print("\traw_image\tInput image name (raw binary data)") 155 152 print("\tuImage\t\tOutput uImage name (U-Boot image)") 156 print ()153 print 157 154 print("options:") 158 155 print("\t-name <name>\tImage name (default: 'Noname')")
Note:
See TracChangeset
for help on using the changeset viewer.