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.py35
1 files changed, 21 insertions, 14 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 0bdddb2e..47a26d6d 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -1,14 +1,23 @@
import time
-from .disk import *
-from .hardware import *
+import logging
+import os
+import shutil
+import pathlib
+import subprocess
+import glob
+from .disk import get_partitions_in_use, Partition, find_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
from .disk.helpers import get_mount_info
-from .mirrors import *
+from .mirrors import use_mirrors
from .plugins import plugins
from .storage import storage
-from .user_interaction import *
+# from .user_interaction import *
+from .output import log
+from .profiles import Profile
from .disk.btrfs import create_subvolume, mount_subvolume
-from .exceptions import DiskError, ServiceException
+from .exceptions import DiskError, ServiceException, RequirementError, HardwareIncompatibilityError
# Any package that the Installer() is responsible for (optional and the default ones)
__packages__ = ["base", "base-devel", "linux-firmware", "linux", "linux-lts", "linux-zen", "linux-hardened"]
@@ -139,7 +148,7 @@ class Installer:
for mountpoint in sorted(mountpoints.keys()):
if mountpoints[mountpoint]['encrypted']:
- loopdev = storage.get('ENC_IDENTIFIER', 'ai')+'loop'
+ loopdev = storage.get('ENC_IDENTIFIER', 'ai') + 'loop'
password = mountpoints[mountpoint]['password']
with luks2(mountpoints[mountpoint]['device_instance'], loopdev, password, auto_unmount=False) as unlocked_device:
unlocked_device.mount(f"{self.target}{mountpoint}")
@@ -198,7 +207,7 @@ class Installer:
self.log(f"Updating {self.target}/etc/fstab", level=logging.INFO)
with open(f"{self.target}/etc/fstab", 'a') as fstab_fh:
- fstab_fh.write(SysCommand(f'/usr/bin/genfstab {flags} {self.target}').decode())
+ fstab_fh.write((fstab := SysCommand(f'/usr/bin/genfstab {flags} {self.target}')).decode())
if not os.path.isfile(f'{self.target}/etc/fstab'):
raise RequirementError(f'Could not generate fstab, strapping in packages most likely failed (disk out of space?)\n{fstab}')
@@ -554,7 +563,7 @@ class Installer:
self.helper_flags['bootloader'] = True
return True
else:
- boot_partition = filesystem.find_partition(mountpoint=f"{self.target}/boot")
+ boot_partition = find_partition(mountpoint=f"{self.target}/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
@@ -595,14 +604,14 @@ class Installer:
if not handled_by_plugin:
self.log(f'Creating user {user}', level=logging.INFO)
- o = b''.join(SysCommand(f'/usr/bin/arch-chroot {self.target} useradd -m -G wheel {user}'))
+ SysCommand(f'/usr/bin/arch-chroot {self.target} useradd -m -G wheel {user}')
if password:
self.user_set_pw(user, password)
if groups:
for group in groups:
- o = b''.join(SysCommand(f'/usr/bin/arch-chroot {self.target} gpasswd -a {user} {group}'))
+ SysCommand(f'/usr/bin/arch-chroot {self.target} gpasswd -a {user} {group}')
if sudo and self.enable_sudo(user):
self.helper_flags['user'] = True
@@ -614,14 +623,12 @@ class Installer:
# This means the root account isn't locked/disabled with * in /etc/passwd
self.helper_flags['user'] = True
- o = b''.join(SysCommand(f"/usr/bin/arch-chroot {self.target} sh -c \"echo '{user}:{password}' | chpasswd\""))
- pass
+ SysCommand(f"/usr/bin/arch-chroot {self.target} sh -c \"echo '{user}:{password}' | chpasswd\"")
def user_set_shell(self, user, shell):
self.log(f'Setting shell for {user} to {shell}', level=logging.INFO)
- o = b''.join(SysCommand(f"/usr/bin/arch-chroot {self.target} sh -c \"chsh -s {shell} {user}\""))
- pass
+ SysCommand(f"/usr/bin/arch-chroot {self.target} sh -c \"chsh -s {shell} {user}\"")
def set_keyboard_language(self, language: str) -> bool:
if len(language.strip()):