index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-04-20 12:57:14 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-20 12:57:14 +0000 |
commit | f5ef751d53d8bb2c7d180166c196349c86057138 (patch) | |
tree | a72efaad83cecc010fa81447d28ecd7247bc6b39 /profiles | |
parent | e32dbfbd108e9b8598e148a0873d20384c573034 (diff) | |
parent | 2b7face25222c580ebf733942d13a83469f766e5 (diff) |
-rw-r--r-- | profiles/applications/awesome.py | 6 | ||||
-rw-r--r-- | profiles/applications/budgie.py | 4 | ||||
-rw-r--r-- | profiles/applications/cinnamon.py | 3 | ||||
-rw-r--r-- | profiles/applications/deepin.py | 5 | ||||
-rw-r--r-- | profiles/applications/gnome.py | 4 | ||||
-rw-r--r-- | profiles/applications/i3-gaps.py | 2 | ||||
-rw-r--r-- | profiles/applications/i3-wm.py | 2 | ||||
-rw-r--r-- | profiles/applications/lxqt.py | 3 | ||||
-rw-r--r-- | profiles/applications/mate.py | 3 | ||||
-rw-r--r-- | profiles/applications/sway.py | 3 | ||||
-rw-r--r-- | profiles/applications/xfce4.py | 5 | ||||
-rw-r--r-- | profiles/awesome.py | 10 | ||||
-rw-r--r-- | profiles/budgie.py | 56 | ||||
-rw-r--r-- | profiles/cinnamon.py | 2 | ||||
-rw-r--r-- | profiles/deepin.py | 37 | ||||
-rw-r--r-- | profiles/desktop.py | 22 | ||||
-rw-r--r-- | profiles/gnome.py | 2 | ||||
-rw-r--r-- | profiles/i3-gaps.py | 2 | ||||
-rw-r--r-- | profiles/i3-wm.py | 2 | ||||
-rw-r--r-- | profiles/i3.py | 63 | ||||
-rw-r--r-- | profiles/kde.py | 12 | ||||
-rw-r--r-- | profiles/lxqt.py | 35 | ||||
-rw-r--r-- | profiles/mate.py | 34 | ||||
-rw-r--r-- | profiles/minimal.py | 20 | ||||
-rw-r--r-- | profiles/sway.py | 22 | ||||
-rw-r--r-- | profiles/xfce4.py | 2 | ||||
-rw-r--r-- | profiles/xorg.py | 87 |
diff --git a/profiles/applications/awesome.py b/profiles/applications/awesome.py index b8d779c0..a63c707b 100644 --- a/profiles/applications/awesome.py +++ b/profiles/applications/awesome.py @@ -6,7 +6,7 @@ installation.install_profile('xorg') installation.add_additional_packages(__packages__) -with open(f'{installation.mountpoint}/etc/X11/xinit/xinitrc', 'r') as xinitrc: +with open(f'{installation.target}/etc/X11/xinit/xinitrc', 'r') as xinitrc: xinitrc_data = xinitrc.read() for line in xinitrc_data.split('\n'): @@ -20,5 +20,5 @@ for line in xinitrc_data.split('\n'): xinitrc_data += '\n' xinitrc_data += 'exec awesome\n' -with open(f'{installation.mountpoint}/etc/X11/xinit/xinitrc', 'w') as xinitrc: - xinitrc.write(xinitrc_data)
\ No newline at end of file +with open(f'{installation.target}/etc/X11/xinit/xinitrc', 'w') as xinitrc: + xinitrc.write(xinitrc_data) diff --git a/profiles/applications/budgie.py b/profiles/applications/budgie.py new file mode 100644 index 00000000..ccec4e14 --- /dev/null +++ b/profiles/applications/budgie.py @@ -0,0 +1,4 @@ +import archinstall + +# "It is recommended also to install the gnome group, which contains applications required for the standard GNOME experience." - Arch Wiki +installation.add_additional_packages("budgie-desktop lightdm lightdm-gtk-greeter gnome")
\ No newline at end of file diff --git a/profiles/applications/cinnamon.py b/profiles/applications/cinnamon.py index af1cbee2..0a1d9cc2 100644 --- a/profiles/applications/cinnamon.py +++ b/profiles/applications/cinnamon.py @@ -1,4 +1,3 @@ import archinstall -installation.add_additional_packages("cinnamon system-config-printer gnome-keyring gnome-terminal blueberry metacity lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings") -# We'll create a cinnamon-minimal later, but for now, we'll avoid issues by giving more than we need. +installation.add_additional_packages("cinnamon system-config-printer gnome-keyring gnome-terminal blueberry metacity lightdm lightdm-gtk-greeter") diff --git a/profiles/applications/deepin.py b/profiles/applications/deepin.py new file mode 100644 index 00000000..0db1572d --- /dev/null +++ b/profiles/applications/deepin.py @@ -0,0 +1,5 @@ +import archinstall + +packages = "deepin deepin-terminal deepin-editor" + +installation.add_additional_packages(packages) diff --git a/profiles/applications/gnome.py b/profiles/applications/gnome.py index 1f2a20a1..e26290dc 100644 --- a/profiles/applications/gnome.py +++ b/profiles/applications/gnome.py @@ -1,4 +1,4 @@ import archinstall -installation.add_additional_packages("gnome gnome-extra gdm") # We'll create a gnome-minimal later, but for now, we'll avoid issues by giving more than we need. -# Note: gdm should be part of the gnome group, but adding it here for clarity
\ No newline at end of file +installation.add_additional_packages("gnome gnome-tweaks gdm") +# Note: gdm should be part of the gnome group, but adding it here for clarity diff --git a/profiles/applications/i3-gaps.py b/profiles/applications/i3-gaps.py index 4dd95989..4daed7ad 100644 --- a/profiles/applications/i3-gaps.py +++ b/profiles/applications/i3-gaps.py @@ -1,2 +1,2 @@ import archinstall -installation.add_additional_packages("i3lock i3status i3blocks i3-gaps")
\ No newline at end of file +installation.add_additional_packages("i3-gaps")
\ No newline at end of file diff --git a/profiles/applications/i3-wm.py b/profiles/applications/i3-wm.py index 8662497d..e7838a64 100644 --- a/profiles/applications/i3-wm.py +++ b/profiles/applications/i3-wm.py @@ -1,2 +1,2 @@ import archinstall -installation.add_additional_packages("i3lock i3status i3blocks i3-wm")
\ No newline at end of file +installation.add_additional_packages("i3-wm")
\ No newline at end of file diff --git a/profiles/applications/lxqt.py b/profiles/applications/lxqt.py new file mode 100644 index 00000000..5ce875cc --- /dev/null +++ b/profiles/applications/lxqt.py @@ -0,0 +1,3 @@ +import archinstall + +installation.add_additional_packages("lxqt breeze-icons oxygen-icons xdg-utils ttf-freefont leafpad slock archlinux-wallpaper sddm") diff --git a/profiles/applications/mate.py b/profiles/applications/mate.py new file mode 100644 index 00000000..24d6be47 --- /dev/null +++ b/profiles/applications/mate.py @@ -0,0 +1,3 @@ +import archinstall + +installation.add_additional_packages("mate mate-extra lightdm lightdm-gtk-greeter")
\ No newline at end of file diff --git a/profiles/applications/sway.py b/profiles/applications/sway.py new file mode 100644 index 00000000..59921aa0 --- /dev/null +++ b/profiles/applications/sway.py @@ -0,0 +1,3 @@ +import archinstall +__packages__ = "sway swaylock swayidle waybar dmenu light grim slurp pavucontrol alacritty" +installation.add_additional_packages(__packages__) diff --git a/profiles/applications/xfce4.py b/profiles/applications/xfce4.py index 6d6f8f7c..9f4260da 100644 --- a/profiles/applications/xfce4.py +++ b/profiles/applications/xfce4.py @@ -1,4 +1,3 @@ import archinstall - -installation.add_additional_packages("xfce4 xfce4-goodies lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings") -# We'll create a xfce4-minimal later, but for now, we'll avoid issues by giving more than we need. +__packages__ = "xfce4 xfce4-goodies lightdm lightdm-gtk-greeter" +installation.add_additional_packages(__packages__)
\ No newline at end of file diff --git a/profiles/awesome.py b/profiles/awesome.py index 8004fc62..cbd52a3c 100644 --- a/profiles/awesome.py +++ b/profiles/awesome.py @@ -2,7 +2,11 @@ import archinstall -__packages__ = ['nano', 'nemo', 'gpicview-gtk3', 'chromium', 'openssh', 'sshfs', 'htop', 'scrot', 'wget'] +is_top_level_profile = False + +# 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__ = ['nemo', 'gpicview-gtk3', 'scrot'] def _prep_function(*args, **kwargs): """ @@ -35,13 +39,13 @@ if __name__ == 'awesome': alacritty.install() # TODO: Copy a full configuration to ~/.config/awesome/rc.lua instead. - with open(f'{installation.mountpoint}/etc/xdg/awesome/rc.lua', 'r') as fh: + with open(f'{installation.target}/etc/xdg/awesome/rc.lua', 'r') as fh: awesome_lua = fh.read() ## Replace xterm with alacritty for a smoother experience. awesome_lua = awesome_lua.replace('"xterm"', '"alacritty"') - with open(f'{installation.mountpoint}/etc/xdg/awesome/rc.lua', 'w') as fh: + with open(f'{installation.target}/etc/xdg/awesome/rc.lua', 'w') as fh: fh.write(awesome_lua) ## TODO: Configure the right-click-menu to contain the above packages that were installed. (as a user config) diff --git a/profiles/budgie.py b/profiles/budgie.py new file mode 100644 index 00000000..1f224209 --- /dev/null +++ b/profiles/budgie.py @@ -0,0 +1,56 @@ +<<<<<<< HEAD:profiles/cinnamon.py +# A desktop environment using "Cinnamon" +import archinstall + +======= +# A desktop environment using "budgie" + +import archinstall + +>>>>>>> master:profiles/budgie.py +is_top_level_profile = False + +def _prep_function(*args, **kwargs): + """ + Magic function called by the importing installer + before continuing any further. It also avoids executing any + other code in this stage. So it's a safe way to ask the user + for more input before any other installer steps start. + """ + +<<<<<<< HEAD:profiles/cinnamon.py + # Cinnamon requires a functioning Xorg installation. +======= + # budgie requires a functioning Xorg installation. +>>>>>>> master:profiles/budgie.py + profile = archinstall.Profile(None, 'xorg') + with profile.load_instructions(namespace='xorg.py') as imported: + if hasattr(imported, '_prep_function'): + return imported._prep_function() + else: + print('Deprecated (??): xorg profile has no _prep_function() anymore') + +# Ensures that this code only gets executed if executed +<<<<<<< HEAD:profiles/cinnamon.py +# through importlib.util.spec_from_file_location("cinnamon", "/somewhere/cinnamon.py") +# or through conventional import cinnamon +if __name__ == 'cinnamon': + # Install dependency profiles + installation.install_profile('xorg') + + # Install the application cinnamon from the template under /applications/ + cinnamon = archinstall.Application(installation, 'cinnamon') + cinnamon.install() +======= +# through importlib.util.spec_from_file_location("budgie", "/somewhere/budgie.py") +# or through conventional import budgie +if __name__ == 'budgie': + # Install dependency profiles + installation.install_profile('xorg') + + # Install the application budgie from the template under /applications/ + budgie = archinstall.Application(installation, 'budgie') + budgie.install() +>>>>>>> master:profiles/budgie.py + + installation.enable_service('lightdm') # Light Display Manager diff --git a/profiles/cinnamon.py b/profiles/cinnamon.py index dac38bd3..91a59811 100644 --- a/profiles/cinnamon.py +++ b/profiles/cinnamon.py @@ -2,6 +2,8 @@ import archinstall +is_top_level_profile = False + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer diff --git a/profiles/deepin.py b/profiles/deepin.py new file mode 100644 index 00000000..52bcdde5 --- /dev/null +++ b/profiles/deepin.py @@ -0,0 +1,37 @@ +# A desktop environment using "Deepin". + +import archinstall, os + +is_top_level_profile = False + + +def _prep_function(*args, **kwargs): + """ + Magic function called by the importing installer + before continuing any further. It also avoids executing any + other code in this stage. So it's a safe way to ask the user + for more input before any other installer steps start. + """ + + # Deepin requires a functioning Xorg installation. + profile = archinstall.Profile(None, 'xorg') + with profile.load_instructions(namespace='xorg.py') as imported: + if hasattr(imported, '_prep_function'): + return imported._prep_function() + else: + print('Deprecated (??): xorg profile has no _prep_function() anymore') + + +# Ensures that this code only gets executed if executed +# through importlib.util.spec_from_file_location("deepin", "/somewhere/deepin.py") +# or through conventional import deepin +if __name__ == 'deepin': + # Install dependency profiles + installation.install_profile('xorg') + + # Install the application deepin from the template under /applications/ + deepin = archinstall.Application(installation, 'deepin') + deepin.install() + + # Enable autostart of Deepin for all users + installation.enable_service('lightdm') diff --git a/profiles/desktop.py b/profiles/desktop.py index 0c89e543..dce2e18b 100644 --- a/profiles/desktop.py +++ b/profiles/desktop.py @@ -2,6 +2,12 @@ import archinstall, os +is_top_level_profile = True + +# 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__ = ['nano', 'vim', 'openssh', 'htop', 'wget', 'iwd', 'wireless_tools', 'wpa_supplicant', 'smartmontools', 'xdg-utils'] + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer @@ -10,11 +16,11 @@ def _prep_function(*args, **kwargs): for more input before any other installer steps start. """ - supported_desktops = ['gnome', 'kde', 'awesome', 'xfce4', 'cinnamon'] + supported_desktops = ['gnome', 'kde', 'awesome', 'sway', 'cinnamon', 'xfce4', 'lxqt', 'i3', 'budgie', 'mate', 'deepin'] desktop = archinstall.generic_select(supported_desktops, 'Select your desired desktop environment: ') - - # Temporarly store the selected desktop profile - # in a session-safe location, since this module will get re-loaded + + # Temporarily store the selected desktop profile + # in a session-safe location, since this module will get reloaded # the next time it gets executed. archinstall.storage['_desktop_profile'] = desktop @@ -29,7 +35,7 @@ def _prep_function(*args, **kwargs): if __name__ == 'desktop': """ This "profile" is a meta-profile. - There are no specific desktop-steps, it simply routes + There are no desktop-specific steps, it simply routes the installer to whichever desktop environment/window manager was chosen. Maybe in the future, a network manager or similar things *could* be added here. @@ -37,9 +43,13 @@ if __name__ == 'desktop': it trying to be a turn-key desktop distribution. There are plenty of desktop-turn-key-solutions based on Arch Linux, - this is therefor just a helper to get started + this is therefore just a helper to get started """ + + # Install common packages for all desktop environments + installation.add_additional_packages(__packages__) # TODO: Remove magic variable 'installation' and place it # in archinstall.storage or archinstall.session/archinstall.installation installation.install_profile(archinstall.storage['_desktop_profile']) + diff --git a/profiles/gnome.py b/profiles/gnome.py index b37679de..c75cafee 100644 --- a/profiles/gnome.py +++ b/profiles/gnome.py @@ -2,6 +2,8 @@ import archinstall +is_top_level_profile = False + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer diff --git a/profiles/i3-gaps.py b/profiles/i3-gaps.py index 50511dce..e900117a 100644 --- a/profiles/i3-gaps.py +++ b/profiles/i3-gaps.py @@ -1,5 +1,7 @@ import archinstall, subprocess +is_top_level_profile = False + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer diff --git a/profiles/i3-wm.py b/profiles/i3-wm.py index cd6cbc81..a2449e39 100644 --- a/profiles/i3-wm.py +++ b/profiles/i3-wm.py @@ -1,5 +1,7 @@ import archinstall, subprocess +is_top_level_profile = False + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer diff --git a/profiles/i3.py b/profiles/i3.py new file mode 100644 index 00000000..67028b2d --- /dev/null +++ b/profiles/i3.py @@ -0,0 +1,63 @@ +# Common package for i3, lets user select which i3 configuration they want. + +import archinstall, os + +is_top_level_profile = False + +# 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__ = ['i3lock', 'i3status', 'i3blocks', 'xterm'] + +def _prep_function(*args, **kwargs): + """ + Magic function called by the importing installer + before continuing any further. It also avoids executing any + other code in this stage. So it's a safe way to ask the user + for more input before any other installer steps start. + """ + + supported_configurations = ['i3-wm', 'i3-gaps'] + desktop = archinstall.generic_select(supported_configurations, 'Select your desired configuration: ') + + # Temporarily store the selected desktop profile + # in a session-safe location, since this module will get reloaded + # the next time it gets executed. + archinstall.storage['_i3_configuration'] = desktop + + # i3 requires a functioning Xorg installation. + profile = archinstall.Profile(None, 'xorg') + with profile.load_instructions(namespace='xorg.py') as imported: + if hasattr(imported, '_prep_function'): + return imported._prep_function() + else: + print('Deprecated (??): xorg profile has no _prep_function() anymore') + +if __name__ == 'i3': + """ + This "profile" is a meta-profile. + There are no desktop-specific steps, it simply routes + the installer to whichever desktop environment/window manager was chosen. + + Maybe in the future, a network manager or similar things *could* be added here. + We should honor that Arch Linux does not officially endorse a desktop-setup, nor is + it trying to be a turn-key desktop distribution. + + There are plenty of desktop-turn-key-solutions based on Arch Linux, + this is therefore just a helper to get started + """ + + # Install common packages for all i3 configurations + installation.add_additional_packages(__packages__) + + # Install dependency profiles + installation.install_profile('xorg') + + # gaps is installed by deafult so we are overriding it here + installation.add_additional_packages("lightdm-gtk-greeter lightdm") + + # Auto start lightdm for all users + installation.enable_service('lightdm') + + # install the i3 group now + i3 = archinstall.Application(installation, archinstall.storage['_i3_configuration']) + i3.install() diff --git a/profiles/kde.py b/profiles/kde.py index 0207ed22..6654dfa7 100644 --- a/profiles/kde.py +++ b/profiles/kde.py @@ -1,7 +1,9 @@ -# A desktop environement using "KDE". +# A desktop environment using "KDE". import archinstall, os +is_top_level_profile = False + # TODO: Remove hard dependency of bash (due to .bash_profile) def _prep_function(*args, **kwargs): @@ -20,14 +22,14 @@ def _prep_function(*args, **kwargs): else: print('Deprecated (??): xorg profile has no _prep_function() anymore') +""" def _post_install(*args, **kwargs): if "nvidia" in _gfx_driver_packages: print("Plasma Wayland has known compatibility issues with the proprietary Nvidia driver") - choice = input("Would you like plasma-wayland to be the default session [Y/n] ").lower() - if choice == "y": - installation.arch_chroot("mv /usr/share/xsessions/plasma.desktop /usr/share/xsessions/plasmax11.desktop") - installation.arch_chroot("mv /usr/share/wayland-sessions/plasmawayland.desktop /usr/share/wayland-sessions/plasma.desktop") + print("After booting, you can choose between Wayland and Xorg using the drop-down menu") return True +""" + # 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 diff --git a/profiles/lxqt.py b/profiles/lxqt.py new file mode 100644 index 00000000..871488ee --- /dev/null +++ b/profiles/lxqt.py @@ -0,0 +1,35 @@ + +# A desktop environment using "LXQt" + +import archinstall + +is_top_level_profile = False + +def _prep_function(*args, **kwargs): + """ + Magic function called by the importing installer + before continuing any further. It also avoids executing any + other code in this stage. So it's a safe way to ask the user + for more input before any other installer steps start. + """ + + # LXQt requires a functional xorg installation. + profile = archinstall.Profile(None, 'xorg') + with profile.load_instructions(namespace='xorg.py') as imported: + if hasattr(imported, '_prep_function'): + return imported._prep_function() + else: + print('Deprecated (??): xorg profile has no _prep_function() anymore') + +# Ensures that this code only gets executed if executed +# through importlib.util.spec_from_file_location("lxqt", "/somewhere/lxqt.py") +# or through conventional import lxqt +if __name__ == 'lxqt': + # Install dependency profiles + installation.install_profile('xorg') + + # Install the application xfce4 from the template under /applications/ + xfce = archinstall.Application(installation, 'lxqt') + xfce.install() + + installation.enable_service('sddm') # SDDM Display Manager diff --git a/profiles/mate.py b/profiles/mate.py new file mode 100644 index 00000000..b4c697b1 --- /dev/null +++ b/profiles/mate.py @@ -0,0 +1,34 @@ +# A desktop environment using "MATE" + +import archinstall + +is_top_level_profile = False + +def _prep_function(*args, **kwargs): + """ + Magic function called by the importing installer + before continuing any further. It also avoids executing any + other code in this stage. So it's a safe way to ask the user + for more input before any other installer steps start. + """ + + # MATE requires a functional xorg installation. + profile = archinstall.Profile(None, 'xorg') + with profile.load_instructions(namespace='xorg.py') as imported: + if hasattr(imported, '_prep_function'): + return imported._prep_function() + else: + print('Deprecated (??): xorg profile has no _prep_function() anymore') + +# Ensures that this code only gets executed if executed +# through importlib.util.spec_from_file_location("mate", "/somewhere/mate.py") +# or through conventional import mate +if __name__ == 'mate': + # Install dependency profiles + installation.install_profile('xorg') + + # Install the application mate from the template under /applications/ + mate = archinstall.Application(installation, 'mate') + mate.install() + + installation.enable_service('lightdm') # Light Display Manager diff --git a/profiles/minimal.py b/profiles/minimal.py new file mode 100644 index 00000000..79821a89 --- /dev/null +++ b/profiles/minimal.py @@ -0,0 +1,20 @@ +# Used to do a minimal install + +import archinstall, os + +is_top_level_profile = True + +def _prep_function(*args, **kwargs): + """ + Magic function called by the importing installer + before continuing any further. For minimal install, + we don't need to do anything special here, but it + needs to exist and return True. + """ + return True # Do nothing and just return True + +if __name__ == 'minimal': + """ + This "profile" is a meta-profile. + It is used for a custom minimal installation, without any desktop-specific packages. + """ diff --git a/profiles/sway.py b/profiles/sway.py new file mode 100644 index 00000000..5633cce2 --- /dev/null +++ b/profiles/sway.py @@ -0,0 +1,22 @@ +# A desktop environment using "Sway" + +import archinstall + +is_top_level_profile = False + +def _prep_function(*args, **kwargs): + """ + Magic function called by the importing installer + before continuing any further. It also avoids executing any + other code in this stage. So it's a safe way to ask the user + for more input before any other installer steps start. + """ + return True + +# Ensures that this code only gets executed if executed +# through importlib.util.spec_from_file_location("sway", "/somewhere/sway.py") +# or through conventional import sway +if __name__ == 'sway': + # Install the application sway from the template under /applications/ + sway = archinstall.Application(installation, 'sway') + sway.install() diff --git a/profiles/xfce4.py b/profiles/xfce4.py index 36c9958a..fee8c37a 100644 --- a/profiles/xfce4.py +++ b/profiles/xfce4.py @@ -3,6 +3,8 @@ import archinstall +is_top_level_profile = False + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer diff --git a/profiles/xorg.py b/profiles/xorg.py index 1282b8a5..42597a37 100644 --- a/profiles/xorg.py +++ b/profiles/xorg.py @@ -2,88 +2,7 @@ import archinstall, os -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): - """ - Some what convoluted function, which's job is simple. - Select a graphics driver from a pre-defined set of popular options. - - (The template xorg is for beginner users, not advanced, and should - there for appeal to the general public first and edge cases later) - """ - drivers = sorted(list(options)) - - if len(drivers) >= 1: - for index, driver in enumerate(drivers): - print(f"{index}: {driver}") - - print(' -- The above list are supported graphic card drivers. --') - print(' -- You need to select (and read about) which one you need. --') - - lspci = archinstall.sys_command(f'/usr/bin/lspci') - for line in lspci.trace_log.split(b'\r\n'): - if b' vga ' in line.lower(): - if b'nvidia' in line.lower(): - print(' ** nvidia card detected, suggested driver: nvidia **') - elif b'amd' in line.lower(): - print(' ** AMD card detected, suggested driver: AMD / ATI **') - - selected_driver = input('Select your graphics card driver: ') - initial_option = selected_driver - - # Disabled search for now, only a few profiles exist anyway - # - #print(' -- You can enter ? or help to search for more drivers --') - #if selected_driver.lower() in ('?', 'help'): - # filter_string = input('Search for layout containing (example: "sv-"): ') - # new_options = search_keyboard_layout(filter_string) - # return select_language(new_options) - if selected_driver.isdigit() and (pos := int(selected_driver)) <= len(drivers)-1: - selected_driver = options[drivers[pos]] - elif selected_driver in options: - selected_driver = options[options.index(selected_driver)] - elif len(selected_driver) == 0: - raise archinstall.RequirementError("At least one graphics driver is needed to support a graphical environment. Please restart the installer and try again.") - else: - raise archinstall.RequirementError("Selected driver does not exist.") - - if type(selected_driver) == dict: - driver_options = sorted(list(selected_driver)) - for index, driver_package_group in enumerate(driver_options): - print(f"{index}: {driver_package_group}") - - selected_driver_package_group = input(f'Which driver-type do you want for {initial_option}: ') - if selected_driver_package_group.isdigit() and (pos := int(selected_driver_package_group)) <= len(driver_options)-1: - selected_driver_package_group = selected_driver[driver_options[pos]] - elif selected_driver_package_group in selected_driver: - selected_driver_package_group = selected_driver[selected_driver.index(selected_driver_package_group)] - elif len(selected_driver_package_group) == 0: - raise archinstall.RequirementError(f"At least one driver package is required for a graphical environment using {selected_driver}. Please restart the installer and try again.") - else: - raise archinstall.RequirementError(f"Selected driver-type does not exist for {initial_option}.") - - return selected_driver_package_group - - return selected_driver - - raise archinstall.RequirementError("Selecting drivers require a least one profile to be given as an option.") +is_top_level_profile = True def _prep_function(*args, **kwargs): """ @@ -92,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'] = select_driver(AVAILABLE_DRIVERS) + __builtins__['_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. |