Changeset 8c25a4a in mainline
- Timestamp:
- 2008-08-09T18:57:18Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b3105ff6
- Parents:
- 619e7c9b
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r619e7c9b r8c25a4a 135 135 -$(MAKE) -C uspace distclean 136 136 -$(MAKE) -C boot distclean 137 -rm Makefile.config137 rm -f Makefile.config tools/*.pyc 138 138 139 139 clean: … … 143 143 144 144 cscope: 145 -rm cscope.out146 -find kernel boot uspace -regex '^.*\.[chsS]$$' -print >srclist147 -cscope -bi srclist145 find kernel boot uspace -regex '^.*\.[chsS]$$' -print > srclist 146 rm -f cscope.out 147 cscope -bi srclist -
tools/mkhord.py
r619e7c9b r8c25a4a 39 39 return (((size) + ((alignment) - 1)) & ~((alignment) - 1)) 40 40 41 42 41 def usage(prname): 43 42 "Print usage syntax" … … 61 60 inf = file(fs_image, "rb") 62 61 outf = file(sys.argv[3], "wb") 63 62 64 63 header_size = align_up(18, align) 65 64 aligned_size = align_up(os.path.getsize(fs_image), align) 66 67 65 68 66 outf.write(struct.pack("<4sBBLQ", "HORD", 1, 1, header_size, aligned_size)) -
tools/mktmpfs.py
r619e7c9b r8c25a4a 34 34 import os 35 35 import struct 36 import xstruct 37 38 HEADER = xstruct.convert("little: char[5]") 39 DENTRY = xstruct.convert("little: uint8_t uint32_t") 40 SIZE = xstruct.convert("little: uint32_t") 41 42 DENTRY_NONE = 0 43 DENTRY_FILE = 1 44 DENTRY_DIRECTORY = 2 36 45 37 46 def usage(prname): 38 47 "Print usage syntax" 39 print prname + " < ALIGNMENT> <PATH> <IMAGE>"48 print prname + " <PATH> <IMAGE>" 40 49 41 50 def recursion(root, outf): 42 51 "Recursive directory walk" 43 44 payload_size = 045 52 46 53 for name in os.listdir(root): … … 48 55 49 56 if (os.path.isfile(canon)): 50 outf.write(struct.pack( "<BL" + ("%d" % len(name)) + "s", 1, len(name), name))51 payload_size += 5 + len(name)57 outf.write(struct.pack(DENTRY, DENTRY_FILE, len(name))) 58 outf.write(xstruct.little_string(name)) 52 59 size = os.path.getsize(canon) 53 60 rd = 0; 54 outf.write(struct.pack("<L", size)) 55 payload_size += 4 61 outf.write(struct.pack(SIZE, size)) 56 62 57 63 inf = file(canon, "r") … … 59 65 data = inf.read(4096); 60 66 outf.write(data) 61 payload_size += len(data)62 67 rd += len(data) 63 68 inf.close() 64 69 65 70 if (os.path.isdir(canon)): 66 outf.write(struct.pack("<BL" + ("%d" % len(name)) + "s", 2, len(name), name)) 67 payload_size += 5 + len(name) 68 payload_size += recursion(canon, outf) 69 outf.write(struct.pack("<BL", 0, 0)) 70 payload_size += 5 71 72 return payload_size 71 outf.write(struct.pack(DENTRY, DENTRY_DIRECTORY, len(name))) 72 outf.write(xstruct.little_string(name)) 73 recursion(canon, outf) 74 outf.write(struct.pack(DENTRY, DENTRY_NONE, 0)) 73 75 74 76 def main(): … … 84 86 outf = file(sys.argv[2], "w") 85 87 86 outf.write(struct.pack( "<5s", "TMPFS"))88 outf.write(struct.pack(HEADER, "TMPFS")) 87 89 recursion(path, outf) 88 outf.write(struct.pack( "<BL", 0, 0))90 outf.write(struct.pack(DENTRY, DENTRY_NONE, 0)) 89 91 90 92 outf.close()
Note:
See TracChangeset
for help on using the changeset viewer.