Repository: archlinux/archinstall

Issue:
Boot partition regression
The change to the `DeviceModification.get_boot_partition()` function in afaf42e means that it will return `None` when an ESP is used and an XBOOTLDR is not present. Before this change in that given scenario the function would return the ESP. Anywhere the boot partition is accessed when there is only an ESP is going to cause an issue.

The code below will prevent proceeding with the installation by selecting _Install_.

https://github.com/archlinux/archinstall/blob/69c37e7c79b8756e300438fd2d25f6d40db5e04b/archinstall/lib/global_menu.py#L350-L351

The screenshot below demonstrates that this occurs with the _Disk configuration_ option _Use a best-effort default partition layout_.

![image](https://github.com/archlinux/archinstall/assets/11915375/0efd293f-cfd7-4824-979a-09951d11408c)

The code below will cause a crash and prevent the boot loader from being installed if providing a configuration with the described setup and then using `--silent`.

https://github.com/archlinux/archinstall/blob/69c37e7c79b8756e300438fd2d25f6d40db5e04b/archinstall/lib/installer.py#L1101-L1102

```
ValueError: Could not detect boot at mountpoint /mnt/archinstall
```


Discussion:

Resolving patch:
diff --git a/archinstall/lib/disk/device_model.py b/archinstall/lib/disk/device_model.py
--- a/archinstall/lib/disk/device_model.py
+++ b/archinstall/lib/disk/device_model.py
@@ -789,8 +789,8 @@ def get_efi_partition(self) -> Optional[PartitionModification]:
 		"""
 		Similar to get_boot_partition() but excludes XBOOTLDR partitions from it's candidates.
 		"""
-		fliltered = filter(lambda x: x.is_boot() and x.fs_type == FilesystemType.Fat32 and PartitionFlag.XBOOTLDR not in x.flags, self.partitions)
-		return next(fliltered, None)
+		filtered = filter(lambda x: x.is_boot() and x.fs_type == FilesystemType.Fat32 and PartitionFlag.XBOOTLDR not in x.flags, self.partitions)
+		return next(filtered, None)
 
 	def get_boot_partition(self) -> Optional[PartitionModification]:
 		"""
@@ -798,11 +798,13 @@ def get_boot_partition(self) -> Optional[PartitionModification]:
 		Only returns XBOOTLDR if separate EFI is detected using self.get_efi_partition()
 		"""
 		if efi_partition := self.get_efi_partition():
-			fliltered = filter(lambda x: x.is_boot() and x != efi_partition and x.mountpoint, self.partitions)
+			filtered = filter(lambda x: x.is_boot() and x != efi_partition and x.mountpoint, self.partitions)
+			if boot_partition := next(filtered, None):
+				return boot_partition
+			return efi_partition
 		else:
-			fliltered = filter(lambda x: x.is_boot() and x.mountpoint, self.partitions)
-
-		return next(fliltered, None)
+			filtered = filter(lambda x: x.is_boot() and x.mountpoint, self.partitions)
+			return next(filtered, None)
 
 	def get_root_partition(self, relative_path: Optional[Path]) -> Optional[PartitionModification]:
 		filtered = filter(lambda x: x.is_root(relative_path), self.partitions)
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -726,10 +726,11 @@ def _add_systemd_bootloader(
 		# TODO: Ideally we would want to check if another config
 		# points towards the same disk and/or partition.
 		# And in which case we should do some clean up.
-		bootctl_options = [
-			f'--esp-path={efi_partition.mountpoint}' if efi_partition else '',
-			f'--boot-path={boot_partition.mountpoint}' if boot_partition else ''
-		]
+		bootctl_options = []
+
+		if efi_partition and boot_partition != efi_partition:
+			bootctl_options.append(f'--esp-path={efi_partition.mountpoint}')
+			bootctl_options.append(f'--boot-path={boot_partition.mountpoint}')
 
 		# Install the boot loader
 		try:


Test patch: