Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archinstall/lib/installer.py4
-rw-r--r--archinstall/lib/user_interaction.py4
-rw-r--r--examples/guided.py19
3 files changed, 16 insertions, 11 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 6af9837f..7d3364dd 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -39,8 +39,8 @@ class Installer():
:type hostname: str, optional
"""
- def __init__(self, target, *, base_packages=' base base-devel linux-firmware efibootmgr', kernel='linux'):
- base_packages = kernel + base_packages
+ def __init__(self, target, *, base_packages='base base-devel linux-firmware efibootmgr ', kernels='linux'):
+ base_packages = base_packages + kernels.replace(',', ' ')
self.target = target
self.init_time = time.strftime('%Y-%m-%d_%H-%M-%S')
self.milliseconds = int(str(time.time()).split('.')[1])
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index 822f63be..b93f88b3 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -220,6 +220,8 @@ def generic_select(options, input_text="Select one of the above by index or abso
1: first
2: second
3: third option
+
+ it will return the selected text.
"""
if type(options) == dict: options = list(options)
@@ -265,7 +267,7 @@ def select_disk(dict_o_disks):
elif drive.isdigit():
drive = int(drive)
if drive >= len(drives):
- raise DiskError(f'Selected option "{drive}" is out of range')
+ raise Dis1ror(f'Selected option "{drive}" is out of range')
drive = dict_o_disks[drives[drive]]
elif drive in dict_o_disks:
drive = dict_o_disks[drive]
diff --git a/examples/guided.py b/examples/guided.py
index 99c4bb6e..ddc4d06f 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -2,6 +2,7 @@ import getpass, time, json, os
import archinstall
from archinstall.lib.hardware import hasUEFI
from archinstall.lib.profiles import Profile
+from archinstall.lib.user_interaction import generic_select
if archinstall.arguments.get('help'):
print("See `man archinstall` for help.")
@@ -178,7 +179,6 @@ def ask_user_questions():
# Ask about audio server selection if one is not already set
if not archinstall.arguments.get('audio', None):
-
# only ask for audio server selection on a desktop profile
if str(archinstall.arguments['profile']) == 'Profile(desktop)':
archinstall.arguments['audio'] = archinstall.ask_for_audio_selection()
@@ -188,12 +188,15 @@ def ask_user_questions():
archinstall.arguments['audio'] = None
# Ask what kernel user wants:
- kernel = input("1. linux\n2. linux-lts\n3. linux-zen\nchoose a kernel of the following: ")
- try:
- archinstall.arguments['kernel'] = ['linux', 'linux-lts', 'linux-zen'][int(kernel) - 1]
- except:
- archinstall.log('invalid kernel selected. defaulting to \'linux\'.')
- archinstall.arguments['kernel'] = 'linux'
+ while True:
+ kernel = generic_select(["linux", "linux-lts", "linux-zen", "continue"], "choose a kernel:")
+ if (archinstall.arguments['kernels'] == None or archinstall.arguments['kernels'] == ""):
+ archinstall.arguments['kernels'] = kernel
+ else:
+ if (kernel == "continue"):
+ break
+ archinstall.arguments['kernels'] += "," + kernel
+
# Additional packages (with some light weight error handling for invalid package names)
@@ -300,7 +303,7 @@ def perform_installation(mountpoint):
Only requirement is that the block devices are
formatted and setup prior to entering this function.
"""
- with archinstall.Installer(mountpoint, kernel=archinstall.arguments['kernel']) as installation:
+ with archinstall.Installer(mountpoint, kernels=archinstall.arguments['kernels']) as installation:
## if len(mirrors):
# Certain services might be running that affects the system during installation.
# Currently, only one such service is "reflector.service" which updates /etc/pacman.d/mirrorlist