Skip to content

Instantly share code, notes, and snippets.

@z4yx
Created Jun 15, 2013
Embed
What would you like to do?
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
SCRIPT_MAX_SIZE = 64*1024
if len(sys.argv)<3:
print "usage: mkrootimg.py script.bin uImage"
script_file = open(sys.argv[1], "rb")
uimage_file = open(sys.argv[2], "rb")
script_size = os.path.getsize(sys.argv[1])
if script_size > SCRIPT_MAX_SIZE:
print "script.bin is too large"
exit()
sys.stdout.write(script_file.read())
sys.stdout.write("\0" * (SCRIPT_MAX_SIZE-script_size))
sys.stdout.write(uimage_file.read())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment