Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 14f2100 in mainline


Ignore:
Timestamp:
2010-07-28T15:24:16Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
9a1d8ab
Parents:
7dfd339
Message:

create FAT with a guaranteed amount of free space

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile

    r7dfd339 r14f2100  
    4848endif
    4949ifeq ($(RDFMT),fat)
    50         $(MKFAT) $(DIST_PATH) $@
     50        $(MKFAT) 1048576 $(DIST_PATH) $@
    5151endif
    5252
  • contrib/conf/ia32-qe.sh

    r7dfd339 r14f2100  
    55# Create a disk image if it does not exist
    66if [ ! -f "$DISK_IMG" ]; then
    7         tools/mkfat.py uspace/dist/data "$DISK_IMG"
     7        tools/mkfat.py 1048576 uspace/dist/data "$DISK_IMG"
    88fi
    99
  • contrib/conf/mips32-gx.sh

    r7dfd339 r14f2100  
    55# Create a disk image if it does not exist
    66if [ ! -f "$DISK_IMG" ]; then
    7         tools/mkfat.py uspace/dist/data "$DISK_IMG"
     7        tools/mkfat.py 1048576 uspace/dist/data "$DISK_IMG"
    88fi
    99
  • tools/mkfat.py

    r7dfd339 r14f2100  
    343343def usage(prname):
    344344        "Print usage syntax"
    345         print prname + " <PATH> <IMAGE>"
     345        print prname + " <EXTRA_BYTES> <PATH> <IMAGE>"
    346346
    347347def main():
    348         if (len(sys.argv) < 3):
     348        if (len(sys.argv) < 4):
    349349                usage(sys.argv[0])
    350350                return
    351351       
    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])
    353359        if (not os.path.isdir(path)):
    354360                print "<PATH> must be a directory"
     
    365371       
    366372        # 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
    368374        while (size / cluster_size < fat16_clusters):
    369375                if (cluster_size > sector_size):
    370376                        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
    372378                else:
    373379                        size = fat16_clusters * cluster_size + reserved_clusters * cluster_size
     
    381387        data_start = root_start + root_size
    382388       
    383         outf = file(sys.argv[2], "w")
     389        outf = file(sys.argv[3], "w")
    384390       
    385391        boot_sector = xstruct.create(BOOT_SECTOR)
Note: See TracChangeset for help on using the changeset viewer.