Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/scripts
diff options
context:
space:
mode:
authorDaniel Girtler <blackrabbit256@gmail.com>2023-06-05 18:02:49 +1000
committerGitHub <noreply@github.com>2023-06-05 10:02:49 +0200
commit06eadb31d4f0bca0c8cb95b6a9eb62ddd2d7cff2 (patch)
tree07a7ed675d125703346fa343f1aa9e5e4129dd5f /archinstall/scripts
parent5276d95339368210e75791e2b88c1bf5aca4517b (diff)
Move locales and cleanup menu (#1814)
* Cleanup imports and unused code * Cleanup imports and unused code * Update build check * Keep deprecation exception * Simplify logging * Move locale into new sub-menu --------- Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Diffstat (limited to 'archinstall/scripts')
-rw-r--r--archinstall/scripts/guided.py17
-rw-r--r--archinstall/scripts/swiss.py16
2 files changed, 14 insertions, 19 deletions
diff --git a/archinstall/scripts/guided.py b/archinstall/scripts/guided.py
index 1aecc1cd..7f9b9fd6 100644
--- a/archinstall/scripts/guided.py
+++ b/archinstall/scripts/guided.py
@@ -5,6 +5,7 @@ from typing import Any, TYPE_CHECKING
import archinstall
from archinstall import info, debug
from archinstall import SysInfo
+from archinstall.lib import locale
from archinstall.lib import disk
from archinstall.lib.global_menu import GlobalMenu
from archinstall.default_profiles.applications.pipewire import PipewireProfile
@@ -42,14 +43,10 @@ def ask_user_questions():
global_menu.enable('archinstall-language')
- global_menu.enable('keyboard-layout')
-
# Set which region to download packages from during the installation
global_menu.enable('mirror_config')
- global_menu.enable('sys-language')
-
- global_menu.enable('sys-encoding')
+ global_menu.enable('locale_config')
global_menu.enable('disk_config', mandatory=True)
@@ -76,7 +73,7 @@ def ask_user_questions():
global_menu.enable('audio')
# Ask for preferred kernel:
- global_menu.enable('kernels')
+ global_menu.enable('kernels', mandatory=True)
global_menu.enable('packages')
@@ -114,9 +111,7 @@ def perform_installation(mountpoint: Path):
# Retrieve list of additional repositories and set boolean values appropriately
enable_testing = 'testing' in archinstall.arguments.get('additional-repositories', [])
enable_multilib = 'multilib' in archinstall.arguments.get('additional-repositories', [])
-
- locale = f"{archinstall.arguments.get('sys-language', 'en_US')} {archinstall.arguments.get('sys-encoding', 'UTF-8').upper()}"
-
+ locale_config: locale.LocaleConfiguration = archinstall.arguments['locale_config']
disk_encryption: disk.DiskEncryption = archinstall.arguments.get('disk_encryption', None)
with Installer(
@@ -147,7 +142,7 @@ def perform_installation(mountpoint: Path):
testing=enable_testing,
multilib=enable_multilib,
hostname=archinstall.arguments.get('hostname', 'archlinux'),
- locales=[locale]
+ locale_config=locale_config
)
if mirror_config := archinstall.arguments.get('mirror_config', None):
@@ -210,7 +205,7 @@ def perform_installation(mountpoint: Path):
# This step must be after profile installs to allow profiles_bck to install language pre-requisits.
# After which, this step will set the language both for console and x11 if x11 was installed for instance.
- installation.set_keyboard_language(archinstall.arguments['keyboard-layout'])
+ installation.set_keyboard_language(locale_config.kb_layout)
if profile_config := archinstall.arguments.get('profile_config', None):
profile_config.profile.post_install(installation)
diff --git a/archinstall/scripts/swiss.py b/archinstall/scripts/swiss.py
index 1998f073..375458a1 100644
--- a/archinstall/scripts/swiss.py
+++ b/archinstall/scripts/swiss.py
@@ -8,6 +8,7 @@ from archinstall import SysInfo, info, debug
from archinstall.lib import mirrors
from archinstall.lib import models
from archinstall.lib import disk
+from archinstall.lib import locale
from archinstall.lib.networking import check_mirror_reachable
from archinstall.lib.profile.profiles_handler import profile_handler
from archinstall.lib import menu
@@ -92,14 +93,14 @@ class SwissMainMenu(GlobalMenu):
match self._execution_mode:
case ExecutionMode.Full | ExecutionMode.Lineal:
options_list = [
- 'keyboard-layout', 'mirror_config', 'disk_config',
+ 'mirror_config', 'disk_config',
'disk_encryption', 'swap', 'bootloader', 'hostname', '!root-password',
'!users', 'profile_config', 'audio', 'kernels', 'packages', 'additional-repositories', 'nic',
'timezone', 'ntp'
]
if archinstall.arguments.get('advanced', False):
- options_list.extend(['sys-language', 'sys-encoding'])
+ options_list.extend(['locale_config'])
mandatory_list = ['disk_config', 'bootloader', 'hostname']
case ExecutionMode.Only_HD:
@@ -107,7 +108,7 @@ class SwissMainMenu(GlobalMenu):
mandatory_list = ['disk_config']
case ExecutionMode.Only_OS:
options_list = [
- 'keyboard-layout', 'mirror_config','bootloader', 'hostname',
+ 'mirror_config','bootloader', 'hostname',
'!root-password', '!users', 'profile_config', 'audio', 'kernels',
'packages', 'additional-repositories', 'nic', 'timezone', 'ntp'
]
@@ -115,7 +116,7 @@ class SwissMainMenu(GlobalMenu):
mandatory_list = ['hostname']
if archinstall.arguments.get('advanced', False):
- options_list += ['sys-language','sys-encoding']
+ options_list += ['locale_config']
case ExecutionMode.Minimal:
pass
case _:
@@ -176,8 +177,7 @@ def perform_installation(mountpoint: Path, exec_mode: ExecutionMode):
enable_testing = 'testing' in archinstall.arguments.get('additional-repositories', [])
enable_multilib = 'multilib' in archinstall.arguments.get('additional-repositories', [])
-
- locale = f"{archinstall.arguments.get('sys-language', 'en_US')} {archinstall.arguments.get('sys-encoding', 'UTF-8').upper()}"
+ locale_config: locale.LocaleConfiguration = archinstall.arguments['locale_config']
with Installer(
mountpoint,
@@ -206,7 +206,7 @@ def perform_installation(mountpoint: Path, exec_mode: ExecutionMode):
testing=enable_testing,
multilib=enable_multilib,
hostname=archinstall.arguments.get('hostname', 'archlinux'),
- locales=[locale]
+ locale_config=locale_config
)
if mirror_config := archinstall.arguments.get('mirror_config', None):
@@ -263,7 +263,7 @@ def perform_installation(mountpoint: Path, exec_mode: ExecutionMode):
# This step must be after profile installs to allow profiles_bck to install language pre-requisits.
# After which, this step will set the language both for console and x11 if x11 was installed for instance.
- installation.set_keyboard_language(archinstall.arguments['keyboard-layout'])
+ installation.set_keyboard_language(locale_config.kb_layout)
if profile_config := archinstall.arguments.get('profile_config', None):
profile_config.profile.post_install(installation)