From 2aed8c6ad5a8ab31accb6d618bca4798591cf415 Mon Sep 17 00:00:00 2001 From: Yash Tripathi Date: Mon, 24 May 2021 19:23:08 +0530 Subject: removed builtins usage and added gfx_package key in config --- profiles/sway.py | 6 +++--- profiles/xorg.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'profiles') diff --git a/profiles/sway.py b/profiles/sway.py index 9afc047d..b0ff8c19 100644 --- a/profiles/sway.py +++ b/profiles/sway.py @@ -25,7 +25,7 @@ def _prep_function(*args, **kwargs): other code in this stage. So it's a safe way to ask the user for more input before any other installer steps start. """ - __builtins__["_gfx_driver_packages"] = archinstall.select_driver() + archinstall.storage["gfx_driver_packages"] = archinstall.select_driver() return True @@ -34,7 +34,7 @@ def _prep_function(*args, **kwargs): # through importlib.util.spec_from_file_location("sway", "/somewhere/sway.py") # or through conventional import sway if __name__ == "sway": - if "nvidia" in _gfx_driver_packages: + if "nvidia" in archinstall.storage.get("gfx_driver_packages", None): choice = input("The proprietary Nvidia driver is not supported by Sway. It is likely that you will run into issues. Continue anyways? [y/N] ") if choice.lower() in ("n", ""): raise archinstall.lib.exceptions.HardwareIncompatibilityError("Sway does not support the proprietary nvidia drivers.") @@ -43,4 +43,4 @@ if __name__ == "sway": archinstall.storage['installation_session'].add_additional_packages(__packages__) # Install the graphics driver packages - archinstall.storage['installation_session'].add_additional_packages(_gfx_driver_packages) + archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit {' '.join(archinstall.storage.get('gfx_driver_packages', None))}") diff --git a/profiles/xorg.py b/profiles/xorg.py index b8fb2cbb..9006a430 100644 --- a/profiles/xorg.py +++ b/profiles/xorg.py @@ -22,7 +22,7 @@ def _prep_function(*args, **kwargs): for more input before any other installer steps start. """ - __builtins__['_gfx_driver_packages'] = archinstall.select_driver() + archinstall.storage["gfx_driver_packages"] = archinstall.select_driver() # TODO: Add language section and/or merge it with the locale selected # earlier in for instance guided.py installer. @@ -35,13 +35,13 @@ def _prep_function(*args, **kwargs): # or through conventional import xorg if __name__ == 'xorg': try: - if "nvidia" in _gfx_driver_packages: + if "nvidia" in archinstall.storage.get("gfx_driver_packages", None): if "linux-zen" in archinstall.storage['installation_session'].base_packages or "linux-lts" in archinstall.storage['installation_session'].base_packages: archinstall.storage['installation_session'].add_additional_packages("dkms") # I've had kernel regen fail if it wasn't installed before nvidia-dkms archinstall.storage['installation_session'].add_additional_packages("xorg-server xorg-xinit nvidia-dkms") else: - archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit {' '.join(_gfx_driver_packages)}") + archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit {' '.join(archinstall.storage.get('gfx_driver_packages', None))}") else: - archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit {' '.join(_gfx_driver_packages)}") + archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit {' '.join(archinstall.storage.get('gfx_driver_packages', None))}") except: archinstall.storage['installation_session'].add_additional_packages("xorg-server xorg-xinit") # Prep didn't run, so there's no driver to install -- cgit v1.2.3-70-g09d2 From 26a33000d8bbd99fd4c9c0b9f5103fd012f8769a Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 27 May 2021 07:55:22 -0400 Subject: Add descriptions for top-level profiles --- examples/guided.py | 2 -- profiles/desktop.py | 2 ++ profiles/minimal.py | 2 ++ profiles/server.py | 2 ++ profiles/xorg.py | 2 ++ 5 files changed, 8 insertions(+), 2 deletions(-) (limited to 'profiles') diff --git a/examples/guided.py b/examples/guided.py index 1f67a460..a43fc9b1 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -61,7 +61,6 @@ def ask_user_questions(): if not archinstall.arguments.get('sys-encoding', None): archinstall.arguments['sys-encoding'] = 'utf-8' - # Ask which harddrive/block-device we will install to if archinstall.arguments.get('harddrive', None): archinstall.arguments['harddrive'] = archinstall.BlockDevice(archinstall.arguments['harddrive']) @@ -453,5 +452,4 @@ else: if archinstall.arguments.get('gfx_driver', None) is not None: archinstall.storage['gfx_driver_packages'] = AVAILABLE_GFX_DRIVERS.get(archinstall.arguments.get('gfx_driver', None), None) - perform_installation_steps() diff --git a/profiles/desktop.py b/profiles/desktop.py index 631c7f76..73df9256 100644 --- a/profiles/desktop.py +++ b/profiles/desktop.py @@ -4,6 +4,8 @@ import archinstall is_top_level_profile = True +__description__ = 'Provides a selection of desktop environments and tiling window managers, e.g. gnome, kde, sway' + # New way of defining packages for a profile, which is iterable and can be used out side # of the profile to get a list of "what packages will be installed". __packages__ = [ diff --git a/profiles/minimal.py b/profiles/minimal.py index 13cfd05a..c7df517c 100644 --- a/profiles/minimal.py +++ b/profiles/minimal.py @@ -2,6 +2,8 @@ is_top_level_profile = True +__description__ = 'A very basic installation that allows you to customize Arch Linux as you see fit.' + def _prep_function(*args, **kwargs): """ diff --git a/profiles/server.py b/profiles/server.py index 704c8efe..79aa9481 100644 --- a/profiles/server.py +++ b/profiles/server.py @@ -6,6 +6,8 @@ import archinstall is_top_level_profile = True +__description__ = 'Provides a selection of various server packages to install and enable, e.g. httpd, nginx, mariadb' + available_servers = [ "cockpit", "docker", diff --git a/profiles/xorg.py b/profiles/xorg.py index 9006a430..ce13664d 100644 --- a/profiles/xorg.py +++ b/profiles/xorg.py @@ -4,6 +4,8 @@ import archinstall is_top_level_profile = True +__description__ = 'Installs a minimal system as well as xorg and graphics drivers.' + __packages__ = [ 'dkms', 'xorg-server', -- cgit v1.2.3-70-g09d2