Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2022-05-28 15:40:36 +0200
committerGitHub <noreply@github.com>2022-05-28 15:40:36 +0200
commit486ad7dd6d195dd435c5da58d241e14742f60485 (patch)
treefd7f8935d02c70cd1c55dec75af75a5367fc6010
parent5c9bd235d3d0e653ba8d643748fd3d776359978b (diff)
Removes btrfs subvolume warnings on incorrect subvolume locations (#1267)
* Adding debug information * Adding debug information * Adding debug information * Removed a 'already-a-subvolume' check as it requires more information. * Adding debug information * Adding debug information * Made sure Partition().subvolumes() only attempts to retrieve btrfs subvolume information if fstype==btrfs. * Removed debug information
-rw-r--r--archinstall/lib/disk/btrfs/btrfspartition.py8
-rw-r--r--archinstall/lib/disk/partition.py10
2 files changed, 12 insertions, 6 deletions
diff --git a/archinstall/lib/disk/btrfs/btrfspartition.py b/archinstall/lib/disk/btrfs/btrfspartition.py
index 5020133d..299357b8 100644
--- a/archinstall/lib/disk/btrfs/btrfspartition.py
+++ b/archinstall/lib/disk/btrfs/btrfspartition.py
@@ -108,9 +108,13 @@ class BTRFSPartition(Partition):
if glob.glob(str(subvolume / '*')):
raise DiskError(f"Cannot create subvolume at {subvolume} because it contains data (non-empty folder target is not supported by BTRFS)")
- elif subvolinfo := subvolume_info_from_path(subvolume):
- raise DiskError(f"Destination {subvolume} is already a subvolume: {subvolinfo}")
+ # Ideally we would like to check if the destination is already a subvolume.
+ # But then we would need the mount-point at this stage as well.
+ # So we'll comment out this check:
+ # elif subvolinfo := subvolume_info_from_path(subvolume):
+ # raise DiskError(f"Destination {subvolume} is already a subvolume: {subvolinfo}")
+ # And deal with it here:
SysCommand(f"btrfs subvolume create {subvolume}")
return subvolume_info_from_path(subvolume) \ No newline at end of file
diff --git a/archinstall/lib/disk/partition.py b/archinstall/lib/disk/partition.py
index 73c88597..151775b1 100644
--- a/archinstall/lib/disk/partition.py
+++ b/archinstall/lib/disk/partition.py
@@ -310,8 +310,9 @@ class Partition:
def iterate_children_recursively(information):
for child in information.get('children', []):
if target := child.get('target'):
- if subvolume := subvolume_info_from_path(pathlib.Path(target)):
- yield subvolume
+ if child.get('fstype') == 'btrfs':
+ if subvolume := subvolume_info_from_path(pathlib.Path(target)):
+ yield subvolume
if child.get('children'):
for subchild in iterate_children_recursively(child):
@@ -320,8 +321,9 @@ class Partition:
for mountpoint in self.mount_information:
if result := findmnt(pathlib.Path(mountpoint['target'])):
for filesystem in result.get('filesystems', []):
- if subvolume := subvolume_info_from_path(pathlib.Path(mountpoint['target'])):
- yield subvolume
+ if mountpoint.get('fstype') == 'btrfs':
+ if subvolume := subvolume_info_from_path(pathlib.Path(mountpoint['target'])):
+ yield subvolume
for child in iterate_children_recursively(filesystem):
yield child