Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Taylor <dylan@dylanmtaylor.com>2021-04-10 11:58:53 -0400
committerDylan Taylor <dylan@dylanmtaylor.com>2021-04-10 11:58:53 -0400
commit5f46f76bd594cf55af4a2a3344599d61d89b2f65 (patch)
tree9d255b36259e5fb91eb111ab530fbb9f41124b98
parentd510ad5b989dabc2a4cb7b622a000ff2146f325b (diff)
Multiple restructuring changes
-rw-r--r--archinstall/lib/gfx_drivers.py21
-rw-r--r--profiles/desktop.py2
-rw-r--r--profiles/sway.py28
-rw-r--r--profiles/xorg.py23
4 files changed, 36 insertions, 38 deletions
diff --git a/archinstall/lib/gfx_drivers.py b/archinstall/lib/gfx_drivers.py
index 7abb9db0..e1fb2824 100644
--- a/archinstall/lib/gfx_drivers.py
+++ b/archinstall/lib/gfx_drivers.py
@@ -1,5 +1,24 @@
import archinstall
-def select_driver(options):
+
+AVAILABLE_DRIVERS = {
+ # Sub-dicts are layer-2 options to be selected
+ # and lists are a list of packages to be installed
+ 'AMD / ATI' : {
+ 'amd' : ['xf86-video-amdgpu'],
+ 'ati' : ['xf86-video-ati']
+ },
+ 'intel' : ['xf86-video-intel'],
+ 'nvidia' : {
+ 'open source' : ['xf86-video-nouveau'],
+ 'proprietary' : ['nvidia']
+ },
+ 'mesa' : ['mesa'],
+ 'fbdev' : ['xf86-video-fbdev'],
+ 'vesa' : ['xf86-video-vesa'],
+ 'vmware' : ['xf86-video-vmware']
+}
+
+def select_driver(options=AVAILABLE_DRIVERS):
"""
Some what convoluted function, which's job is simple.
Select a graphics driver from a pre-defined set of popular options.
diff --git a/profiles/desktop.py b/profiles/desktop.py
index 389198d6..8da6269b 100644
--- a/profiles/desktop.py
+++ b/profiles/desktop.py
@@ -12,6 +12,8 @@ def _prep_function(*args, **kwargs):
for more input before any other installer steps start.
"""
+ __builtins__['_gfx_driver_packages'] = archinstall.lib.gfx_drivers.select_driver()
+
supported_desktops = ['gnome', 'kde', 'awesome', 'xfce4', 'cinnamon', 'i3-gaps', 'i3-wm']
desktop = archinstall.generic_select(supported_desktops, 'Select your desired desktop environment: ')
diff --git a/profiles/sway.py b/profiles/sway.py
index edc3b744..10e30753 100644
--- a/profiles/sway.py
+++ b/profiles/sway.py
@@ -10,13 +10,9 @@ def _prep_function(*args, **kwargs):
for more input before any other installer steps start.
"""
- # KDE requires a functioning Xorg installation.
- profile = archinstall.Profile(None, 'wayland')
- with profile.load_instructions(namespace='wayland.py') as imported:
- if hasattr(imported, '_prep_function'):
- return imported._prep_function()
- else:
- print('Deprecated (??): wayland profile has no _prep_function() anymore')
+ __builtins__['_gfx_driver_packages'] = archinstall.lib.gfx_drivers.select_driver()
+
+ return True
def _post_install(*args, **kwargs):
choice = input("Would you like to autostart sway on login [Y/n]: ")
@@ -30,18 +26,20 @@ def _post_install(*args, **kwargs):
f.write(x)
f.close()
else:
- installation.log("to start sway run the command sway")
- installation.log("we use the default configartion shipped by arch linux, if you wish to change it you should chroot into the installation and modify it")
+ installation.log("To start Sway, run the 'sway' command after logging in.")
+
# Ensures that this code only gets executed if executed
# through importlib.util.spec_from_file_location("kde", "/somewhere/kde.py")
# or through conventional import kde
if __name__ == 'sway':
+
+ installation.add_additional_packages(_gfx_driver_packages)
+
# Install dependency profiles
if _gfx_driver_packages == 'nvidia':
- raise archinstall.lib.exceptions.HardwareIncompatibilityError("sway does not the prorpitery nvidia driver try using nouveau")
- else:
- installation.install_profile('wayland')
+ # NOTE: This is technically runnable with the --my-next-gpu-wont-be-nvidia option
+ raise archinstall.lib.exceptions.HardwareIncompatibilityError("Sway does not officially support the proprietary Nvidia driver, you may have to use nouveau.")
- # Install the application kde from the template under /applications/
- sway = archinstall.Application(installation, 'sway')
- sway.install()
+ # Install the application kde from the template under /applications/
+ sway = archinstall.Application(installation, 'sway')
+ sway.install()
diff --git a/profiles/xorg.py b/profiles/xorg.py
index 33356859..6ee72487 100644
--- a/profiles/xorg.py
+++ b/profiles/xorg.py
@@ -4,25 +4,6 @@ import archinstall, os
is_top_level_profile = True
-AVAILABLE_DRIVERS = {
- # Sub-dicts are layer-2 options to be selected
- # and lists are a list of packages to be installed
- 'AMD / ATI' : {
- 'amd' : ['xf86-video-amdgpu'],
- 'ati' : ['xf86-video-ati']
- },
- 'intel' : ['xf86-video-intel'],
- 'nvidia' : {
- 'open source' : ['xf86-video-nouveau'],
- 'proprietary' : ['nvidia']
- },
- 'mesa' : ['mesa'],
- 'fbdev' : ['xf86-video-fbdev'],
- 'vesa' : ['xf86-video-vesa'],
- 'vmware' : ['xf86-video-vmware']
-}
-
-
def _prep_function(*args, **kwargs):
"""
Magic function called by the importing installer
@@ -30,10 +11,8 @@ 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.
"""
- print('You need to select which graphics card you\'re using.')
- print('This in order to setup the required graphics drivers.')
- __builtins__['_gfx_driver_packages'] = archinstall.lib.gfx_drivers.select_driver(AVAILABLE_DRIVERS)
+ __builtins__['_gfx_driver_packages'] = archinstall.lib.gfx_drivers.select_driver()
# TODO: Add language section and/or merge it with the locale selected
# earlier in for instance guided.py installer.