Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disk: support setting FAT size for format_ #51074

Merged
merged 1 commit into from
Jan 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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