File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -201,13 +201,13 @@ def parse_arg(
201201 return config
202202
203203 def has_default_btrfs_vols (self ) -> bool :
204- if self . config_type == DiskLayoutType . Default :
205- for mod in self . device_modifications :
206- for part in mod . partitions :
207- if part . is_create_or_modify ():
208- if part . fs_type == FilesystemType . Btrfs :
209- if len ( part . btrfs_subvols ) > 0 :
210- return True
204+ for mod in self . device_modifications :
205+ for part in mod . partitions :
206+ if not ( part . is_create_or_modify () and part . fs_type == FilesystemType . Btrfs ) :
207+ continue
208+
209+ if any ( subvol . is_default_root () for subvol in part . btrfs_subvols ) :
210+ return True
211211
212212 return False
213213
@@ -668,6 +668,9 @@ def is_root(self) -> bool:
668668 return self .mountpoint == Path ('/' )
669669 return False
670670
671+ def is_default_root (self ) -> bool :
672+ return self .name == Path ('@' ) and self .is_root ()
673+
671674 def json (self ) -> _SubvolumeModificationSerialization :
672675 return {'name' : str (self .name ), 'mountpoint' : str (self .mountpoint )}
673676
You can’t perform that action at this time.
0 commit comments