Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
authorSecondThundeR <awayfromgalaxy@gmail.com>2021-04-28 09:41:47 +0300
committerSecondThundeR <awayfromgalaxy@gmail.com>2021-04-28 09:41:47 +0300
commit6cfaf30718c3c0281553a7afd890fcfca342f2bc (patch)
tree98fdd32107e298cba8a6883687a5fcc4f2374d45 /archinstall/lib
parent932517e20d92a1e69c258aa58f387246248eaff7 (diff)
Update kernel select
Move select to separate function Remove 'continue' option Add hardened kernel as option
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/user_interaction.py23
1 files changed, 23 insertions, 0 deletions
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.")