Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2022-05-27 21:37:38 +0200
committerGitHub <noreply@github.com>2022-05-27 21:37:38 +0200
commit3c04a6b19612cf79367a17a6d389479a3f3d6711 (patch)
tree40d52bc7d53ab03a2a3a06395f38f40796cb0569 /archinstall/lib/disk
parentda8043ede934eaa4052417ff1cc655daa9490fed (diff)
Fix mixup of mount options and fstype during mount (#1258)
Fixed issue where `options` wasn't passed as `options=options` and got mixed up as fs-type.
Diffstat (limited to 'archinstall/lib/disk')
-rw-r--r--archinstall/lib/disk/filesystem.py7
-rw-r--r--archinstall/lib/disk/partition.py1
2 files changed, 5 insertions, 3 deletions
diff --git a/archinstall/lib/disk/filesystem.py b/archinstall/lib/disk/filesystem.py
index 99e4b339..f94b4b47 100644
--- a/archinstall/lib/disk/filesystem.py
+++ b/archinstall/lib/disk/filesystem.py
@@ -89,7 +89,8 @@ class Filesystem:
partition['device_instance'] = self.add_partition(partition.get('type', 'primary'),
start=start,
end=partition.get('size', '100%'),
- partition_format=partition.get('filesystem', {}).get('format', 'btrfs'))
+ partition_format=partition.get('filesystem', {}).get('format', 'btrfs'),
+ skip_mklabel=layout.get('wipe', False) is not False)
elif (partition_uuid := partition.get('PARTUUID')):
# We try to deal with both UUID and PARTUUID of a partition when it's being re-used.
@@ -209,10 +210,10 @@ class Filesystem:
# TODO: Implement this with declarative profiles instead.
raise ValueError("Installation().use_entire_disk() has to be re-worked.")
- def add_partition(self, partition_type :str, start :str, end :str, partition_format :Optional[str] = None) -> Partition:
+ def add_partition(self, partition_type :str, start :str, end :str, partition_format :Optional[str] = None, skip_mklabel :bool = False) -> Partition:
log(f'Adding partition to {self.blockdevice}, {start}->{end}', level=logging.INFO)
- if len(self.blockdevice.partitions) == 0:
+ if len(self.blockdevice.partitions) == 0 and skip_mklabel is False:
# If it's a completely empty drive, and we're about to add partitions to it
# we need to make sure there's a filesystem label.
if self.mode == GPT:
diff --git a/archinstall/lib/disk/partition.py b/archinstall/lib/disk/partition.py
index bb1ffeb6..73c88597 100644
--- a/archinstall/lib/disk/partition.py
+++ b/archinstall/lib/disk/partition.py
@@ -481,6 +481,7 @@ class Partition:
def mount(self, target :str, fs :Optional[str] = None, options :str = '') -> bool:
if not self.mountpoint:
log(f'Mounting {self} to {target}', level=logging.INFO)
+
if not fs:
if not self.filesystem:
raise DiskError(f'Need to format (or define) the filesystem on {self} before mounting.')