From 6cfaf30718c3c0281553a7afd890fcfca342f2bc Mon Sep 17 00:00:00 2001 From: SecondThundeR Date: Wed, 28 Apr 2021 09:41:47 +0300 Subject: Update kernel select Move select to separate function Remove 'continue' option Add hardened kernel as option --- archinstall/lib/user_interaction.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'archinstall/lib') diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py index cd848136..8d5c9994 100644 --- a/archinstall/lib/user_interaction.py +++ b/archinstall/lib/user_interaction.py @@ -506,3 +506,26 @@ def select_driver(options=AVAILABLE_GFX_DRIVERS): return selected_driver raise RequirementError("Selecting drivers require a least one profile to be given as an option.") + +def select_kernel(options): + """ + Asks the user to select a kernel for system. + + :param options: A `list` with kernel options + :type options: list + + :return: The string as a selected kernel + :rtype: string + """ + + DEFAULT_KERNEL = "linux" + + kernels = sorted(list(options)) + + if kernels: + selected_kernels = generic_select(kernels, "Choose a kernel: ") + if not selected_kernels: + return DEFAULT_KERNEL + return selected_kernels + + raise RequirementError("Selecting kernels require a least one kernel to be given as an option.") -- cgit v1.2.3-70-g09d2 From 66197f08de883bcedcb1b596e4591db82290c322 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Wed, 28 Apr 2021 09:10:29 +0200 Subject: Added a default description --- archinstall/lib/user_interaction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'archinstall/lib') diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py index 8d5c9994..d08d7e25 100644 --- a/archinstall/lib/user_interaction.py +++ b/archinstall/lib/user_interaction.py @@ -523,7 +523,7 @@ def select_kernel(options): kernels = sorted(list(options)) if kernels: - selected_kernels = generic_select(kernels, "Choose a kernel: ") + selected_kernels = generic_select(kernels, f"Choose which kernel to use (leave blank for default: {DEFAULT_KERNEL}): ") if not selected_kernels: return DEFAULT_KERNEL return selected_kernels -- cgit v1.2.3-70-g09d2