Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/installer.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib/installer.py')
-rw-r--r--archinstall/lib/installer.py50
1 files changed, 32 insertions, 18 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index ba57a001..7337fe6f 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -880,17 +880,31 @@ class Installer:
self.pacman.strap('efibootmgr') # TODO: Do we need? Yes, but remove from minimal_installation() instead?
try:
- SysCommand(f'/usr/bin/arch-chroot {self.target} grub-install --debug --target=x86_64-efi --efi-directory={boot_partition.mountpoint} --bootloader-id=GRUB --removable', peek_output=True)
+ SysCommand(
+ f'/usr/bin/arch-chroot {self.target} grub-install '
+ f'--debug '
+ f'--target=x86_64-efi '
+ f'--efi-directory={boot_partition.mountpoint} '
+ f'--bootloader-id=GRUB '
+ f'--removable',
+ peek_output=True
+ )
except SysCallError:
try:
- SysCommand(f'/usr/bin/arch-chroot {self.target} grub-install --debug --target=x86_64-efi --efi-directory={boot_partition.mountpoint} --bootloader-id=GRUB --removable', peek_output=True)
+ SysCommand(
+ f'/usr/bin/arch-chroot {self.target} '
+ f'grub-install '
+ f'--debug '
+ f'--target=x86_64-efi '
+ f'--efi-directory={boot_partition.mountpoint} '
+ f'--bootloader-id=GRUB '
+ f'--removable',
+ peek_output=True
+ )
except SysCallError as err:
raise DiskError(f"Could not install GRUB to {self.target}{boot_partition.mountpoint}: {err}")
else:
- device = disk.device_handler.get_device_by_partition_path(boot_partition.safe_dev_path)
-
- if not device:
- raise ValueError(f'Can not find block device: {boot_partition.safe_dev_path}')
+ parent_dev_path = disk.device_handler.get_parent_device_path(boot_partition.safe_dev_path)
try:
cmd = f'/usr/bin/arch-chroot' \
@@ -898,14 +912,17 @@ class Installer:
f' grub-install' \
f' --debug' \
f' --target=i386-pc' \
- f' --recheck {device.device_info.path}'
+ f' --recheck {parent_dev_path}'
SysCommand(cmd, peek_output=True)
except SysCallError as err:
raise DiskError(f"Failed to install GRUB boot on {boot_partition.dev_path}: {err}")
try:
- SysCommand(f'/usr/bin/arch-chroot {self.target} grub-mkconfig -o {boot_partition.mountpoint}/grub/grub.cfg')
+ SysCommand(
+ f'/usr/bin/arch-chroot {self.target} '
+ f'grub-mkconfig -o {boot_partition.mountpoint}/grub/grub.cfg'
+ )
except SysCallError as err:
raise DiskError(f"Could not configure GRUB: {err}")
@@ -923,10 +940,6 @@ class Installer:
# partition before the format.
root_uuid = get_lsblk_info(root_partition.safe_dev_path).uuid
- device = disk.device_handler.get_device_by_partition_path(boot_partition.safe_dev_path)
- if not device:
- raise ValueError(f'Can not find block device: {boot_partition.safe_dev_path}')
-
def create_pacman_hook(contents: str):
HOOK_DIR = "/etc/pacman.d/hooks"
SysCommand(f"/usr/bin/arch-chroot {self.target} mkdir -p {HOOK_DIR}")
@@ -940,6 +953,8 @@ class Installer:
f' cp' \
f' /usr/share/limine/BOOTX64.EFI' \
f' /boot/EFI/BOOT/'
+
+ SysCommand(cmd, peek_output=True)
except SysCallError as err:
raise DiskError(f"Failed to install Limine BOOTX64.EFI on {boot_partition.dev_path}: {err}")
@@ -957,6 +972,8 @@ When = PostTransaction
Exec = /usr/bin/cp /usr/share/limine/BOOTX64.EFI /boot/EFI/BOOT/
""")
else:
+ parent_dev_path = disk.device_handler.get_parent_device_path(boot_partition.safe_dev_path)
+
try:
# The `limine.sys` file, contains stage 3 code.
cmd = f'/usr/bin/arch-chroot' \
@@ -972,7 +989,7 @@ Exec = /usr/bin/cp /usr/share/limine/BOOTX64.EFI /boot/EFI/BOOT/
f' {self.target}' \
f' limine' \
f' bios-install' \
- f' {device.device_info.path}'
+ f' {parent_dev_path}'
SysCommand(cmd, peek_output=True)
except SysCallError as err:
@@ -1062,13 +1079,10 @@ TIMEOUT=5
debug(f'Root partition is an encrypted device identifying by PARTUUID: {root_partition.partuuid}')
kernel_parameters.append(f'root=PARTUUID={root_partition.partuuid} rw rootfstype={root_partition.safe_fs_type.value} {" ".join(self._kernel_params)}')
- device = disk.device_handler.get_device_by_partition_path(boot_partition.safe_dev_path)
-
- if not device:
- raise ValueError(f'Unable to find block device: {boot_partition.safe_dev_path}')
+ parent_dev_path = disk.device_handler.get_parent_device_path(boot_partition.safe_dev_path)
cmd = f'efibootmgr ' \
- f'--disk {device.device_info.path} ' \
+ f'--disk {parent_dev_path} ' \
f'--part {boot_partition.safe_dev_path} ' \
f'--create ' \
f'--label "{label}" ' \