From c7dbf0105ea89edca9a81655e3c7cb250de4f40a Mon Sep 17 00:00:00 2001 From: codefiles <11915375+codefiles@users.noreply.github.com> Date: Mon, 19 Jan 2026 19:18:22 -0500 Subject: [PATCH] Rework has_default_btrfs_vols (#4147) --- archinstall/lib/models/device.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/archinstall/lib/models/device.py b/archinstall/lib/models/device.py index 6333ee21..2b6de049 100644 --- a/archinstall/lib/models/device.py +++ b/archinstall/lib/models/device.py @@ -201,13 +201,13 @@ class DiskLayoutConfiguration: return config def has_default_btrfs_vols(self) -> bool: - if self.config_type == DiskLayoutType.Default: - for mod in self.device_modifications: - for part in mod.partitions: - if part.is_create_or_modify(): - if part.fs_type == FilesystemType.Btrfs: - if len(part.btrfs_subvols) > 0: - return True + for mod in self.device_modifications: + for part in mod.partitions: + if not (part.is_create_or_modify() and part.fs_type == FilesystemType.Btrfs): + continue + + if any(subvol.is_default_root() for subvol in part.btrfs_subvols): + return True return False @@ -668,6 +668,9 @@ class SubvolumeModification: return self.mountpoint == Path('/') return False + def is_default_root(self) -> bool: + return self.name == Path('@') and self.is_root() + def json(self) -> _SubvolumeModificationSerialization: return {'name': str(self.name), 'mountpoint': str(self.mountpoint)}