internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: archlinux/archinstall

Issue:
Functions `select_language()` and `select_kb_layout()` are identical
https://github.com/archlinux/archinstall/blob/edbc13590366e93bb8a85eacf104d5613bc5793a/archinstall/lib/interactions/general_conf.py#L88-L111

https://github.com/archlinux/archinstall/blob/edbc13590366e93bb8a85eacf104d5613bc5793a/archinstall/lib/locale/locale_menu.py#L132-L155

The function `select_language()` is not used.

The function `select_kb_layout()` is used once:

https://github.com/archlinux/archinstall/blob/edbc13590366e93bb8a85eacf104d5613bc5793a/archinstall/lib/locale/locale_menu.py#L90


Discussion:

Resolving patch:
diff --git a/archinstall/lib/interactions/general_conf.py b/archinstall/lib/interactions/general_conf.py
--- a/archinstall/lib/interactions/general_conf.py
+++ b/archinstall/lib/interactions/general_conf.py
@@ -3,7 +3,7 @@
 import pathlib
 from typing import List, Any, Optional, TYPE_CHECKING
 
-from ..locale import list_timezones, list_keyboard_languages
+from ..locale import list_timezones
 from ..menu import MenuSelectionType, Menu, TextInput
 from ..models.audio_configuration import Audio, AudioConfiguration
 from ..output import warn
