Skip to content

Commit

Permalink
fs: Add suport for getting VFAT filesystem info and size
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtechtrefny committed Oct 21, 2024
1 parent 6b57567 commit c1bba61
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions blivet/formats/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,8 @@ class FATFS(FS):
_max_size = Size("1 TiB")
_packages = ["dosfstools"]
_fsck_class = fsck.DosFSCK
_info_class = fsinfo.FATFSInfo
_size_info_class = fssize.FATFSSize
_mkfs_class = fsmkfs.FATFSMkfs
_mount_class = fsmount.FATFSMount
_readlabel_class = fsreadlabel.DosFSReadLabel
Expand Down
7 changes: 7 additions & 0 deletions blivet/tasks/fsinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,12 @@ def _get_info(self):
return BlockDev.fs.xfs_get_info(self.fs.device)


class FATFSInfo(FSInfo):
ext = availability.BLOCKDEV_VFAT_INFO

def _get_info(self):
return BlockDev.fs.vfat_get_info(self.fs.device)


class UnimplementedFSInfo(fstask.UnimplementedFSTask):
pass
5 changes: 5 additions & 0 deletions blivet/tasks/fssize.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ def _get_size(self):
return Size(self.fs._current_info.block_size * self.fs._current_info.block_count)


class FATFSSize(FSSize):
def _get_size(self):
return Size(self.fs._current_info.cluster_size * self.fs._current_info.cluster_count)


class TmpFSSize(fstask.FSTask):
description = "current filesystem size"

Expand Down

0 comments on commit c1bba61

Please sign in to comment.