storage/v2: report min part size
This commit is contained in:
parent
b298caf83a
commit
40b2f3267b
|
@ -319,6 +319,7 @@ def _for_client_partition(partition, *, min_size=0):
|
||||||
offset=partition.offset,
|
offset=partition.offset,
|
||||||
resize=partition.resize,
|
resize=partition.resize,
|
||||||
path=partition._path(),
|
path=partition._path(),
|
||||||
|
estimated_min_size=partition.estimated_min_size,
|
||||||
mount=partition.mount,
|
mount=partition.mount,
|
||||||
format=partition.format)
|
format=partition.format)
|
||||||
|
|
||||||
|
|
|
@ -268,6 +268,7 @@ class Partition:
|
||||||
boot: Optional[bool] = None
|
boot: Optional[bool] = None
|
||||||
os: Optional[OsProber] = None
|
os: Optional[OsProber] = None
|
||||||
offset: Optional[int] = None
|
offset: Optional[int] = None
|
||||||
|
estimated_min_size: Optional[int] = -1
|
||||||
resize: Optional[bool] = None
|
resize: Optional[bool] = None
|
||||||
path: Optional[str] = None
|
path: Optional[str] = None
|
||||||
|
|
||||||
|
|
|
@ -702,6 +702,16 @@ class Partition(_Formattable):
|
||||||
from subiquity.common.filesystem import boot
|
from subiquity.common.filesystem import boot
|
||||||
return boot.is_bootloader_partition(self)
|
return boot.is_bootloader_partition(self)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def estimated_min_size(self):
|
||||||
|
fs_data = self._m._probe_data.get('filesystem', {}).get(self._path())
|
||||||
|
if fs_data is None:
|
||||||
|
return -1
|
||||||
|
val = fs_data.get('ESTIMATED_MIN_SIZE')
|
||||||
|
if val == 0:
|
||||||
|
return self.device.alignment_data().part_align
|
||||||
|
return val
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ok_for_raid(self):
|
def ok_for_raid(self):
|
||||||
if self.boot:
|
if self.boot:
|
||||||
|
|
Loading…
Reference in New Issue