Changeset 20235a3 in mainline for tools/mkfat.py
- Timestamp:
- 2010-09-02T20:55:28Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0c39b96
- Parents:
- 0c61955 (diff), 3249673 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/mkfat.py
r0c61955 r20235a3 343 343 def usage(prname): 344 344 "Print usage syntax" 345 print prname + " < PATH> <IMAGE>"345 print prname + " <EXTRA_BYTES> <PATH> <IMAGE>" 346 346 347 347 def main(): 348 if (len(sys.argv) < 3):348 if (len(sys.argv) < 4): 349 349 usage(sys.argv[0]) 350 350 return 351 351 352 path = os.path.abspath(sys.argv[1]) 352 if (not sys.argv[1].isdigit()): 353 print "<EXTRA_BYTES> must be a number" 354 return 355 356 extra_bytes = int(sys.argv[1]) 357 358 path = os.path.abspath(sys.argv[2]) 353 359 if (not os.path.isdir(path)): 354 360 print "<PATH> must be a directory" … … 365 371 366 372 # Make sure the filesystem is large enought for FAT16 367 size = subtree_size(path, cluster_size, dirent_size) + reserved_clusters * cluster_size 373 size = subtree_size(path, cluster_size, dirent_size) + reserved_clusters * cluster_size + extra_bytes 368 374 while (size / cluster_size < fat16_clusters): 369 375 if (cluster_size > sector_size): 370 376 cluster_size /= 2 371 size = subtree_size(path, cluster_size, dirent_size) + reserved_clusters * cluster_size 377 size = subtree_size(path, cluster_size, dirent_size) + reserved_clusters * cluster_size + extra_bytes 372 378 else: 373 379 size = fat16_clusters * cluster_size + reserved_clusters * cluster_size … … 381 387 data_start = root_start + root_size 382 388 383 outf = file(sys.argv[ 2], "w")389 outf = file(sys.argv[3], "w") 384 390 385 391 boot_sector = xstruct.create(BOOT_SECTOR)
Note:
See TracChangeset
for help on using the changeset viewer.