Skip to content

Commit b544443

Browse files
committed
sebaubuntu_libs: libandroid: fstab: Add Fstab.get_ab_partitions_models()
Change-Id: I4d4855d383d1358406404569eea11bb1847cccfc
1 parent 6f302c3 commit b544443

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

sebaubuntu_libs/libandroid/fstab/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
from pathlib import Path
1010
from typing import List
1111

12+
from sebaubuntu_libs.libandroid.partitions.partition_model import PartitionModel
13+
1214
FSTAB_HEADER = "#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>\n"
1315

1416
class FstabEntry:
@@ -129,3 +131,14 @@ def get_logical_partitions(self):
129131

130132
def get_slotselect_partitions(self):
131133
return [entry for entry in self.entries if entry.is_slotselect()]
134+
135+
def get_ab_partitions_models(self) -> List[PartitionModel]:
136+
models = []
137+
138+
for entry in self.get_slotselect_partitions():
139+
partition_model = PartitionModel.from_mount_point(entry.mount_point)
140+
if partition_model is None:
141+
continue
142+
models.append(partition_model)
143+
144+
return models

0 commit comments

Comments
 (0)