Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions archinstall/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
from archinstall.lib.plugins import plugin

__all__ = ['plugin']
13 changes: 0 additions & 13 deletions archinstall/lib/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from archinstall.lib.models.profile import ProfileConfiguration
from archinstall.lib.models.users import Password, User, UserSerialization
from archinstall.lib.output import debug, error, logger, warn
from archinstall.lib.plugins import load_plugin
from archinstall.lib.translationhandler import Language, tr, translation_handler
from archinstall.lib.version import get_version
from archinstall.tui.ui.components import tui
Expand All @@ -48,7 +47,6 @@ class Arguments:
debug: bool = False
offline: bool = False
no_pkg_lookups: bool = False
plugin: str | None = None
skip_version_check: bool = False
skip_wifi_check: bool = False
advanced: bool = False
Expand Down Expand Up @@ -395,13 +393,6 @@ def _define_arguments(self) -> ArgumentParser:
default=False,
help='Disabled package validation specifically prior to starting installation.',
)
parser.add_argument(
'--plugin',
nargs='?',
type=str,
default=None,
help='File path to a plugin to load',
)
parser.add_argument(
'--skip-version-check',
action='store_true',
Expand Down Expand Up @@ -441,10 +432,6 @@ def _parse_args(self) -> Arguments:
if args.debug:
warn(f'Warning: --debug mode will write certain credentials to {logger.path}!')

if args.plugin:
plugin_path = Path(args.plugin)
load_plugin(plugin_path)

if args.creds_decryption_key is None:
if os.environ.get('ARCHINSTALL_CREDS_DECRYPTION_KEY'):
args.creds_decryption_key = os.environ.get('ARCHINSTALL_CREDS_DECRYPTION_KEY')
Expand Down
83 changes: 9 additions & 74 deletions archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
from archinstall.lib.pacman.config import PacmanConfig
from archinstall.lib.pacman.pacman import Pacman
from archinstall.lib.pathnames import MIRRORLIST, PACMAN_CONF
from archinstall.lib.plugins import plugins
from archinstall.lib.translationhandler import tr

# Any package that the Installer() is responsible for (optional and the default ones)
Expand Down Expand Up @@ -560,11 +559,6 @@ def set_mirrors(
"""
debug('Setting mirrors on ' + ('target' if on_target else 'live system'))

for plugin in plugins.values():
if hasattr(plugin, 'on_mirrors'):
if result := plugin.on_mirrors(mirror_config):
mirror_config = result

if on_target:
mirrorlist_config = self.target / MIRRORLIST.relative_to_root()
pacman_config = self.target / PACMAN_CONF.relative_to_root()
Expand Down Expand Up @@ -606,11 +600,6 @@ def genfstab(self, flags: str = '-pU') -> None:
if not fstab_path.is_file():
raise RequirementError('Could not create fstab file')

for plugin in plugins.values():
if hasattr(plugin, 'on_genfstab'):
if plugin.on_genfstab(self) is True:
break

with open(fstab_path, 'a') as fp:
for entry in self._fstab_entries:
fp.write(f'{entry}\n')
Expand Down Expand Up @@ -673,11 +662,6 @@ def set_timezone(self, zone: str) -> bool:
if not len(zone):
return True # Redundant

for plugin in plugins.values():
if hasattr(plugin, 'on_timezone'):
if result := plugin.on_timezone(zone):
zone = result

if (Path('/usr') / 'share' / 'zoneinfo' / zone).exists():
(Path(self.target) / 'etc' / 'localtime').unlink(missing_ok=True)
self.arch_chroot(f'ln -s /usr/share/zoneinfo/{zone} /etc/localtime')
Expand Down Expand Up @@ -713,10 +697,6 @@ def enable_service(self, services: str | list[str]) -> None:
except SysCallError as err:
raise ServiceException(f'Unable to start service {service}: {err}')

for plugin in plugins.values():
if hasattr(plugin, 'on_service'):
plugin.on_service(service)

def disable_service(self, services_disable: str | list[str]) -> None:
if isinstance(services_disable, str):
services_disable = [services_disable]
Expand Down Expand Up @@ -744,19 +724,6 @@ def drop_to_shell(self) -> None:
def configure_nic(self, nic: Nic) -> None:
conf = nic.as_systemd_config()

for plugin in plugins.values():
if hasattr(plugin, 'on_configure_nic'):
conf = (
plugin.on_configure_nic(
nic.iface,
nic.dhcp,
nic.ip,
nic.gateway,
nic.dns,
)
or conf
)

with open(f'{self.target}/etc/systemd/network/10-{nic.iface}.network', 'a') as netconf:
netconf.write(str(conf))

Expand Down Expand Up @@ -818,12 +785,6 @@ def post_install_enable_networkd_resolved(*args: str, **kwargs: str) -> None:
return True

def mkinitcpio(self, flags: list[str]) -> bool:
for plugin in plugins.values():
if hasattr(plugin, 'on_mkinitcpio'):
# Allow plugins to override the usage of mkinitcpio altogether.
if plugin.on_mkinitcpio(self):
return True

with open(f'{self.target}/etc/mkinitcpio.conf', 'r+') as mkinit:
content = mkinit.read()
content = re.sub('\nMODULES=(.*)', f'\nMODULES=({" ".join(self._modules)})', content)
Expand Down Expand Up @@ -963,10 +924,6 @@ def minimal_installation(
info(f'Running post-installation hook: {function}')
function(self)

for plugin in plugins.values():
if hasattr(plugin, 'on_install'):
plugin.on_install(self)

def setup_btrfs_snapshot(
self,
snapshot_type: SnapshotType,
Expand Down Expand Up @@ -1812,14 +1769,6 @@ def add_bootloader(self, bootloader: Bootloader, uki_enabled: bool = False, boot
:param uki_enabled: Whether to use unified kernel images
:param bootloader_removable: Whether to install to removable media location (UEFI only, for GRUB and Limine)
"""

for plugin in plugins.values():
if hasattr(plugin, 'on_add_bootloader'):
# Allow plugins to override the boot-loader handling.
# This allows for boot configuring and installing bootloaders.
if plugin.on_add_bootloader(self):
return

efi_partition = self._get_efi_partition()
boot_partition = self._get_boot_partition()
root = self._get_root()
Expand Down Expand Up @@ -1902,33 +1851,19 @@ def create_users(self, users: User | list[User]) -> None:
self._create_user(user)

def _create_user(self, user: User) -> None:
# This plugin hook allows for the plugin to handle the creation of the user.
# Password and Group management is still handled by user_create()
handled_by_plugin = False
for plugin in plugins.values():
if hasattr(plugin, 'on_user_create'):
if result := plugin.on_user_create(self, user):
handled_by_plugin = result

if not handled_by_plugin:
info(f'Creating user {user.username}')
info(f'Creating user {user.username}')

cmd = 'useradd -m'
cmd = 'useradd -m'

if user.sudo:
cmd += ' -G wheel'
if user.sudo:
cmd += ' -G wheel'

cmd += f' {user.username}'
cmd += f' {user.username}'

try:
self.arch_chroot(cmd)
except SysCallError as err:
raise SystemError(f'Could not create user inside installation: {err}')

for plugin in plugins.values():
if hasattr(plugin, 'on_user_created'):
if result := plugin.on_user_created(self, user):
handled_by_plugin = result
try:
self.arch_chroot(cmd)
except SysCallError as err:
raise SystemError(f'Could not create user inside installation: {err}')

self.set_user_password(user)

Expand Down
6 changes: 0 additions & 6 deletions archinstall/lib/pacman/pacman.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from archinstall.lib.exceptions import RequirementError
from archinstall.lib.output import error, info, warn
from archinstall.lib.pathnames import PACMAN_CONF
from archinstall.lib.plugins import plugins
from archinstall.lib.translationhandler import tr


Expand Down Expand Up @@ -67,11 +66,6 @@ def strap(self, packages: str | list[str]) -> None:
if isinstance(packages, str):
packages = [packages]

for plugin in plugins.values():
if hasattr(plugin, 'on_pacstrap'):
if result := plugin.on_pacstrap(packages):
packages = result

info(f'Installing packages: {packages}')

self.ask(
Expand Down
120 changes: 0 additions & 120 deletions archinstall/lib/plugins.py

This file was deleted.

Loading
Loading