Skip to content

Commit

Permalink
added option to choose kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
AggamR committed Apr 16, 2021
1 parent 2433a9e commit 459f161
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ SAFETY_LOCK
**/**.network
**/**.target
**/**.qcow2
**/test.py
**/test.py
3 changes: 2 additions & 1 deletion archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class Installer():
:type hostname: str, optional
"""
def __init__(self, target, *, base_packages='base base-devel linux linux-firmware efibootmgr'):
def __init__(self, target, *, base_packages='base base-devel linux-firmware efibootmgr', kernel='linux'):
base_packages += ' '+kernel
self.target = target
self.init_time = time.strftime('%Y-%m-%d_%H-%M-%S')
self.milliseconds = int(str(time.time()).split('.')[1])
Expand Down
11 changes: 10 additions & 1 deletion examples/guided.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,15 @@ def ask_user_questions():
# packages installed by a profile may depend on audio and something may get installed anyways, not much we can do about that.
# we will not try to remove packages post-installation to not have audio, as that may cause multiple issues
archinstall.arguments['audio'] = None

# Ask what kernel user wants:
kernel = input("choose a kernel:\n1. linux\n2. linux-lts\n3. linux-zen")
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'


# Additional packages (with some light weight error handling for invalid package names)
if not archinstall.arguments.get('packages', None):
Expand Down Expand Up @@ -272,7 +281,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) as installation:
with archinstall.Installer(mountpoint, kernel=archinstall.arguments['kernel']) 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
Expand Down

0 comments on commit 459f161

Please sign in to comment.