index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-04-10 11:22:15 +0200 |
---|---|---|
committer | Anton Hvornum <anton@hvornum.se> | 2021-04-10 11:22:15 +0200 |
commit | 8429510736b0750510c4ac1d9f281755b195bb11 (patch) | |
tree | d82cdbb2af6545cf8eef80bf583fe507e588cb8e /examples | |
parent | 48e801e6fdbc1f74885a3541011d4cce5876ab21 (diff) | |
parent | f1b42216a7393e58a02f2e885293efe88304cada (diff) |
-rw-r--r-- | examples/guided.py | 39 |
diff --git a/examples/guided.py b/examples/guided.py index 79023012..beb577c8 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -162,18 +162,31 @@ def ask_user_questions(): ) exit(1) + # 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() + 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' + # Additional packages (with some light weight error handling for invalid package names) if not archinstall.arguments.get('packages', None): print("Packages not part of the desktop environment are not installed by default.") print("If you desire a web browser, such as firefox or chromium, you may specify it in the following prompt.") archinstall.arguments['packages'] = [package for package in input('Write additional packages to install (space separated, leave blank to skip): ').split(' ') if len(package)] - # Verify packages that were given - try: - archinstall.validate_package_list(archinstall.arguments['packages']) - except archinstall.RequirementError as e: - archinstall.log(e, fg='red') - exit(1) + if len(archinstall.arguments['packages']): + # Verify packages that were given + try: + archinstall.log(f"Verifying that additional packages exist (this might take a few seconds)") + archinstall.validate_package_list(archinstall.arguments['packages']) + except archinstall.RequirementError as e: + archinstall.log(e, fg='red') + exit(1) # Ask or Call the helper function that asks the user to optionally configure a network. if not archinstall.arguments.get('nic', None): @@ -275,14 +288,24 @@ def perform_installation(mountpoint): # Perform a copy of the config if archinstall.arguments.get('nic', None) == '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): + 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): 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) + 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") + if archinstall.arguments.get('packages', None) and archinstall.arguments.get('packages', None)[0] != '': installation.add_additional_packages(archinstall.arguments.get('packages', None)) |