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:
authorAnton Hvornum <anton@hvornum.se>2021-04-29 08:18:43 +0000
committerGitHub <noreply@github.com>2021-04-29 10:18:43 +0200
commit2d02e806f2ae5341752a0ceb532e5c239a164ee7 (patch)
tree57f7e5c956fc63f008bafedec91a6ceafde66b8b /archinstall/lib/installer.py
parent9fd87a4b531ceaa037014d7ff710823698f49300 (diff)
Cleaning up packages. (#374)
* Cleaning up packages. installer now relies on __packages__ definition. Which will work with external libs to more easily gather packages used by installer and profiles. * Added back the logic for the log message, where we inform if we're adding the boot loader to root or boot. * Added __package__ definition to profiles and the installer. These packages can be used as an indication from outside libraries of what could *possibly* be installed. For instance an offline-tool could source these, it would source more than it needed to, but it would give a quick rundown of what might be needed. * Removed import of __base__packages__ as it's now just __packages__ after a lot of stream-lining. * Explosion misspelling. Co-authored-by: Anton Hvornum <anton.feeds@gmail.com>
Diffstat (limited to 'archinstall/lib/installer.py')
-rw-r--r--archinstall/lib/installer.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index a5449662..dbc6d1b4 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -12,8 +12,7 @@ from .storage import storage
from .hardware import *
# Any package that the Installer() is responsible for (optional and the default ones)
-__packages__ = ["base", "base-devel", "linux", "linux-firmware", "efibootmgr", "nano", "ntp", "iwd"]
-__base_packages__ = __packages__[:6]
+__packages__ = ["base", "base-devel", "linux-firmware", "linux", "linux-lts", "linux-zen", "linux-hardened"]
class Installer():
"""
@@ -39,8 +38,7 @@ class Installer():
:type hostname: str, optional
"""
- def __init__(self, target, *, base_packages='base base-devel linux-firmware', kernels='linux'):
- kernels = kernels.split(",")
+ def __init__(self, target, *, base_packages=__packages__[:3], kernels=['linux']):
self.target = target
self.init_time = time.strftime('%Y-%m-%d_%H-%M-%S')
self.milliseconds = int(str(time.time()).split('.')[1])
@@ -53,10 +51,7 @@ class Installer():
self.base_packages = base_packages.split(' ') if type(base_packages) is str else base_packages
for kernel in kernels:
self.base_packages.append(kernel)
- if hasUEFI():
- self.base_packages.append("efibootmgr")
- else:
- self.base_packages.append("grub")
+
self.post_base_install = []
storage['session'] = self
@@ -364,12 +359,12 @@ class Installer():
boot_partition = partition
elif partition.mountpoint == self.target:
root_partition = partition
- if hasUEFI():
- self.log(f'Adding bootloader {bootloader} to {boot_partition}', level=logging.INFO)
- else:
- self.log(f'Adding bootloader {bootloader} to {root_partition}', level=logging.INFO)
+
+ self.log(f'Adding bootloader {bootloader} to {boot_partition if boot_partition else root_partition}', level=logging.INFO)
if bootloader == 'systemd-bootctl':
+ self.pacstrap('efibootmgr')
+
if not hasUEFI():
raise HardwareIncompatibilityError
# TODO: Ideally we would want to check if another config
@@ -432,6 +427,8 @@ class Installer():
raise RequirementError(f"Could not identify the UUID of {self.partition}, there for {self.target}/boot/loader/entries/arch.conf will be broken until fixed.")
elif bootloader == "grub-install":
+ self.pacstrap('grub')
+
if hasUEFI():
o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.target} grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB'))
sys_command('/usr/bin/arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg')