Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAggam Rahamim <agamclass@gmail.com>2021-04-16 12:01:20 +0300
committerAggam Rahamim <agamclass@gmail.com>2021-04-16 12:01:20 +0300
commit459f161cf0432393443272ac5b1aa5fc0cd7fd16 (patch)
tree26166d3f3752d87c0ed3c4d66f348c2f786db554
parent2433a9ee76802fd2e8e71fcb31b01e8406d7aa48 (diff)
added option to choose kernel
-rw-r--r--.gitignore2
-rw-r--r--archinstall/lib/installer.py3
-rw-r--r--examples/guided.py11
3 files changed, 13 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index dc75bed8..246880ba 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,4 +20,4 @@ SAFETY_LOCK
**/**.network
**/**.target
**/**.qcow2
-**/test.py
+**/test.py \ No newline at end of file
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 758033a7..d21040fa 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -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])
diff --git a/examples/guided.py b/examples/guided.py
index d47a949c..a927d86b 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -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):
@@ -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