Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples/guided.py
diff options
context:
space:
mode:
authorDylan Taylor <dylan@dylanmtaylor.com>2021-04-13 19:46:53 -0400
committerDylan Taylor <dylan@dylanmtaylor.com>2021-04-13 19:46:53 -0400
commite18b6d83d7c0c05cdc4e12a461a356e8a330c195 (patch)
tree9eac6d6919c7df1241753d1adcd286b2239250b1 /examples/guided.py
parent49ca26479095117f202bd7a3f95e8b93da02760e (diff)
parent2433a9ee76802fd2e8e71fcb31b01e8406d7aa48 (diff)
Merge branch 'master' into patch-4
Diffstat (limited to 'examples/guided.py')
-rw-r--r--examples/guided.py39
1 files changed, 30 insertions, 9 deletions
diff --git a/examples/guided.py b/examples/guided.py
index beb577c8..d47a949c 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -3,6 +3,10 @@ import archinstall
from archinstall.lib.hardware import hasUEFI
from archinstall.lib.profiles import Profile
+if hasUEFI() is False:
+ log("ArchInstall currently only supports machines booted with UEFI. MBR & GRUB support is coming in version 2.2.0!", fg="red", level=archinstall.LOG_LEVELS.Error)
+ exit(1)
+
def ask_user_questions():
"""
First, we'll ask the user for a bunch of user input.
@@ -171,7 +175,7 @@ def ask_user_questions():
else:
# 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'
+ archinstall.arguments['audio'] = None
# Additional packages (with some light weight error handling for invalid package names)
if not archinstall.arguments.get('packages', None):
@@ -273,38 +277,47 @@ def perform_installation(mountpoint):
# 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
# We need to wait for it before we continue since we opted in to use a custom mirror/region.
- installation.log(f'Waiting for automatic mirror selection has completed before using custom mirrors.')
- while 'dead' not in (status := archinstall.service_state('reflector')):
+ installation.log(f'Waiting for automatic mirror selection (reflector) to complete.', level=archinstall.LOG_LEVELS.Info)
+ while archinstall.service_state('reflector') not in ('dead', 'failed'):
time.sleep(1)
- archinstall.use_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors for the live medium
+ # Set mirrors used by pacstrap (outside of installation)
+ if archinstall.arguments.get('mirror-region', None):
+ archinstall.use_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors for the live medium
+
if installation.minimal_installation():
installation.set_hostname(archinstall.arguments['hostname'])
- installation.set_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors in the installation medium
+
+ # Configure the selected mirrors in the installation
+ if archinstall.arguments.get('mirror-region', None):
+ installation.set_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors in the installation medium
+
installation.set_keyboard_language(archinstall.arguments['keyboard-language'])
installation.add_bootloader()
# If user selected to copy the current ISO network configuration
# Perform a copy of the config
- if archinstall.arguments.get('nic', None) == 'Copy ISO network configuration to installation':
+ if archinstall.arguments.get('nic', {}) == 'Copy ISO network configuration to installation':
installation.copy_ISO_network_config(enable_services=True) # Sources the ISO network configuration to the install medium.
- elif archinstall.arguments.get('nic',{}).get('NetworkManager',False):
+ elif archinstall.arguments.get('nic', {}).get('NetworkManager',False):
installation.add_additional_packages("networkmanager")
installation.enable_service('NetworkManager.service')
# Otherwise, if a interface was selected, configure that interface
- elif archinstall.arguments.get('nic', None):
+ elif archinstall.arguments.get('nic', {}):
installation.configure_nic(**archinstall.arguments.get('nic', {}))
installation.enable_service('systemd-networkd')
installation.enable_service('systemd-resolved')
if archinstall.arguments.get('audio', None) != None:
- installation.log(f"The {archinstall.arguments.get('audio', None)} audio server will be used.", level=archinstall.LOG_LEVELS.Info)
+ installation.log(f"This audio server will be used: {archinstall.arguments.get('audio', None)}", level=archinstall.LOG_LEVELS.Info)
if archinstall.arguments.get('audio', None) == 'pipewire':
print('Installing pipewire ...')
installation.add_additional_packages(["pipewire", "pipewire-alsa", "pipewire-jack", "pipewire-media-session", "pipewire-pulse", "gst-plugin-pipewire", "libpulse"])
elif archinstall.arguments.get('audio', None) == 'pulseaudio':
print('Installing pulseaudio ...')
installation.add_additional_packages("pulseaudio")
+ else:
+ installation.log("No audio server will be installed.", level=archinstall.LOG_LEVELS.Info)
if archinstall.arguments.get('packages', None) and archinstall.arguments.get('packages', None)[0] != '':
installation.add_additional_packages(archinstall.arguments.get('packages', None))
@@ -324,6 +337,14 @@ def perform_installation(mountpoint):
if (root_pw := archinstall.arguments.get('!root-password', None)) and len(root_pw):
installation.user_set_pw('root', root_pw)
+ installation.log("For post-installation tips, see https://wiki.archlinux.org/index.php/Installation_guide#Post-installation", fg="yellow")
+ choice = input("Would you like to chroot into the newly created installation and perform post-installation configuration? [Y/n] ")
+ if choice.lower() in ("y", ""):
+ try:
+ installation.drop_to_shell()
+ except:
+ pass
ask_user_questions()
perform_installation_steps()
+