Merge pull request #219 from dylanmtaylor/minimal-install-profile
Add minimal profile and implement idea of 'top-level' profiles
This commit is contained in:
commit
b2b9ac2d40
|
|
@ -177,6 +177,7 @@ class Profile(Script):
|
||||||
if hasattr(imported, '_prep_function'):
|
if hasattr(imported, '_prep_function'):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def has_post_install(self):
|
def has_post_install(self):
|
||||||
with open(self.path, 'r') as source:
|
with open(self.path, 'r') as source:
|
||||||
source_data = source.read()
|
source_data = source.read()
|
||||||
|
|
@ -193,6 +194,11 @@ class Profile(Script):
|
||||||
if hasattr(imported, '_post_install'):
|
if hasattr(imported, '_post_install'):
|
||||||
return True
|
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
|
@property
|
||||||
def packages(self) -> list:
|
def packages(self) -> list:
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import getpass, time, json, sys, signal, os
|
import getpass, time, json, sys, signal, os
|
||||||
import archinstall
|
import archinstall
|
||||||
from archinstall.lib.hardware import hasUEFI
|
from archinstall.lib.hardware import hasUEFI
|
||||||
|
from archinstall.lib.profiles import Profile
|
||||||
|
|
||||||
"""
|
"""
|
||||||
This signal-handler chain (and global variable)
|
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)
|
# Ask for archinstall-specific profiles (such as desktop environments etc)
|
||||||
if not archinstall.arguments.get('profile', None):
|
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:
|
else:
|
||||||
archinstall.arguments['profile'] = archinstall.list_profiles()[archinstall.arguments['profile']]
|
archinstall.arguments['profile'] = archinstall.list_profiles()[archinstall.arguments['profile']]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
import archinstall
|
import archinstall
|
||||||
|
|
||||||
|
is_top_level_profile = False
|
||||||
|
|
||||||
# New way of defining packages for a profile, which is iterable and can be used out side
|
# 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".
|
# of the profile to get a list of "what packages will be installed".
|
||||||
__packages__ = ['nano', 'nemo', 'gpicview-gtk3', 'openssh', 'sshfs', 'htop', 'scrot', 'wget']
|
__packages__ = ['nano', 'nemo', 'gpicview-gtk3', 'openssh', 'sshfs', 'htop', 'scrot', 'wget']
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
# A desktop environment using "Cinnamon"
|
# A desktop environment using "Cinnamon"
|
||||||
import archinstall
|
import archinstall
|
||||||
|
|
||||||
|
is_top_level_profile = False
|
||||||
|
|
||||||
def _prep_function(*args, **kwargs):
|
def _prep_function(*args, **kwargs):
|
||||||
"""
|
"""
|
||||||
Magic function called by the importing installer
|
Magic function called by the importing installer
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
import archinstall, os
|
import archinstall, os
|
||||||
|
|
||||||
|
is_top_level_profile = True
|
||||||
|
|
||||||
def _prep_function(*args, **kwargs):
|
def _prep_function(*args, **kwargs):
|
||||||
"""
|
"""
|
||||||
Magic function called by the importing installer
|
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.
|
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: ')
|
desktop = archinstall.generic_select(supported_desktops, 'Select your desired desktop environment: ')
|
||||||
|
|
||||||
# Temporarily store the selected desktop profile
|
# Temporarily store the selected desktop profile
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
import archinstall
|
import archinstall
|
||||||
|
|
||||||
|
is_top_level_profile = False
|
||||||
|
|
||||||
def _prep_function(*args, **kwargs):
|
def _prep_function(*args, **kwargs):
|
||||||
"""
|
"""
|
||||||
Magic function called by the importing installer
|
Magic function called by the importing installer
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import archinstall, subprocess
|
import archinstall, subprocess
|
||||||
|
|
||||||
|
is_top_level_profile = False
|
||||||
|
|
||||||
def _prep_function(*args, **kwargs):
|
def _prep_function(*args, **kwargs):
|
||||||
"""
|
"""
|
||||||
Magic function called by the importing installer
|
Magic function called by the importing installer
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import archinstall, subprocess
|
import archinstall, subprocess
|
||||||
|
|
||||||
|
is_top_level_profile = False
|
||||||
|
|
||||||
def _prep_function(*args, **kwargs):
|
def _prep_function(*args, **kwargs):
|
||||||
"""
|
"""
|
||||||
Magic function called by the importing installer
|
Magic function called by the importing installer
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
import archinstall, os
|
import archinstall, os
|
||||||
|
|
||||||
|
is_top_level_profile = False
|
||||||
|
|
||||||
# TODO: Remove hard dependency of bash (due to .bash_profile)
|
# TODO: Remove hard dependency of bash (due to .bash_profile)
|
||||||
|
|
||||||
def _prep_function(*args, **kwargs):
|
def _prep_function(*args, **kwargs):
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
"""
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
|
|
||||||
# A desktop environment using "Xfce4"
|
# A desktop environment using "Xfce4"
|
||||||
|
|
||||||
|
is_top_level_profile = False
|
||||||
|
|
||||||
import archinstall
|
import archinstall
|
||||||
|
|
||||||
def _prep_function(*args, **kwargs):
|
def _prep_function(*args, **kwargs):
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
import archinstall, os
|
import archinstall, os
|
||||||
|
|
||||||
|
is_top_level_profile = True
|
||||||
|
|
||||||
AVAILABLE_DRIVERS = {
|
AVAILABLE_DRIVERS = {
|
||||||
# Sub-dicts are layer-2 options to be selected
|
# Sub-dicts are layer-2 options to be selected
|
||||||
# and lists are a list of packages to be installed
|
# and lists are a list of packages to be installed
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue