From de709d7c46e1b5fe1616fa42e021a683bce37fd1 Mon Sep 17 00:00:00 2001 From: Softer Date: Sat, 11 Apr 2026 04:21:15 +0300 Subject: [PATCH 1/3] Make network configuration mandatory with explicit "No network" option --- archinstall/lib/global_menu.py | 1 + archinstall/lib/models/network.py | 3 +++ archinstall/lib/network/network_handler.py | 2 ++ archinstall/lib/network/network_menu.py | 4 +++- archinstall/locales/base.pot | 3 +++ archinstall/locales/uk/LC_MESSAGES/base.po | 3 +++ 6 files changed, 15 insertions(+), 1 deletion(-) diff --git a/archinstall/lib/global_menu.py b/archinstall/lib/global_menu.py index cae51df2c2..b81194b900 100644 --- a/archinstall/lib/global_menu.py +++ b/archinstall/lib/global_menu.py @@ -134,6 +134,7 @@ def _get_menu_options(self) -> list[MenuItem]: action=select_network, value={}, preview_action=self._prev_network_config, + mandatory=True, key='network_config', ), MenuItem( diff --git a/archinstall/lib/models/network.py b/archinstall/lib/models/network.py index 71f3dca2b0..f19d1a71cd 100644 --- a/archinstall/lib/models/network.py +++ b/archinstall/lib/models/network.py @@ -12,6 +12,7 @@ class NicType(Enum): NM = 'nm' NM_IWD = 'nm_iwd' MANUAL = 'manual' + NONE = 'none' def display_msg(self) -> str: match self: @@ -23,6 +24,8 @@ def display_msg(self) -> str: return tr('Use Network Manager (iwd backend)') case NicType.MANUAL: return tr('Manual configuration') + case NicType.NONE: + return tr('No network') class _NicSerialization(TypedDict): diff --git a/archinstall/lib/network/network_handler.py b/archinstall/lib/network/network_handler.py index 135485847f..48b863fdfd 100644 --- a/archinstall/lib/network/network_handler.py +++ b/archinstall/lib/network/network_handler.py @@ -37,6 +37,8 @@ def install_network_config( installation.configure_nic(nic) installation.enable_service('systemd-networkd') installation.enable_service('systemd-resolved') + case NicType.NONE: + pass def _configure_nm_iwd(installation: Installer) -> None: diff --git a/archinstall/lib/network/network_menu.py b/archinstall/lib/network/network_menu.py index bcf546981a..1b0f745642 100644 --- a/archinstall/lib/network/network_menu.py +++ b/archinstall/lib/network/network_menu.py @@ -172,7 +172,7 @@ async def select_network(preset: NetworkConfiguration | None) -> NetworkConfigur """ items = [MenuItem(n.display_msg(), value=n) for n in NicType] - group = MenuItemGroup(items, sort_items=True) + group = MenuItemGroup(items, sort_items=False) if preset: group.set_selected_by_value(preset.type) @@ -205,5 +205,7 @@ async def select_network(preset: NetworkConfiguration | None) -> NetworkConfigur if nics: return NetworkConfiguration(NicType.MANUAL, nics) + case NicType.NONE: + return NetworkConfiguration(NicType.NONE) return preset diff --git a/archinstall/locales/base.pot b/archinstall/locales/base.pot index df0915c769..3bce4c9ccb 100644 --- a/archinstall/locales/base.pot +++ b/archinstall/locales/base.pot @@ -633,6 +633,9 @@ msgstr "" msgid "Manual configuration" msgstr "" +msgid "No network" +msgstr "" + msgid "Mark/Unmark a partition as compressed (btrfs only)" msgstr "" diff --git a/archinstall/locales/uk/LC_MESSAGES/base.po b/archinstall/locales/uk/LC_MESSAGES/base.po index b88fd2901e..9eeaa1db64 100644 --- a/archinstall/locales/uk/LC_MESSAGES/base.po +++ b/archinstall/locales/uk/LC_MESSAGES/base.po @@ -646,6 +646,9 @@ msgstr "Оберіть інтерфейс для додавання" msgid "Manual configuration" msgstr "Ручне налаштування" +msgid "No network" +msgstr "Без мережі" + msgid "Mark/Unmark a partition as compressed (btrfs only)" msgstr "Позначити/зняти позначку розділу як стисненого (лише btrfs)" From 14b5dcba0f8ae0d4c0d3ac11880a5f401edfba08 Mon Sep 17 00:00:00 2001 From: Softer Date: Sat, 11 Apr 2026 04:32:44 +0300 Subject: [PATCH 2/3] Add network configuration recommendation hint and disable sorting --- archinstall/lib/network/network_menu.py | 5 ++++- archinstall/locales/base.pot | 3 +++ archinstall/locales/uk/LC_MESSAGES/base.po | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/archinstall/lib/network/network_menu.py b/archinstall/lib/network/network_menu.py index 1b0f745642..ebc4ab7da5 100644 --- a/archinstall/lib/network/network_menu.py +++ b/archinstall/lib/network/network_menu.py @@ -177,9 +177,12 @@ async def select_network(preset: NetworkConfiguration | None) -> NetworkConfigur if preset: group.set_selected_by_value(preset.type) + header = tr('Choose network configuration') + '\n' + header += tr('Recommended: Network Manager for desktop, Manual for server') + '\n' + result = await Selection[NicType]( group, - header=tr('Choose network configuration'), + header=header, allow_reset=True, allow_skip=True, ).show() diff --git a/archinstall/locales/base.pot b/archinstall/locales/base.pot index 3bce4c9ccb..ad24c179c4 100644 --- a/archinstall/locales/base.pot +++ b/archinstall/locales/base.pot @@ -2032,6 +2032,9 @@ msgstr "" msgid "Choose network configuration" msgstr "" +msgid "Recommended: Network Manager for desktop, Manual for server" +msgstr "" + msgid "No packages found" msgstr "" diff --git a/archinstall/locales/uk/LC_MESSAGES/base.po b/archinstall/locales/uk/LC_MESSAGES/base.po index 9eeaa1db64..8181ac0901 100644 --- a/archinstall/locales/uk/LC_MESSAGES/base.po +++ b/archinstall/locales/uk/LC_MESSAGES/base.po @@ -1973,6 +1973,9 @@ msgstr "Оберіть інтерфейс" msgid "Choose network configuration" msgstr "Оберіть конфігурацію мережі" +msgid "Recommended: Network Manager for desktop, Manual for server" +msgstr "Рекомендовано: Network Manager для робочого столу, ручне налаштування для сервера" + msgid "No packages found" msgstr "Пакети не знайдено" From 3b275a7f95396b9a07b5cf88e229439d2bb663c3 Mon Sep 17 00:00:00 2001 From: Softer Date: Fri, 24 Apr 2026 09:32:04 +0300 Subject: [PATCH 3/3] Warn when network selection was skipped instead of making it mandatory Replace the mandatory network_config menu requirement with a yellow warning on the final confirmation screen, shown only when the user skipped the network menu entirely. Explicitly picking "No network configuration" is treated as a conscious choice and does not trigger the warning. - Drop mandatory=True from the network_config global menu item - Rename NicType.NONE menu label from "No network" to "No network configuration" (an installed system still has an NIC; only the install-time configuration is absent) - Add ConfigurationOutput.get_install_warnings() and render them in confirm_config when show_install_warnings=True - guided.py and minimal.py enable the warning on the confirm screen - Reuse the existing "No network configuration" msgid in .pot; add the warning string; update Ukrainian translations accordingly --- archinstall/lib/configuration.py | 22 +++++++++++++++++++++- archinstall/lib/global_menu.py | 1 - archinstall/lib/models/network.py | 2 +- archinstall/locales/base.pot | 8 +++++--- archinstall/locales/uk/LC_MESSAGES/base.po | 8 ++++---- archinstall/scripts/guided.py | 2 +- archinstall/scripts/minimal.py | 2 +- 7 files changed, 33 insertions(+), 12 deletions(-) diff --git a/archinstall/lib/configuration.py b/archinstall/lib/configuration.py index 39d39511a8..2a73330ec7 100644 --- a/archinstall/lib/configuration.py +++ b/archinstall/lib/configuration.py @@ -10,6 +10,7 @@ from archinstall.lib.crypt import encrypt from archinstall.lib.menu.helpers import Confirmation, Selection from archinstall.lib.menu.util import get_password, prompt_dir +from archinstall.lib.models.network import NetworkConfiguration from archinstall.lib.output import debug, logger, warn from archinstall.lib.translationhandler import tr from archinstall.tui.ui.menu_item import MenuItem, MenuItemGroup @@ -58,10 +59,13 @@ def write_debug(self) -> None: debug(' -- Chosen configuration --') debug(self.user_config_to_json()) - async def confirm_config(self) -> bool: + async def confirm_config(self, show_install_warnings: bool = False) -> bool: header = f'{tr("The specified configuration will be applied")}. ' header += tr('Would you like to continue?') + '\n' + if show_install_warnings: + header += self._render_install_warnings() + group = MenuItemGroup.yes_no() group.set_preview_for_all(lambda x: self.user_config_to_json()) @@ -79,6 +83,22 @@ async def confirm_config(self) -> bool: return True + def get_install_warnings(self) -> list[str]: + warnings: list[str] = [] + + if not isinstance(self._config.network_config, NetworkConfiguration): + warnings.append(tr('Warning: no network configuration selected. Network will need to be set up manually on the installed system.')) + + return warnings + + def _render_install_warnings(self) -> str: + warnings = self.get_install_warnings() + + if not warnings: + return '' + + return '\n' + '\n'.join(f'[yellow]{w}[/]' for w in warnings) + '\n' + def _is_valid_path(self, dest_path: Path) -> bool: dest_path_ok = dest_path.exists() and dest_path.is_dir() if not dest_path_ok: diff --git a/archinstall/lib/global_menu.py b/archinstall/lib/global_menu.py index fa711b39ad..2baef93d41 100644 --- a/archinstall/lib/global_menu.py +++ b/archinstall/lib/global_menu.py @@ -139,7 +139,6 @@ def _get_menu_options(self) -> list[MenuItem]: action=select_network, value={}, preview_action=self._prev_network_config, - mandatory=True, key='network_config', ), MenuItem( diff --git a/archinstall/lib/models/network.py b/archinstall/lib/models/network.py index f19d1a71cd..c227379917 100644 --- a/archinstall/lib/models/network.py +++ b/archinstall/lib/models/network.py @@ -25,7 +25,7 @@ def display_msg(self) -> str: case NicType.MANUAL: return tr('Manual configuration') case NicType.NONE: - return tr('No network') + return tr('No network configuration') class _NicSerialization(TypedDict): diff --git a/archinstall/locales/base.pot b/archinstall/locales/base.pot index d3b1676600..1c6ba2ee9b 100644 --- a/archinstall/locales/base.pot +++ b/archinstall/locales/base.pot @@ -633,9 +633,6 @@ msgstr "" msgid "Manual configuration" msgstr "" -msgid "No network" -msgstr "" - msgid "Mark/Unmark a partition as compressed (btrfs only)" msgstr "" @@ -2180,6 +2177,11 @@ msgstr "" msgid "Recommended: Network Manager for desktop, Manual for server" msgstr "" +msgid "" +"Warning: no network configuration selected. Network will need to be set up " +"manually on the installed system." +msgstr "" + msgid "No packages found" msgstr "" diff --git a/archinstall/locales/uk/LC_MESSAGES/base.po b/archinstall/locales/uk/LC_MESSAGES/base.po index 386a41f41e..033b1701ec 100644 --- a/archinstall/locales/uk/LC_MESSAGES/base.po +++ b/archinstall/locales/uk/LC_MESSAGES/base.po @@ -483,7 +483,7 @@ msgid "Define users with sudo privilege: " msgstr "Визначте користувачів із привілеєм sudo: " msgid "No network configuration" -msgstr "Відсутня конфігурація мережі" +msgstr "Без налаштування мережі" msgid "Set desired subvolumes on a btrfs partition" msgstr "Встановіть потрібні підтома на розділі btrfs" @@ -646,9 +646,6 @@ msgstr "Оберіть інтерфейс для додавання" msgid "Manual configuration" msgstr "Ручне налаштування" -msgid "No network" -msgstr "Без мережі" - msgid "Mark/Unmark a partition as compressed (btrfs only)" msgstr "Позначити/зняти позначку розділу як стисненого (лише btrfs)" @@ -2121,6 +2118,9 @@ msgstr "Оберіть конфігурацію мережі" msgid "Recommended: Network Manager for desktop, Manual for server" msgstr "Рекомендовано: Network Manager для робочого столу, ручне налаштування для сервера" +msgid "Warning: no network configuration selected. Network will need to be set up manually on the installed system." +msgstr "Попередження: конфігурацію мережі не обрано. Мережу доведеться налаштувати вручну на встановленій системі." + msgid "No packages found" msgstr "Пакети не знайдено" diff --git a/archinstall/scripts/guided.py b/archinstall/scripts/guided.py index 3413372253..5cc0340800 100644 --- a/archinstall/scripts/guided.py +++ b/archinstall/scripts/guided.py @@ -216,7 +216,7 @@ def main(arch_config_handler: ArchConfigHandler | None = None) -> None: if not arch_config_handler.args.silent: aborted = False - res: bool = tui.run(config.confirm_config) + res: bool = tui.run(lambda: config.confirm_config(show_install_warnings=True)) if not res: debug('Installation aborted') diff --git a/archinstall/scripts/minimal.py b/archinstall/scripts/minimal.py index 4e89714260..681d4266b0 100644 --- a/archinstall/scripts/minimal.py +++ b/archinstall/scripts/minimal.py @@ -77,7 +77,7 @@ async def main(arch_config_handler: ArchConfigHandler | None = None) -> None: if not arch_config_handler.args.silent: aborted = False - res: bool = tui.run(config.confirm_config) + res: bool = tui.run(lambda: config.confirm_config(show_install_warnings=True)) if not res: debug('Installation aborted')