Pulled in latest changes from torxed-v2.2.0
This commit is contained in:
commit
5852582bbf
|
|
@ -21,3 +21,5 @@ SAFETY_LOCK
|
||||||
**/**.target
|
**/**.target
|
||||||
**/**.qcow2
|
**/**.qcow2
|
||||||
**/test.py
|
**/test.py
|
||||||
|
**/archiso
|
||||||
|
/guided.py
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,8 @@ class Installer():
|
||||||
:type hostname: str, optional
|
:type hostname: str, optional
|
||||||
|
|
||||||
"""
|
"""
|
||||||
def __init__(self, target, *, base_packages='base base-devel linux linux-firmware'):
|
def __init__(self, target, *, base_packages='base base-devel linux linux-firmware', kernels='linux'):
|
||||||
|
base_packages = base_packages + kernels.replace(',', ' ')
|
||||||
self.target = target
|
self.target = target
|
||||||
self.init_time = time.strftime('%Y-%m-%d_%H-%M-%S')
|
self.init_time = time.strftime('%Y-%m-%d_%H-%M-%S')
|
||||||
self.milliseconds = int(str(time.time()).split('.')[1])
|
self.milliseconds = int(str(time.time()).split('.')[1])
|
||||||
|
|
@ -342,7 +343,7 @@ class Installer():
|
||||||
mkinit.write(f"BINARIES=({' '.join(BINARIES)})\n")
|
mkinit.write(f"BINARIES=({' '.join(BINARIES)})\n")
|
||||||
mkinit.write(f"FILES=({' '.join(FILES)})\n")
|
mkinit.write(f"FILES=({' '.join(FILES)})\n")
|
||||||
mkinit.write(f"HOOKS=({' '.join(HOOKS)})\n")
|
mkinit.write(f"HOOKS=({' '.join(HOOKS)})\n")
|
||||||
sys_command(f'/usr/bin/arch-chroot {self.target} mkinitcpio -p linux')
|
sys_command(f'/usr/bin/arch-chroot {self.target} mkinitcpio -P')
|
||||||
|
|
||||||
self.helper_flags['base'] = True
|
self.helper_flags['base'] = True
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -259,12 +259,20 @@ def generic_select(options, input_text="Select one of the above by index or abso
|
||||||
other than the options and their indexes. As an example:
|
other than the options and their indexes. As an example:
|
||||||
|
|
||||||
generic_select(["first", "second", "third option"])
|
generic_select(["first", "second", "third option"])
|
||||||
|
<<<<<<< HEAD
|
||||||
0: first
|
0: first
|
||||||
1: second
|
1: second
|
||||||
2: third option
|
2: third option
|
||||||
|
|
||||||
When the user has entered the option correctly,
|
When the user has entered the option correctly,
|
||||||
this function returns an item from list, a string, or None
|
this function returns an item from list, a string, or None
|
||||||
|
=======
|
||||||
|
1: first
|
||||||
|
2: second
|
||||||
|
3: third option
|
||||||
|
|
||||||
|
it will return the selected text.
|
||||||
|
>>>>>>> 831f5e4eaf66f6f1a2aed04932af064ce9314dd4
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Checking if options are different from `list` or `dict`
|
# Checking if options are different from `list` or `dict`
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import getpass, time, json, os
|
||||||
import archinstall
|
import archinstall
|
||||||
from archinstall.lib.hardware import hasUEFI
|
from archinstall.lib.hardware import hasUEFI
|
||||||
from archinstall.lib.profiles import Profile
|
from archinstall.lib.profiles import Profile
|
||||||
|
from archinstall.lib.user_interaction import generic_select
|
||||||
|
|
||||||
if archinstall.arguments.get('help'):
|
if archinstall.arguments.get('help'):
|
||||||
print("See `man archinstall` for help.")
|
print("See `man archinstall` for help.")
|
||||||
|
|
@ -186,7 +187,6 @@ def ask_user_questions():
|
||||||
|
|
||||||
# Ask about audio server selection if one is not already set
|
# Ask about audio server selection if one is not already set
|
||||||
if not archinstall.arguments.get('audio', None):
|
if not archinstall.arguments.get('audio', None):
|
||||||
|
|
||||||
# only ask for audio server selection on a desktop profile
|
# only ask for audio server selection on a desktop profile
|
||||||
if str(archinstall.arguments['profile']) == 'Profile(desktop)':
|
if str(archinstall.arguments['profile']) == 'Profile(desktop)':
|
||||||
archinstall.arguments['audio'] = archinstall.ask_for_audio_selection()
|
archinstall.arguments['audio'] = archinstall.ask_for_audio_selection()
|
||||||
|
|
@ -195,6 +195,15 @@ def ask_user_questions():
|
||||||
# we will not try to remove packages post-installation to not have audio, as that may cause multiple issues
|
# we will not try to remove packages post-installation to not have audio, as that may cause multiple issues
|
||||||
archinstall.arguments['audio'] = None
|
archinstall.arguments['audio'] = None
|
||||||
|
|
||||||
|
# Ask what kernel user wants:
|
||||||
|
if not archinstall.arguments.get("kernels", None):
|
||||||
|
archinstall.log(f"Here you can choose which kernel to use, leave blank for default which is 'linux'.")
|
||||||
|
|
||||||
|
if (kernel := generic_select(["linux", "linux-lts", "linux-zen", "continue"], "choose a kernel:")):
|
||||||
|
archinstall.arguments['kernels'] = kernel
|
||||||
|
else:
|
||||||
|
archinstall.arguments['kernels'] = 'linux'
|
||||||
|
|
||||||
# Additional packages (with some light weight error handling for invalid package names)
|
# Additional packages (with some light weight error handling for invalid package names)
|
||||||
while True:
|
while True:
|
||||||
if not archinstall.arguments.get('packages', None):
|
if not archinstall.arguments.get('packages', None):
|
||||||
|
|
@ -299,7 +308,7 @@ def perform_installation(mountpoint):
|
||||||
Only requirement is that the block devices are
|
Only requirement is that the block devices are
|
||||||
formatted and setup prior to entering this function.
|
formatted and setup prior to entering this function.
|
||||||
"""
|
"""
|
||||||
with archinstall.Installer(mountpoint) as installation:
|
with archinstall.Installer(mountpoint, kernels=archinstall.arguments.get('kernels', 'linux')) as installation:
|
||||||
## if len(mirrors):
|
## if len(mirrors):
|
||||||
# Certain services might be running that affects the system during installation.
|
# 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
|
# Currently, only one such service is "reflector.service" which updates /etc/pacman.d/mirrorlist
|
||||||
|
|
@ -380,4 +389,4 @@ def perform_installation(mountpoint):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
ask_user_questions()
|
ask_user_questions()
|
||||||
perform_installation_steps()
|
perform_installation_steps()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue