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
538 changes: 538 additions & 0 deletions archinstall-meta/PKGBUILD

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions archinstall/applications/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from archinstall.lib.hardware import SysInfo
from archinstall.lib.log import debug
from archinstall.lib.models.application import Audio, AudioConfiguration
from archinstall.lib.models.package_types import InstallationPackage
from archinstall.lib.models.users import User

if TYPE_CHECKING:
Expand Down Expand Up @@ -67,10 +68,10 @@ def install(
return

if SysInfo.requires_sof_fw():
install_session.add_additional_packages('sof-firmware')
install_session.add_additional_packages(InstallationPackage.SOF_FIRMWARE.value)

if SysInfo.requires_alsa_fw():
install_session.add_additional_packages('alsa-firmware')
install_session.add_additional_packages(InstallationPackage.ALSA_FIRMWARE.value)

match audio_config.audio:
case Audio.PIPEWIRE:
Expand Down
3 changes: 2 additions & 1 deletion archinstall/default_profiles/desktop.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from archinstall.default_profiles.profile import CustomSetting, DisplayServerType, GreeterType, Profile, ProfileType, SelectResult
from archinstall.lib.log import info
from archinstall.lib.menu.helpers import Selection
from archinstall.lib.models.package_types import InstallationPackage
from archinstall.lib.profile.profiles_handler import profile_handler
from archinstall.tui.menu_item import MenuItem, MenuItemGroup
from archinstall.tui.result import ResultType
Expand Down Expand Up @@ -112,7 +113,7 @@ def install(self, install_session: Installer) -> None:
install_session.enable_service(profile.services)

if not xorg_installed and profile.display_server == DisplayServerType.Xorg:
install_session.add_additional_packages(['xorg-server', 'xorg-xinit'])
install_session.add_additional_packages([InstallationPackage.XORG_SERVER.value, InstallationPackage.XORG_XINIT.value])
xorg_installed = True

profile.install(install_session)
3 changes: 2 additions & 1 deletion archinstall/lib/authentication/authentication_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from archinstall.lib.command import SysCommandWorker
from archinstall.lib.log import debug, info
from archinstall.lib.models.authentication import AuthenticationConfiguration, U2FLoginConfiguration, U2FLoginMethod
from archinstall.lib.models.package_types import InstallationPackage
from archinstall.lib.models.users import User
from archinstall.lib.translationhandler import tr

Expand Down Expand Up @@ -79,7 +80,7 @@ def _configure_u2f_mapping(
) -> None:
debug(f'Setting up U2F login: {u2f_config.u2f_login_method.value}')

install_session.pacman.strap('pam-u2f')
install_session.pacman.strap(InstallationPackage.PAM_U2F.value)

print(tr('Setting up U2F login: {}').format(u2f_config.u2f_login_method.value))

Expand Down
40 changes: 20 additions & 20 deletions archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
from archinstall.lib.models.locale import LocaleConfiguration
from archinstall.lib.models.mirrors import MirrorConfiguration
from archinstall.lib.models.network import Nic
from archinstall.lib.models.package_types import DEFAULT_KERNEL, Kernel
from archinstall.lib.models.package_types import DEFAULT_KERNEL, InstallationPackage, Kernel
from archinstall.lib.models.packages import Repository
from archinstall.lib.models.pacman import PacmanConfiguration
from archinstall.lib.models.users import User
Expand Down Expand Up @@ -799,7 +799,7 @@ def copy_iso_network_config(self, enable_services: bool = False) -> bool:
if enable_services:
# If we haven't installed the base yet (function called pre-maturely)
if self._helper_flags.get('base', False) is False:
self._base_packages.append('iwd')
self._base_packages.append(InstallationPackage.IWD.value)

# This function will be called after minimal_installation()
# as a hook for post-installs. This hook is only needed if
Expand All @@ -811,7 +811,7 @@ def post_install_enable_iwd_service(*args: str, **kwargs: str) -> None:
# Otherwise, we can go ahead and add the required package
# and enable it's service:
else:
self.pacman.strap('iwd')
self.pacman.strap(InstallationPackage.IWD.value)
self.enable_service('iwd')

self.systemd_resolved_stub_mode()
Expand Down Expand Up @@ -890,7 +890,7 @@ def _prepare_fs_type(self, fs_type: FilesystemType) -> None:
def _prepare_encrypt(self, before: str = 'filesystems') -> None:
if self._disk_encryption.hsm_device:
# Required by mkinitcpio to add support for fido2-device options
self.pacman.strap('libfido2')
self.pacman.strap(InstallationPackage.LIBFIDO2.value)

if 'sd-encrypt' not in self._hooks:
self._hooks.insert(self._hooks.index(before), 'sd-encrypt')
Expand All @@ -907,7 +907,7 @@ def minimal_installation(
pacman_config: PacmanConfiguration | None = None,
) -> None:
if self._disk_config.lvm_config:
lvm = 'lvm2'
lvm = InstallationPackage.LVM2.value
self.add_additional_packages(lvm)
self._hooks.insert(self._hooks.index('filesystems') - 1, lvm)

Expand Down Expand Up @@ -999,7 +999,7 @@ def setup_btrfs_snapshot(
) -> None:
if snapshot_type == SnapshotType.Snapper:
debug('Setting up Btrfs snapper')
self.pacman.strap('snapper')
self.pacman.strap(InstallationPackage.SNAPPER.value)

snapper: dict[str, str] = {
'root': '/',
Expand All @@ -1020,20 +1020,20 @@ def setup_btrfs_snapshot(
elif snapshot_type == SnapshotType.Timeshift:
debug('Setting up Btrfs timeshift')

self.pacman.strap('cronie')
self.pacman.strap('timeshift')
self.pacman.strap(InstallationPackage.CRONIE.value)
self.pacman.strap(InstallationPackage.TIMESHIFT.value)
self.enable_service('cronie.service')

if bootloader and bootloader == Bootloader.Grub:
debug('Setting up grub integration for either')
self.pacman.strap('grub-btrfs')
self.pacman.strap('inotify-tools')
self.pacman.strap(InstallationPackage.GRUB_BTRFS.value)
self.pacman.strap(InstallationPackage.INOTIFY_TOOLS.value)
self._configure_grub_btrfsd(snapshot_type)
self.enable_service('grub-btrfsd.service')

def setup_swap(self, algo: ZramAlgorithm = ZramAlgorithm.ZSTD) -> None:
info('Setting up swap on zram')
self.pacman.strap('zram-generator')
self.pacman.strap(InstallationPackage.ZRAM_GENERATOR.value)

info(f'Zram compression algorithm: {algo.value}')

Expand Down Expand Up @@ -1250,7 +1250,7 @@ def _add_systemd_bootloader(
) -> None:
debug('Installing systemd bootloader')

self.pacman.strap('efibootmgr')
self.pacman.strap(InstallationPackage.EFIBOOTMGR.value)

if not SysInfo.has_uefi():
raise HardwareIncompatibilityError
Expand Down Expand Up @@ -1340,7 +1340,7 @@ def _add_grub_bootloader(
) -> None:
debug('Installing grub bootloader')

self.pacman.strap('grub')
self.pacman.strap(InstallationPackage.GRUB.value)

info(f'GRUB boot partition: {boot_partition.dev_path}')

Expand All @@ -1354,7 +1354,7 @@ def _add_grub_bootloader(

info(f'GRUB EFI partition: {efi_partition.dev_path}')

self.pacman.strap('efibootmgr') # TODO: Do we need? Yes, but remove from minimal_installation() instead?
self.pacman.strap(InstallationPackage.EFIBOOTMGR.value)

boot_dir_arg = []
if boot_partition.mountpoint and boot_partition.mountpoint != boot_dir:
Expand Down Expand Up @@ -1455,7 +1455,7 @@ def _add_limine_bootloader(
) -> None:
debug('Installing Limine bootloader')

self.pacman.strap('limine')
self.pacman.strap(InstallationPackage.LIMINE.value)

info(f'Limine boot partition: {boot_partition.dev_path}')

Expand All @@ -1464,7 +1464,7 @@ def _add_limine_bootloader(
hook_command = None

if SysInfo.has_uefi():
self.pacman.strap('efibootmgr')
self.pacman.strap(InstallationPackage.EFIBOOTMGR.value)

if not efi_partition:
raise ValueError('Could not detect efi partition')
Expand Down Expand Up @@ -1619,7 +1619,7 @@ def _add_efistub_bootloader(
) -> None:
debug('Installing efistub bootloader')

self.pacman.strap('efibootmgr')
self.pacman.strap(InstallationPackage.EFIBOOTMGR.value)

if not SysInfo.has_uefi():
raise HardwareIncompatibilityError
Expand Down Expand Up @@ -1675,7 +1675,7 @@ def _add_refind_bootloader(
) -> None:
debug('Installing rEFInd bootloader')

self.pacman.strap('refind')
self.pacman.strap(InstallationPackage.REFIND.value)

if not SysInfo.has_uefi():
raise HardwareIncompatibilityError
Expand Down Expand Up @@ -1767,7 +1767,7 @@ def _add_refind_bootloader(

def _install_plymouth(self, plymouth: PlymouthTheme) -> None:
debug(f'Installing plymouth with theme: {plymouth.value}')
self.add_additional_packages(['plymouth'])
self.add_additional_packages([InstallationPackage.PLYMOUTH.value])

for param in ('quiet', 'splash'):
if param not in self._kernel_params:
Expand Down Expand Up @@ -2041,7 +2041,7 @@ def set_vconsole(self, locale_config: LocaleConfiguration) -> None:
font_vconsole = locale_config.console_font

if font_vconsole.startswith('ter-'):
self.pacman.strap(['terminus-font'])
self.pacman.strap([InstallationPackage.TERMINUS_FONT.value])

# Ensure /etc exists
vconsole_dir: Path = self.target / 'etc'
Expand Down
38 changes: 38 additions & 0 deletions archinstall/lib/models/package_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,41 @@ class Kernel(StrEnum):


DEFAULT_KERNEL: Final = Kernel.LINUX


class InstallationPackage(StrEnum):
ALSA_FIRMWARE = 'alsa-firmware'
COSMIC_GREETER = 'cosmic-greeter'
CRONIE = 'cronie'
EFIBOOTMGR = 'efibootmgr'
GDM = 'gdm'
GIT = 'git'
GREETD = 'greetd'
GRUB = 'grub'
GRUB_BTRFS = 'grub-btrfs'
INOTIFY_TOOLS = 'inotify-tools'
IWD = 'iwd'
LIBFIDO2 = 'libfido2'
LIGHTDM = 'lightdm'
LIGHTDM_GTK_GREETER = 'lightdm-gtk-greeter'
LIGHTDM_SLICK_GREETER = 'lightdm-slick-greeter'
LIMINE = 'limine'
LVM2 = 'lvm2'
LY = 'ly'
NANO = 'nano'
NETWORK_MANAGER_APPLET = 'network-manager-applet'
NETWORKMANAGER = 'networkmanager'
PAM_U2F = 'pam-u2f'
PLASMA_LOGIN_MANAGER = 'plasma-login-manager'
PLYMOUTH = 'plymouth'
REFIND = 'refind'
SDDM = 'sddm'
SNAPPER = 'snapper'
SOF_FIRMWARE = 'sof-firmware'
TERMINUS_FONT = 'terminus-font'
TIMESHIFT = 'timeshift'
WGET = 'wget'
WPA_SUPPLICANT = 'wpa_supplicant'
XORG_SERVER = 'xorg-server'
XORG_XINIT = 'xorg-xinit'
ZRAM_GENERATOR = 'zram-generator'
11 changes: 6 additions & 5 deletions archinstall/lib/network/network_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from archinstall.lib.installer import Installer
from archinstall.lib.models.network import NetworkConfiguration, NicType
from archinstall.lib.models.package_types import InstallationPackage
from archinstall.lib.models.profile import ProfileConfiguration


Expand All @@ -15,16 +16,16 @@ def install_network_config(
# Sources the ISO network configuration to the install medium.
installation.copy_iso_network_config(enable_services=True)
case NicType.NM | NicType.NM_IWD:
packages = ['networkmanager']
packages = [InstallationPackage.NETWORKMANAGER.value]

if network_config.type == NicType.NM:
packages.append('wpa_supplicant')
packages.append(InstallationPackage.WPA_SUPPLICANT.value)
else:
packages.append('iwd')
packages.append(InstallationPackage.IWD.value)

if profile_config and profile_config.profile:
if profile_config.profile.is_desktop_profile():
packages.append('network-manager-applet')
packages.append(InstallationPackage.NETWORK_MANAGER_APPLET.value)

installation.add_additional_packages(packages)
installation.enable_service('NetworkManager.service')
Expand All @@ -34,7 +35,7 @@ def install_network_config(
installation.disable_service('iwd.service')

case NicType.IWD:
installation.add_additional_packages(['iwd'])
installation.add_additional_packages([InstallationPackage.IWD.value])
_configure_iwd_standalone(installation)
installation.enable_service('iwd.service')
installation.enable_service('systemd-networkd.service')
Expand Down
Loading