Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-04-09 17:01:41 +0000
committerGitHub <noreply@github.com>2021-04-09 17:01:41 +0000
commitb046f7e0e51b2de9eab747d16f38d3944be2dae8 (patch)
treeab3450309a6b745b5976a8e898081837478c4190
parent5543cb9eda975d1861052b70610c419e320379e0 (diff)
parent6a0b839bc8be05bce8630758526ec0bc122e91ce (diff)
Merge pull request #256 from dylanmtaylor/backport-patches
Merge cherry-picked patches for NetworkManager and PipeWire
-rw-r--r--archinstall/lib/user_interaction.py12
-rw-r--r--examples/guided.py25
2 files changed, 34 insertions, 3 deletions
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index 1f5924e4..b9bfe89c 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -139,15 +139,25 @@ def ask_for_a_timezone():
level=LOG_LEVELS.Warning,
fg='red'
)
+
+def ask_for_audio_selection():
+ audio = "pulseaudio" # Default for most desktop environments
+ pipewire_choice = input("Would you like to install pipewire instead of pulseaudio as the default audio server? [Y/n] ").lower()
+ if pipewire_choice in ("y", ""):
+ audio = "pipewire"
+
+ return audio
def ask_to_configure_network():
# Optionally configure one network interface.
#while 1:
# {MAC: Ifname}
- interfaces = {'ISO-CONFIG' : 'Copy ISO network configuration to installation', **list_interfaces()}
+ interfaces = {'ISO-CONFIG' : 'Copy ISO network configuration to installation','NetworkManager':'Use NetworkManager to control and manage your internet connection', **list_interfaces()}
nic = generic_select(interfaces.values(), "Select one network interface to configure (leave blank to skip): ")
if nic and nic != 'Copy ISO network configuration to installation':
+ if nic == 'Use NetworkManager to control and manage your internet connection':
+ return {'nic': nic,'NetworkManager':True}
mode = generic_select(['DHCP (auto detect)', 'IP (static)'], f"Select which mode to configure for {nic}: ")
if mode == 'IP (static)':
while 1:
diff --git a/examples/guided.py b/examples/guided.py
index 6feebd00..c7fecb5e 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -160,6 +160,17 @@ 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.")
@@ -271,14 +282,24 @@ def perform_installation(device, boot_partition, language, mirrors):
# 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))