index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | profiles/52-54-00-12-34-56.py | 2 | ||||
-rw-r--r-- | profiles/applications/awesome.py | 6 | ||||
-rw-r--r-- | profiles/applications/cinnamon.py | 2 | ||||
-rw-r--r-- | profiles/applications/deepin.py | 5 | ||||
-rw-r--r-- | profiles/applications/lxqt.py | 2 | ||||
-rw-r--r-- | profiles/applications/sway.py | 4 | ||||
-rw-r--r-- | profiles/applications/xfce4.py | 4 | ||||
-rw-r--r-- | profiles/deepin.py | 37 | ||||
-rw-r--r-- | profiles/sway.py | 3 | ||||
-rw-r--r-- | profiles/xorg.py | 76 |
diff --git a/profiles/52-54-00-12-34-56.py b/profiles/52-54-00-12-34-56.py index 679c6721..ed2c9d78 100644 --- a/profiles/52-54-00-12-34-56.py +++ b/profiles/52-54-00-12-34-56.py @@ -11,7 +11,7 @@ archinstall.sys_command(f'cryptsetup close /dev/mapper/luksloop', suppress_error harddrive = archinstall.all_disks()['/dev/sda'] disk_password = '1234' -with archinstall.Filesystem(harddrive, archinstall.GPT) as fs: +with archinstall.Filesystem(harddrive) as fs: # Use the entire disk instead of setting up partitions on your own fs.use_entire_disk('luks2') diff --git a/profiles/applications/awesome.py b/profiles/applications/awesome.py index 793ee52b..a63c707b 100644 --- a/profiles/applications/awesome.py +++ b/profiles/applications/awesome.py @@ -1,10 +1,10 @@ import archinstall +__packages__ = ["awesome", "xorg-xrandr", "xterm", "feh", "slock", "terminus-font", "gnu-free-fonts", "ttf-liberation", "xsel"] + installation.install_profile('xorg') -installation.add_additional_packages( - "awesome xorg-xrandr xterm feh slock terminus-font gnu-free-fonts ttf-liberation xsel" -) +installation.add_additional_packages(__packages__) with open(f'{installation.target}/etc/X11/xinit/xinitrc', 'r') as xinitrc: xinitrc_data = xinitrc.read() diff --git a/profiles/applications/cinnamon.py b/profiles/applications/cinnamon.py index de29aa09..0a1d9cc2 100644 --- a/profiles/applications/cinnamon.py +++ b/profiles/applications/cinnamon.py @@ -1,3 +1,3 @@ import archinstall -installation.add_additional_packages("cinnamon system-config-printer gnome-keyring gnome-terminal blueberry metacity lightdm lightdm-gtk-greeter")
\ No newline at end of file +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/lxqt.py b/profiles/applications/lxqt.py index 5ce875cc..2099f3fa 100644 --- a/profiles/applications/lxqt.py +++ b/profiles/applications/lxqt.py @@ -1,3 +1,3 @@ import archinstall -installation.add_additional_packages("lxqt breeze-icons oxygen-icons xdg-utils ttf-freefont leafpad slock archlinux-wallpaper sddm") +installation.add_additional_packages("lxqt breeze-icons oxygen-icons xdg-utils ttf-freefont leafpad slock sddm") diff --git a/profiles/applications/sway.py b/profiles/applications/sway.py index 56d7f318..59921aa0 100644 --- a/profiles/applications/sway.py +++ b/profiles/applications/sway.py @@ -1,3 +1,3 @@ import archinstall -packages = "sway swaylock swayidle waybar dmenu light grim slurp pavucontrol alacritty" -installation.add_additional_packages(packages) +__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 e8f659c2..9f4260da 100644 --- a/profiles/applications/xfce4.py +++ b/profiles/applications/xfce4.py @@ -1,3 +1,3 @@ import archinstall - -installation.add_additional_packages("xfce4 xfce4-goodies lightdm lightdm-gtk-greeter")
\ No newline at end of file +__packages__ = "xfce4 xfce4-goodies lightdm lightdm-gtk-greeter" +installation.add_additional_packages(__packages__)
\ No newline at end of file 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/sway.py b/profiles/sway.py index 5633cce2..53eb8c5a 100644 --- a/profiles/sway.py +++ b/profiles/sway.py @@ -11,6 +11,9 @@ 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() + return True # Ensures that this code only gets executed if executed diff --git a/profiles/xorg.py b/profiles/xorg.py index 130f3ed0..413a6308 100644 --- a/profiles/xorg.py +++ b/profiles/xorg.py @@ -2,79 +2,9 @@ import os from archinstall import generic_select, sys_command, RequirementError - +import archinstall 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 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 = 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 = generic_select(drivers, 'Select your graphics card driver: ', - allow_empty_input=False, options_output=False) - 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) - - selected_driver = options[selected_driver] - - if type(selected_driver) == dict: - driver_options = sorted(list(selected_driver)) - - driver_package_group = generic_select(driver_options, f'Which driver-type do you want for {initial_option}: ', - allow_empty_input=False) - driver_package_group = selected_driver[driver_package_group] - - return driver_package_group - - return selected_driver - - raise RequirementError("Selecting drivers require a least one profile to be given as an option.") - def _prep_function(*args, **kwargs): """ Magic function called by the importing installer @@ -82,10 +12,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. |