Repository: archlinux/archinstall

Issue:
[master] Mount options confuse fstype with mount options
Using default layout and default settings:

![screenshot](https://user-images.githubusercontent.com/861439/170771529-2d598017-42f8-43c4-9d51-5fe714e9bb92.png)

```json
{
    "/dev/sda": {
        "partitions": [
            {
                "encrypted": true,
                "filesystem": {
                    "format": "btrfs",
                    "mount_options": [
                        "compress=zstd"
                    ]
                },
                "mountpoint": "/home",
                "size": "100%",
                "start": "1MiB",
                "type": "primary",
                "wipe": true
            }
        ],
        "wipe": true
    },
    "/dev/sdb": {
        "partitions": [
            {
                "boot": true,
                "encrypted": false,
                "filesystem": {
                    "format": "fat32"
                },
                "mountpoint": "/boot",
                "size": "512MiB",
                "start": "1MiB",
                "type": "primary",
                "wipe": true
            },
            {
                "encrypted": true,
                "filesystem": {
                    "format": "btrfs",
                    "mount_options": [
                        "compress=zstd"
                    ]
                },
                "mountpoint": "/",
                "size": "100%",
                "start": "513MiB",
                "type": "primary",
                "wipe": true
            }
        ],
        "wipe": true
    }
}
```


Discussion:

Resolving patch:
diff --git a/archinstall/lib/disk/filesystem.py b/archinstall/lib/disk/filesystem.py
--- a/archinstall/lib/disk/filesystem.py
+++ b/archinstall/lib/disk/filesystem.py
@@ -89,7 +89,8 @@ def load_layout(self, layout :Dict[str, Any]) -> None:
 				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 @@ def use_entire_disk(self, root_filesystem_type :str = 'ext4') -> Partition:
 		# 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
--- a/archinstall/lib/disk/partition.py
+++ b/archinstall/lib/disk/partition.py
@@ -481,6 +481,7 @@ def find_parent_of(self, data :Dict[str, Any], name :str, parent :Optional[str]
 	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.')
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -314,7 +314,7 @@ def mount_ordered_layout(self, layouts: Dict[str, Any]) -> None:
 
 			if partition.get('filesystem',{}).get('mount_options',[]):
 				mount_options = ','.join(partition['filesystem']['mount_options'])
-				mount_queue[mountpoint] = lambda instance=partition['device_instance'], target=f"{self.target}{mountpoint}", options=mount_options: instance.mount(target, options)
+				mount_queue[mountpoint] = lambda instance=partition['device_instance'], target=f"{self.target}{mountpoint}", options=mount_options: instance.mount(target, options=options)
 			else:
 				mount_queue[mountpoint] = lambda instance=partition['device_instance'], target=f"{self.target}{mountpoint}": instance.mount(target)
 


Test patch: