From b59a40606974a82e1d99751fd68818c3b7b0fe0f Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Thu, 29 Apr 2021 14:22:38 +0200 Subject: Adding on_pacstrap hook for installation. As well as a plugins listing that plugins can hook in to in order to be called during specific on_ calls. --- archinstall/lib/installer.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'archinstall/lib/installer.py') diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index a7b36481..51539d2c 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -10,6 +10,7 @@ from .systemd import Networkd from .output import log from .storage import storage from .hardware import * +from .plugins import plugins # 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"] @@ -126,6 +127,12 @@ class Installer(): def pacstrap(self, *packages, **kwargs): if type(packages[0]) in (list, tuple): packages = packages[0] + + for plugin in plugins.values(): + if hasattr(plugin, 'on_pacstrap'): + if (result := plugin.on_pacstrap(packages)): + packages = result + self.log(f'Installing packages: {packages}', level=logging.INFO) if (sync_mirrors := sys_command('/usr/bin/pacman -Syy')).exit_code == 0: -- cgit v1.2.3-70-g09d2