Merge remote-tracking branch 'dylanmtaylor/minimal-install-profile' into torxed-v2.2.0

This commit is contained in:
Dylan Taylor 2021-04-07 19:28:49 -04:00
commit 75008f3f0e
12 changed files with 47 additions and 2 deletions

View File

@ -177,6 +177,7 @@ class Profile(Script):
if hasattr(imported, '_prep_function'):
return True
return False
def has_post_install(self):
with open(self.path, 'r') as source:
source_data = source.read()
@ -193,6 +194,11 @@ class Profile(Script):
if hasattr(imported, '_post_install'):
return True
def is_top_level_profile(self):
with open(self.path, 'r') as source:
source_data = source.read()
return 'top_level_profile = True' in source_data
@property
def packages(self) -> list:
"""

View File

@ -1,6 +1,7 @@
import getpass, time, json, sys, signal, os
import archinstall
from archinstall.lib.hardware import hasUEFI
from archinstall.lib.profiles import Profile
"""
This signal-handler chain (and global variable)
@ -167,7 +168,7 @@ def ask_user_questions():
# Ask for archinstall-specific profiles (such as desktop environments etc)
if not archinstall.arguments.get('profile', None):
archinstall.arguments['profile'] = archinstall.select_profile(archinstall.list_profiles())
archinstall.arguments['profile'] = archinstall.select_profile(filter(lambda profile: (Profile(None, profile).is_top_level_profile()), archinstall.list_profiles()))
else:
archinstall.arguments['profile'] = archinstall.list_profiles()[archinstall.arguments['profile']]

View File

@ -2,6 +2,8 @@
import archinstall
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__ = ['nano', 'nemo', 'gpicview-gtk3', 'openssh', 'sshfs', 'htop', 'scrot', 'wget']

View File

@ -1,6 +1,8 @@
# A desktop environment using "Cinnamon"
import archinstall
is_top_level_profile = False
def _prep_function(*args, **kwargs):
"""
Magic function called by the importing installer

View File

@ -2,6 +2,8 @@
import archinstall, os
is_top_level_profile = True
def _prep_function(*args, **kwargs):
"""
Magic function called by the importing installer
@ -10,7 +12,7 @@ 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', 'xfce4', 'cinnamon', 'i3-gaps', 'i3-wm']
desktop = archinstall.generic_select(supported_desktops, 'Select your desired desktop environment: ')
# Temporarily store the selected desktop profile

View File

@ -2,6 +2,8 @@
import archinstall
is_top_level_profile = False
def _prep_function(*args, **kwargs):
"""
Magic function called by the importing installer

View File

@ -1,5 +1,7 @@
import archinstall, subprocess
is_top_level_profile = False
def _prep_function(*args, **kwargs):
"""
Magic function called by the importing installer

View File

@ -1,5 +1,7 @@
import archinstall, subprocess
is_top_level_profile = False
def _prep_function(*args, **kwargs):
"""
Magic function called by the importing installer

View File

@ -2,6 +2,8 @@
import archinstall, os
is_top_level_profile = False
# TODO: Remove hard dependency of bash (due to .bash_profile)
def _prep_function(*args, **kwargs):

20
profiles/minimal.py Normal file
View File

@ -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.
"""

View File

@ -1,6 +1,8 @@
# A desktop environment using "Xfce4"
is_top_level_profile = False
import archinstall
def _prep_function(*args, **kwargs):

View File

@ -2,6 +2,8 @@
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