Skip to content

Commit

Permalink
Merge pull request #51074 from aplanas/fix_fat32
Browse files Browse the repository at this point in the history
disk: support setting FAT size for format_
  • Loading branch information
dwoz authored Jan 8, 2019
2 parents e2d49c2 + 5828aa1 commit cfa5eba
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions salt/modules/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ def format_(device,
fs_type='ext4',
inode_size=None,
lazy_itable_init=None,
fat=None,
force=False):
'''
Format a filesystem onto a device
Expand Down Expand Up @@ -459,6 +460,10 @@ def format_(device,
This option is only enabled for ext filesystems
fat
FAT size option. Can be 12, 16 or 32, and can only be used on
fat or vfat filesystems.
force
Force mke2fs to create a filesystem, even if the specified device is
not a partition on a block special device. This option is only enabled
Expand All @@ -481,6 +486,9 @@ def format_(device,
if lazy_itable_init is not None:
if fs_type[:3] == 'ext':
cmd.extend(['-E', 'lazy_itable_init={0}'.format(lazy_itable_init)])
if fat is not None and fat in (12, 16, 32):
if fs_type[-3:] == 'fat':
cmd.extend(['-F', fat])
if force:
if fs_type[:3] == 'ext':
cmd.append('-F')
Expand Down

0 comments on commit cfa5eba

Please sign in to comment.