diff options
| author | Damien George <damien.p.george@gmail.com> | 2017-09-06 13:40:51 +1000 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2017-09-06 13:40:51 +1000 |
| commit | 01dd7804b87d60b2deab16712eccb3b97351a9b7 (patch) | |
| tree | 1aa21f38a872b8e62a3d4e4f74f68033c6f827e4 /esp8266/makeimg.py | |
| parent | a9862b30068fc9df1022f08019fb35aaa5085f64 (diff) | |
ports: Make new ports/ sub-directory and move all ports there.
This is to keep the top-level directory clean, to make it clear what is
core and what is a port, and to allow the repository to grow with new ports
in a sustainable way.
Diffstat (limited to 'esp8266/makeimg.py')
| -rw-r--r-- | esp8266/makeimg.py | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/esp8266/makeimg.py b/esp8266/makeimg.py deleted file mode 100644 index 091854fa4..000000000 --- a/esp8266/makeimg.py +++ /dev/null @@ -1,40 +0,0 @@ -import sys -import struct -import hashlib - -SEGS_MAX_SIZE = 0x9000 - -assert len(sys.argv) == 4 - -md5 = hashlib.md5() - -with open(sys.argv[3], 'wb') as fout: - - with open(sys.argv[1], 'rb') as f: - data_flash = f.read() - fout.write(data_flash) - # First 4 bytes include flash size, etc. which may be changed - # by esptool.py, etc. - md5.update(data_flash[4:]) - print('flash ', len(data_flash)) - - with open(sys.argv[2], 'rb') as f: - data_rom = f.read() - - pad = b'\xff' * (SEGS_MAX_SIZE - len(data_flash)) - assert len(pad) >= 4 - fout.write(pad[:-4]) - md5.update(pad[:-4]) - len_data = struct.pack("I", SEGS_MAX_SIZE + len(data_rom)) - fout.write(len_data) - md5.update(len_data) - print('padding ', len(pad)) - - fout.write(data_rom) - md5.update(data_rom) - print('irom0text', len(data_rom)) - - fout.write(md5.digest()) - - print('total ', SEGS_MAX_SIZE + len(data_rom)) - print('md5 ', md5.hexdigest()) |
