Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/__init__.py')
-rw-r--r--archinstall/__init__.py42
1 files changed, 24 insertions, 18 deletions
diff --git a/archinstall/__init__.py b/archinstall/__init__.py
index f3620648..7edeaa80 100644
--- a/archinstall/__init__.py
+++ b/archinstall/__init__.py
@@ -1,7 +1,4 @@
"""Arch Linux installer - guided, templates etc."""
-import urllib.error
-import urllib.parse
-import urllib.request
from argparse import ArgumentParser
from .lib.disk import *
@@ -13,6 +10,7 @@ from .lib.locale_helpers import *
from .lib.luks import *
from .lib.mirrors import *
from .lib.models.network_configuration import NetworkConfigurationHandler
+from .lib.models.users import User
from .lib.networking import *
from .lib.output import *
from .lib.models.dataclasses import (
@@ -45,9 +43,14 @@ from .lib.menu.selection_menu import (
from .lib.translation import Translation, DeferredTranslation
from .lib.plugins import plugins, load_plugin # This initiates the plugin loading ceremony
from .lib.configuration import *
+from .lib.udev import udevadm_info
+from .lib.hsm import (
+ get_fido2_devices,
+ fido2_enroll
+)
parser = ArgumentParser()
-__version__ = "2.4.2"
+__version__ = "2.5.0"
storage['__version__'] = __version__
# add the custome _ as a builtin, it can now be used anywhere in the
@@ -55,6 +58,10 @@ storage['__version__'] = __version__
DeferredTranslation.install()
+def set_unicode_font():
+ SysCommand('setfont UniCyr_8x16')
+
+
def define_arguments():
"""
Define which explicit arguments do we allow.
@@ -145,22 +152,13 @@ def get_arguments() -> Dict[str, Any]:
# preprocess the json files.
# TODO Expand the url access to the other JSON file arguments ?
if args.config is not None:
- try:
- # First, let's check if this is a URL scheme instead of a filename
- parsed_url = urllib.parse.urlparse(args.config)
+ if not json_stream_to_structure('--config', args.config, config):
+ exit(1)
- if not parsed_url.scheme: # The Profile was not a direct match on a remote URL, it must be a local file.
- if not json_stream_to_structure('--config',args.config,config):
- exit(1)
- else: # Attempt to load the configuration from the URL.
- with urllib.request.urlopen(urllib.request.Request(args.config, headers={'User-Agent': 'ArchInstall'})) as response:
- config.update(json.loads(response.read()))
- except Exception as e:
- raise ValueError(f"Could not load --config because: {e}")
+ if args.creds is not None:
+ if not json_stream_to_structure('--creds', args.creds, config):
+ exit(1)
- if args.creds is not None:
- if not json_stream_to_structure('--creds',args.creds,config):
- exit(1)
# load the parameters. first the known, then the unknowns
config.update(vars(args))
config.update(parse_unspecified_argument_list(unknowns))
@@ -211,6 +209,11 @@ def load_config():
handler = NetworkConfigurationHandler()
handler.parse_arguments(arguments.get('nic'))
arguments['nic'] = handler.configuration
+ if arguments.get('!users', None) is not None or arguments.get('!superusers', None) is not None:
+ users = arguments.get('!users', None)
+ superusers = arguments.get('!superusers', None)
+ arguments['!users'] = User.parse_arguments(users, superusers)
+
def post_process_arguments(arguments):
storage['arguments'] = arguments
@@ -243,6 +246,9 @@ def post_process_arguments(arguments):
load_config()
+# to ensure that cyrillic characters work in the installer
+# set_unicode_font()
+
define_arguments()
arguments = get_arguments()
post_process_arguments(arguments)