From 1168efb01e62a6b95e7d0e1b44c649778da4e83c Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Fri, 12 Nov 2021 11:22:30 +0000 Subject: Removed the GPT vs MBR lookup on __enter__ as it's no longer necessary to validate this on instance creation. load_layout() Uses this only to detect what partition table format it should use when wiping the drive. Other than that we only check if MBR and part numbers are > 3, that's the only use of this variable at this moment. --- archinstall/lib/disk/filesystem.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/archinstall/lib/disk/filesystem.py b/archinstall/lib/disk/filesystem.py index cf2a286e..2eb1864d 100644 --- a/archinstall/lib/disk/filesystem.py +++ b/archinstall/lib/disk/filesystem.py @@ -20,12 +20,6 @@ class Filesystem: self.mode = mode def __enter__(self, *args, **kwargs): - # TODO: partition_table_type is hardcoded to GPT at the moment. This has to be changed. - if self.mode == self.blockdevice.partition_table_type: - log(f'Kept partition format {self.mode} for {self.blockdevice}', level=logging.DEBUG) - else: - raise DiskError(f'The selected partition table format {self.mode} does not match that of {self.blockdevice}.') - return self def __repr__(self): -- cgit v1.2.3-54-g00ecf From 29aa991ab5caf4f48cad1e5a4393234542a358c1 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 16 Nov 2021 14:06:02 +0000 Subject: Improved error message when failing to detect mount information. --- archinstall/lib/installer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 3b8f9612..bb2363d8 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -186,8 +186,10 @@ class Installer: mountpoints[mountpoint]['device_instance'].mount(f"{self.target}{mountpoint}") time.sleep(1) - if not get_mount_info(f"{self.target}{mountpoint}", traverse=False): - raise DiskError(f"Target {self.target}{mountpoint} never got mounted properly.") + try: + get_mount_info(f"{self.target}{mountpoint}", traverse=False) + except DiskError as err: + raise DiskError(f"Target {self.target}{mountpoint} never got mounted properly (unable to get mount information using findmnt).") if (subvolumes := mountpoints[mountpoint].get('btrfs', {}).get('subvolumes', {})): for name, location in subvolumes.items(): -- cgit v1.2.3-54-g00ecf From ba88e0a353cdc04250a7d878845c293a677888c9 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 16 Nov 2021 14:07:58 +0000 Subject: Added more logging for debugging purposes --- archinstall/lib/installer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index bb2363d8..98739519 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -174,6 +174,7 @@ class Installer: mountpoints[partition['mountpoint']] = partition for mountpoint in sorted(mountpoints.keys()): + log(f"Mounting {mountpoint} to {self.target}{mountpoint}", level=logging.INFO) if mountpoints[mountpoint]['encrypted']: loopdev = storage.get('ENC_IDENTIFIER', 'ai') + 'loop' if not (password := mountpoints[mountpoint].get('!password', None)): -- cgit v1.2.3-54-g00ecf From af514cf65e08227056ef3e8d3b56a08ec5fbd92e Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 16 Nov 2021 14:14:13 +0000 Subject: Linting issues --- archinstall/lib/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 98739519..22485020 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -189,7 +189,7 @@ class Installer: time.sleep(1) try: get_mount_info(f"{self.target}{mountpoint}", traverse=False) - except DiskError as err: + except DiskError: raise DiskError(f"Target {self.target}{mountpoint} never got mounted properly (unable to get mount information using findmnt).") if (subvolumes := mountpoints[mountpoint].get('btrfs', {}).get('subvolumes', {})): -- cgit v1.2.3-54-g00ecf From c70b3608798f59666efa232f78cc4de0e8eac558 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 16 Nov 2021 14:41:00 +0000 Subject: Removed redundant boot-partition retrieval. --- archinstall/1 | 4 ++++ archinstall/lib/installer.py | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 archinstall/1 diff --git a/archinstall/1 b/archinstall/1 new file mode 100644 index 00000000..67dbff9e --- /dev/null +++ b/archinstall/1 @@ -0,0 +1,4 @@ +grep: lib/__pycache__/disk.cpython-39.pyc: binary file matches +grep: lib/__pycache__/installer.cpython-39.pyc: binary file matches +grep: lib/__pycache__/user_interaction.cpython-39.pyc: binary file matches +grep: lib/disk/__pycache__/helpers.cpython-39.pyc: binary file matches diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 22485020..5ec8bf17 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -622,7 +622,6 @@ class Installer: self.helper_flags['bootloader'] = True return True else: - boot_partition = find_partition_by_mountpoint(self.partitions, relative_mountpoint=f"/boot") SysCommand(f'/usr/bin/arch-chroot {self.target} grub-install --target=i386-pc --recheck {boot_partition.path}') SysCommand(f'/usr/bin/arch-chroot {self.target} grub-mkconfig -o /boot/grub/grub.cfg') self.helper_flags['bootloader'] = True -- cgit v1.2.3-54-g00ecf From 8619dcc5792df0061518ccc7a560546fa8f600b0 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 16 Nov 2021 14:55:56 +0000 Subject: removed redundant import --- archinstall/lib/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 5ec8bf17..df0ddcdb 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -7,7 +7,7 @@ import shlex import pathlib import subprocess import glob -from .disk import get_partitions_in_use, Partition, find_partition_by_mountpoint +from .disk import get_partitions_in_use, Partition from .general import SysCommand from .hardware import has_uefi, is_vm, cpu_vendor from .locale_helpers import verify_keyboard_layout, verify_x11_keyboard_layout -- cgit v1.2.3-54-g00ecf From 4adb75c34b8190e6dcd01a59fa67eea46861954e Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 16 Nov 2021 15:06:54 +0000 Subject: Accidental stdout redirect into 1 --- archinstall/1 | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 archinstall/1 diff --git a/archinstall/1 b/archinstall/1 deleted file mode 100644 index 67dbff9e..00000000 --- a/archinstall/1 +++ /dev/null @@ -1,4 +0,0 @@ -grep: lib/__pycache__/disk.cpython-39.pyc: binary file matches -grep: lib/__pycache__/installer.cpython-39.pyc: binary file matches -grep: lib/__pycache__/user_interaction.cpython-39.pyc: binary file matches -grep: lib/disk/__pycache__/helpers.cpython-39.pyc: binary file matches -- cgit v1.2.3-54-g00ecf