@@ -87,29 +87,16 @@ def ask_for_audio_selection(
 
 
 def select_language(preset: Optional[str] = None) -> Optional[str]:
-	"""
-	Asks the user to select a language
-	Usually this is combined with :ref:`archinstall.list_keyboard_languages`.
-
-	:return: The language/dictionary key of the selected language
-	:rtype: str
-	"""
-	kb_lang = list_keyboard_languages()
-	# sort alphabetically and then by length
-	sorted_kb_lang = sorted(kb_lang, key=lambda x: (len(x), x))
+	from ..locale.locale_menu import select_kb_layout
 
-	choice = Menu(
-		_('Select keyboard layout'),
-		sorted_kb_lang,
-		preset_values=preset,
-		sort=False
-	).run()
+	# We'll raise an exception in an upcoming version.
+	# from ..exceptions import Deprecated
+	# raise Deprecated("select_language() has been deprecated, use select_kb_layout() instead.")
 
-	match choice.type_:
-		case MenuSelectionType.Skip: return preset
-		case MenuSelectionType.Selection: return choice.single_value
+	# No need to translate this i feel, as it's a short lived message.
+	warn("select_language() is deprecated, use select_kb_layout() instead. select_language() will be removed in a future version")
 
-	return None
+	return select_kb_layout(preset)
 
 
 def select_archinstall_language(languages: List[Language], preset: Language) -> Language:


Test patch:
Repository: archlinux/archinstall

Issue:
Install text is not initialized
The _Install_ line text does not list if any configuration is missing when the installer is launched, as it had up to commit 5253e57e, but does upon return from a submenu.


Discussion:

Resolving patch:
diff --git a/archinstall/lib/global_menu.py b/archinstall/lib/global_menu.py
--- a/archinstall/lib/global_menu.py
+++ b/archinstall/lib/global_menu.py
@@ -211,11 +211,11 @@ def _is_config_valid(self) -> bool:
 			return False
 		return self._validate_bootloader() is None
 
-	def _update_install_text(self, name: str, value: str):
+	def _update_install_text(self, name: Optional[str] = None, value: Any = None):
 		text = self._install_text()
 		self._menu_options['install'].update_description(text)
 
-	def post_callback(self, name: str, value: str):
+	def post_callback(self, name: Optional[str] = None, value: Any = None):
 		self._update_install_text(name, value)
 
 	def _install_text(self):
diff --git a/archinstall/lib/menu/abstract_menu.py b/archinstall/lib/menu/abstract_menu.py
--- a/archinstall/lib/menu/abstract_menu.py
+++ b/archinstall/lib/menu/abstract_menu.py
@@ -252,7 +252,7 @@ def pre_callback(self, selector_name):
 		""" will be called before each action in the menu """
 		return
 
-	def post_callback(self, selection_name: str, value: Any):
+	def post_callback(self, selection_name: Optional[str] = None, value: Any = None):
 		""" will be called after each action in the menu """
 		return True
 
@@ -299,6 +299,7 @@ def _find_selection(self, selection_name: str) -> Tuple[str, Selector]:
 
 	def run(self, allow_reset: bool = False):
 		self._sync_all()
+		self.post_callback()
 		cursor_pos = None
 
 		while True:


Test patch:
Repository: archlinux/archinstall

Issue:
ERROR: /mnt/archinstall is not a directory
Hey!
So, I tried running archinstall after mounting my hard drives as /mnt /mnt/boot and /mnt/home
But it throws `/mnt/archinstall is not a directory`
Am I missing something, or is something wrong?

The logs and configs
[install.log](https://github.com/archlinux/archinstall/files/12908145/install.log)
[user_configuration.json](https://github.com/archlinux/archinstall/files/12908146/user_configuration.json)



Discussion:

Resolving patch:
diff --git a/archinstall/lib/interactions/disk_conf.py b/archinstall/lib/interactions/disk_conf.py
--- a/archinstall/lib/interactions/disk_conf.py
+++ b/archinstall/lib/interactions/disk_conf.py
@@ -11,6 +11,7 @@
 from ..menu.menu import MenuSelectionType
 from ..output import FormattedOutput, debug
 from ..utils.util import prompt_dir
+from ..storage import storage
 
 if TYPE_CHECKING:
 	_: Any
@@ -140,6 +141,8 @@ def select_disk_config(
 					return preset
 				mods = disk.device_handler.detect_pre_mounted_mods(path)
 
+				storage['MOUNT_POINT'] = Path(path)
+
 				return disk.DiskLayoutConfiguration(
 					config_type=disk.DiskLayoutType.Pre_mount,
 					device_modifications=mods


Test patch:
Repository: archlinux/archinstall

Issue:
Reset in locales menu causes crash
Using reset in the _Locales_ menu will cause a crash.

```
Traceback (most recent call last):
  File "/home/scripttest/archinstall/.venv/bin/archinstall", line 8, in <module>
    sys.exit(run_as_a_module())
             ^^^^^^^^^^^^^^^^^
  File "/home/scripttest/archinstall/archinstall/__init__.py", line 291, in run_as_a_module
    importlib.import_module(mod_name)
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/scripttest/archinstall/archinstall/scripts/guided.py", line 234, in <module>
    ask_user_questions()
  File "/home/scripttest/archinstall/archinstall/scripts/guided.py", line 99, in ask_user_questions
    global_menu.run()
  File "/home/scripttest/archinstall/archinstall/lib/menu/abstract_menu.py", line 348, in run
    if not self._process_selection(value):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scripttest/archinstall/archinstall/lib/menu/abstract_menu.py", line 365, in _process_selection
    return self.exec_option(config_name, selector)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scripttest/archinstall/archinstall/lib/menu/abstract_menu.py", line 386, in exec_option
    result = selector.func(presel_val)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scripttest/archinstall/archinstall/lib/global_menu.py", line 53, in <lambda>
    lambda preset: self._locale_selection(preset),
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scripttest/archinstall/archinstall/lib/global_menu.py", line 246, in _locale_selection
    locale_config = LocaleMenu(data_store, preset).run()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scripttest/archinstall/archinstall/lib/locale/locale_menu.py", line 84, in run
    self._data_store['keyboard-layout'],
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'keyboard-layout'
```


Discussion:

Resolving patch:
diff --git a/archinstall/lib/locale/locale_menu.py b/archinstall/lib/locale/locale_menu.py
--- a/archinstall/lib/locale/locale_menu.py
+++ b/archinstall/lib/locale/locale_menu.py
@@ -80,6 +80,9 @@ def setup_selection_menu_options(self):
 	def run(self, allow_reset: bool = True) -> LocaleConfiguration:
 		super().run(allow_reset=allow_reset)
 
+		if not self._data_store:
+			return LocaleConfiguration.default()
+
 		return LocaleConfiguration(
 			self._data_store['keyboard-layout'],
 			self._data_store['sys-language'],


Test patch:
Repository: archlinux/archinstall

Issue:
Installation with EFISTUB crashes
After bc3b3a3, installation with EFISTUB crashes with the following:

```
Single '{' encountered in format string
Traceback (most recent call last):
  File "/home/scripttest/archinstall/archinstall/__init__.py", line 310, in run_as_a_module
    main()
  File "/home/scripttest/archinstall/archinstall/__init__.py", line 305, in main
    importlib.import_module(mod_name)
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/scripttest/archinstall/archinstall/scripts/guided.py", line 263, in <module>
    perform_installation(archinstall.storage.get('MOUNT_POINT', Path('/mnt')))
  File "/home/scripttest/archinstall/archinstall/scripts/guided.py", line 120, in perform_installation
    with Installer(
  File "/home/scripttest/archinstall/archinstall/lib/installer.py", line 109, in __exit__
    raise exc_val
  File "/home/scripttest/archinstall/archinstall/scripts/guided.py", line 161, in perform_installation
    installation.add_bootloader(
  File "/home/scripttest/archinstall/archinstall/lib/installer.py", line 1230, in add_bootloader
    self._add_efistub_bootloader(boot_partition, root_partition, uki_enabled)
  File "/home/scripttest/archinstall/archinstall/lib/installer.py", line 1130, in _add_efistub_bootloader
    cmd = [arg.format(kernel=kernel) for arg in cmd_template]
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scripttest/archinstall/archinstall/lib/installer.py", line 1130, in <listcomp>
    cmd = [arg.format(kernel=kernel) for arg in cmd_template]
           ^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Single '{' encountered in format string
```

The `cmdline` variable is a `tuple(str)` and is unpacked into characters rather than the intended, a string. I assumed `tuple(str)` behaved the same as `(str, )` when unpacking but that is not the case.


Discussion:

Resolving patch:
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -1105,10 +1105,10 @@ def _add_efistub_bootloader(
 				*self._get_kernel_params(root_partition)
 			)
 
-			cmdline = tuple(' '.join(entries))
+			cmdline = [' '.join(entries)]
 		else:
 			loader = '/EFI/Linux/arch-{kernel}.efi'
-			cmdline = tuple()
+			cmdline = []
 
 		parent_dev_path = disk.device_handler.get_parent_device_path(boot_partition.safe_dev_path)
 


Test patch:
Repository: archlinux/archinstall

Issue:
Password visible on Profiles list
After creating a new user, the "Password" is visible in plain text under the list of available profiles, unless this is the intended behavior?

![image](https://github.com/archlinux/archinstall/assets/99000334/ab51d3e7-4b62-452e-9da4-86deb872be87)


![image](https://github.com/archlinux/archinstall/assets/99000334/67d447e0-a01a-4ed6-a008-817716e21dc2)



Discussion:
I believe this has been hidden in the past, we'll get on to fixing it!
Oh perfect!

Resolving patch:
diff --git a/archinstall/lib/output.py b/archinstall/lib/output.py
--- a/archinstall/lib/output.py
+++ b/archinstall/lib/output.py
@@ -38,6 +38,8 @@ def _get_values(
 			raise ValueError('Unsupported formatting call')
 		elif hasattr(o, 'table_data'):
 			return o.table_data()
+		elif hasattr(o, 'json'):
+			return o.json()
 		elif is_dataclass(o):
 			return asdict(o)
 		else:


Test patch:
Repository: archlinux/archinstall

Issue:
Logic error in `_fetch_lsblk_info()` loop
The loop in `disk._fetch_lsblk_info()` contains a logic error.

https://github.com/archlinux/archinstall/blob/2831c97338ca3b60dc1c697d158cd3f6281746d7/archinstall/lib/disk/device_model.py#L1109-L1112

When `retry` is:

- `0` then `1` attempt (initial)
- `1` then `1` attempt (initial)
- `2` then `2` attempts (initial and `1` retry)
- `3` then `3` attempts (initial and `2` retries)

It should be:
- `0` then `1` attempt (initial)
- `1` then `2` attempts (initial and `1` retry)
- `2` then `3` attempts (initial and `2` retries)
- `3` then `4` attempts (initial and `3` retries)

As the loop runs through the first run, when `retry_attempt` is `0`, is the initial attempt and all others after it are retries.


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
@@ -1106,10 +1106,7 @@ def _fetch_lsblk_info(dev_path: Optional[Union[Path, str]] = None, retry: int =
 	if not dev_path:
 		dev_path = ''
 
-	if retry == 0:
-		retry = 1
-
-	for retry_attempt in range(retry):
+	for retry_attempt in range(retry + 1):
 		try:
 			result = SysCommand(f'lsblk --json -b -o+{lsblk_fields} {dev_path}').decode()
 			break
@@ -1121,7 +1118,7 @@ def _fetch_lsblk_info(dev_path: Optional[Union[Path, str]] = None, retry: int =
 			else:
 				raise err
 
-			if retry_attempt == retry - 1:
+			if retry_attempt == retry:
 				raise err
 
 			time.sleep(1)


Test patch:
Repository: archlinux/archinstall

Issue:
Logic error in `encrypt()` loop
The loop in `Luks2.encrypt()` contains a logic error.

https://github.com/archlinux/archinstall/blob/c9755b35e7364d208d836ec051d365354be6dd63/archinstall/lib/luks.py#L93

If `DISK_RETRY_ATTEMPTS` is `0` then an initial attempt will not occur and no code in the loop will be executed.

The maximum number of retries that can occur is erroneously one less than indicated by `DISK_RETRY_ATTEMPTS`; the initial attempt is when `retry_attempt` is `0` and all others after it are retries.


Discussion:

Resolving patch:
diff --git a/archinstall/lib/luks.py b/archinstall/lib/luks.py
--- a/archinstall/lib/luks.py
+++ b/archinstall/lib/luks.py
@@ -90,14 +90,14 @@ def encrypt(
 		# Retry formatting the volume because archinstall can some times be too quick
 		# which generates a "Device /dev/sdX does not exist or access denied." between
 		# setting up partitions and us trying to encrypt it.
-		for retry_attempt in range(storage['DISK_RETRY_ATTEMPTS']):
+		for retry_attempt in range(storage['DISK_RETRY_ATTEMPTS'] + 1):
 			try:
 				SysCommand(cryptsetup_args)
 				break
 			except SysCallError as err:
 				time.sleep(storage['DISK_TIMEOUTS'])
 
-				if retry_attempt != storage['DISK_RETRY_ATTEMPTS'] - 1:
+				if retry_attempt != storage['DISK_RETRY_ATTEMPTS']:
 					continue
 
 				if err.exit_code == 1:


Test patch:
Repository: archlinux/archinstall

Issue:
Superfluous use of `partprobe`
Pertinent `partprobe` manual information: [1]

> **partprobe** is a program that informs the operating system kernel of partition table changes.

From pyparted, `Disk.commit()` also "informs the operating system [kernel] of the changes" to a partition table [2] therefore calling `partprobe` after `DeviceHandler._perform_partitioning()` is unnecessary.

https://github.com/archlinux/archinstall/blob/f6106324eb71905df9b832eb973a08a1f45fa5af/archinstall/lib/disk/device_handler.py#L327-L328

https://github.com/archlinux/archinstall/blob/f6106324eb71905df9b832eb973a08a1f45fa5af/archinstall/lib/disk/device_handler.py#L366-L367

https://github.com/archlinux/archinstall/blob/f6106324eb71905df9b832eb973a08a1f45fa5af/archinstall/lib/disk/device_handler.py#L523-L529

A `partprobe` that is performed after formatting the partitions is unnecessary because formatting the partitions does not change the partition table.

https://github.com/archlinux/archinstall/blob/f6106324eb71905df9b832eb973a08a1f45fa5af/archinstall/lib/disk/device_handler.py#L295-L305

https://github.com/archlinux/archinstall/blob/f6106324eb71905df9b832eb973a08a1f45fa5af/archinstall/lib/disk/device_handler.py#L377-L389

Encrypting a partition does not change the partition table.

https://github.com/archlinux/archinstall/blob/f6106324eb71905df9b832eb973a08a1f45fa5af/archinstall/lib/luks.py#L165

[1] https://man.archlinux.org/man/partprobe.8
[2] https://github.com/dcantrell/pyparted/blob/d5870bb7a5d512c17c92a4e4fe7e9a8e7c8c3528/src/parted/disk.py#L202-L205


Discussion:

Resolving patch:
diff --git a/archinstall/lib/disk/device_handler.py b/archinstall/lib/disk/device_handler.py
--- a/archinstall/lib/disk/device_handler.py
+++ b/archinstall/lib/disk/device_handler.py
@@ -378,7 +378,6 @@ def _fetch_part_info(self, path: Path) -> LsblkInfo:
 		attempts = 3
 		lsblk_info: Optional[LsblkInfo] = None
 
-		self.partprobe(path)
 		for attempt_nr in range(attempts):
 			time.sleep(attempt_nr + 1)
 			lsblk_info = get_lsblk_info(path)
@@ -386,8 +385,6 @@ def _fetch_part_info(self, path: Path) -> LsblkInfo:
 			if lsblk_info.partn and lsblk_info.partuuid and lsblk_info.uuid:
 				break
 
-			self.partprobe(path)
-
 		if not lsblk_info:
 			debug(f'Unable to get partition information: {path}')
 			raise DiskError(f'Unable to get partition information: {path}')
@@ -526,8 +523,6 @@ def partition(
 			requires_delete = modification.wipe is False
 			self._perform_partitioning(part_mod, modification.device, disk, requires_delete=requires_delete)
 
-		self.partprobe(modification.device.device_info.path)
-
 	def mount(
 		self,
 		dev_path: Path,
diff --git a/archinstall/lib/luks.py b/archinstall/lib/luks.py
--- a/archinstall/lib/luks.py
+++ b/archinstall/lib/luks.py
@@ -162,7 +162,6 @@ def lock(self):
 
 		# Get crypt-information about the device by doing a reverse lookup starting with the partition path
 		# For instance: /dev/sda
-		disk.device_handler.partprobe(self.luks_dev_path)
 		lsblk_info = disk.get_lsblk_info(self.luks_dev_path)
 
 		# For each child (sub-partition/sub-device)


Test patch:
Repository: archlinux/archinstall

Issue:
Excessive partition table commits
The logic in the code below will cause the partition table to be written to disk and the operating system kernel to be informed on each iteration of the for loop. Instead this should be done once, after all changes have been made to the partition table layout.

https://github.com/archlinux/archinstall/blob/f107104103b74ac065a56bd94a0878f0d263e177/archinstall/lib/disk/device_handler.py#L534-L538

https://github.com/archlinux/archinstall/blob/f107104103b74ac065a56bd94a0878f0d263e177/archinstall/lib/disk/device_handler.py#L341-L342

https://github.com/archlinux/archinstall/blob/f107104103b74ac065a56bd94a0878f0d263e177/archinstall/lib/disk/device_handler.py#L380-L381


Discussion:

Resolving patch:
diff --git a/archinstall/lib/disk/device_handler.py b/archinstall/lib/disk/device_handler.py
--- a/archinstall/lib/disk/device_handler.py
+++ b/archinstall/lib/disk/device_handler.py
@@ -322,7 +322,7 @@ def format(
 			part_mod.partuuid = lsblk_info.partuuid
 			part_mod.uuid = lsblk_info.uuid
 
-	def _perform_partitioning(
+	def _setup_partition(
 		self,
 		part_mod: PartitionModification,
 		block_device: BDevice,
@@ -339,7 +339,6 @@ def _perform_partitioning(
 				raise DiskError(f'No partition for dev path found: {part_mod.safe_dev_path}')
 
 			disk.deletePartition(part_info.partition)
-			disk.commit()
 
 		if part_mod.status == ModificationStatus.Delete:
 			return
@@ -378,16 +377,12 @@ def _perform_partitioning(
 
 		try:
 			disk.addPartition(partition=partition, constraint=disk.device.optimalAlignedConstraint)
-			disk.commit()
-
-			# the creation will take a bit of time
-			time.sleep(3)
-
-			# the partition has a real path now as it was created
-			part_mod.dev_path = Path(partition.path)
 		except PartitionException as ex:
 			raise DiskError(f'Unable to add partition, most likely due to overlapping sectors: {ex}') from ex
 
+		# the partition has a path now that it has been added
+		part_mod.dev_path = Path(partition.path)
+
 	def _fetch_part_info(self, path: Path) -> LsblkInfo:
 		attempts = 3
 		lsblk_info: Optional[LsblkInfo] = None
@@ -535,7 +530,9 @@ def partition(
 			# if the entire disk got nuked then we don't have to delete
 			# any existing partitions anymore because they're all gone already
 			requires_delete = modification.wipe is False
-			self._perform_partitioning(part_mod, modification.device, disk, requires_delete=requires_delete)
+			self._setup_partition(part_mod, modification.device, disk, requires_delete=requires_delete)
+
+		disk.commit()
 
 	def mount(
 		self,


Test patch:
Repository: archlinux/archinstall

Issue:
Invalid home partition start and length
The start and length of the home partition takes into account the length of the root partition but not its start.

https://github.com/archlinux/archinstall/blob/f107104103b74ac065a56bd94a0878f0d263e177/archinstall/lib/interactions/disk_conf.py#L309-L317

Here is a possible fix.

```patch
diff --git a/archinstall/lib/interactions/disk_conf.py b/archinstall/lib/interactions/disk_conf.py
index 85b377b7..e5904a3c 100644
--- a/archinstall/lib/interactions/disk_conf.py
+++ b/archinstall/lib/interactions/disk_conf.py
@@ -310,8 +310,8 @@ def suggest_single_disk_layout(
                # If we don't want to use subvolumes,
                # But we want to be able to re-use data between re-installs..
                # A second partition for /home would be nice if we have the space for it
-               home_start = root_partition.length
-               home_length = device.device_info.total_size - root_partition.length
+               home_start = root_partition.start + root_partition.length
+               home_length = device.device_info.total_size - home_start

                if using_gpt:
                        home_length -= align_buffer
```


Discussion:

Resolving patch:
diff --git a/archinstall/lib/interactions/disk_conf.py b/archinstall/lib/interactions/disk_conf.py
--- a/archinstall/lib/interactions/disk_conf.py
+++ b/archinstall/lib/interactions/disk_conf.py
@@ -310,8 +310,8 @@ def suggest_single_disk_layout(
 		# If we don't want to use subvolumes,
 		# But we want to be able to reuse data between re-installs..
 		# A second partition for /home would be nice if we have the space for it
-		home_start = root_partition.length
-		home_length = device.device_info.total_size - root_partition.length
+		home_start = root_partition.start + root_partition.length
+		home_length = device.device_info.total_size - home_start
 
 		if using_gpt:
 			home_length -= align_buffer


Test patch: