Skip to content

Commit

Permalink
Fix displaying btrfs as a disklabel
Browse files Browse the repository at this point in the history
Signed-off-by: Vojtech Trefny <vtrefny@redhat.com>
  • Loading branch information
vojtechtrefny committed Jul 28, 2015
1 parent ba100d1 commit 8025cc4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions blivetgui/list_partitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ def _add_chilren(childs, parent_iter=None):
self.partitions_view.expand_all()

def _is_group_device(self, blivet_device):
# btrfs volume on raw disk
if blivet_device.type in ("btrfs volume",):
return True

if blivet_device.format and blivet_device.format.type in ("lvmpv", "btrfs", "mdmember"):
return (blivet_device.kids > 0)

Expand Down
9 changes: 9 additions & 0 deletions blivetgui/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ def get_group_device(self, blivet_device):
""" Get 'group' device based on underlying device (lvmpv/btrfs/mdmember/luks partition)
"""

# already a group device
if blivet_device.type in ("btrfs volume", "lvmvg", "mdarray"):
return blivet_device

# encrypted group device -> get the luks device instead
if blivet_device.format.type == "luks":
blivet_device = self.get_luks_device(blivet_device)
Expand Down Expand Up @@ -344,6 +348,11 @@ def get_disk_children(self, blivet_device):
partitions = [RawFormatDevice(disk=blivet_device, fmt=blivet_device.format)]
return ProxyDataContainer(partitions=partitions, extended=None, logicals=None)

if blivet_device.format and blivet_device.format.type == "btrfs" and blivet_device.kids:
# btrfs volume on raw device
btrfs_volume = self.storage.devicetree.getChildren(blivet_device)[0]
return ProxyDataContainer(partitions=[btrfs_volume], extended=None, logicals=None)

# extended partition
extended = self._get_extended_partition(blivet_device)
# logical partitions + 'logical' free space
Expand Down

0 comments on commit 8025cc4

Please sign in to comment.