Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDaniel <blackrabbit256@gmail.com>2022-03-01 01:57:57 +1100
committerGitHub <noreply@github.com>2022-02-28 15:57:57 +0100
commit537b9cab037aecfd18edef156dd3ea55072918e9 (patch)
treefe56cd4af527e816d831b220c6672c1dcfc2958f /examples
parentfa87d85708331ad45f28906217f94937bae474fe (diff)
Rework network config (#1001)
* Update network configuration * Rework network configuration * Update documentation * Fix flake8 * Update Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com> Co-authored-by: Anton Hvornum <anton.feeds@gmail.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/config-sample.json5
-rw-r--r--examples/custom-command-sample.json2
-rw-r--r--examples/guided.py18
-rw-r--r--examples/swiss.py17
4 files changed, 13 insertions, 29 deletions
diff --git a/examples/config-sample.json b/examples/config-sample.json
index 18644860..dc8693a7 100644
--- a/examples/config-sample.json
+++ b/examples/config-sample.json
@@ -15,8 +15,7 @@
}
},
"nic": {
- "NetworkManager": true,
- "nic": "Use NetworkManager (necessary to configure internet graphically in GNOME and KDE)"
+ "type": "NM"
},
"ntp": true,
"packages": [],
@@ -26,4 +25,4 @@
"sys-encoding": "utf-8",
"sys-language": "en_US",
"timezone": "UTC"
-} \ No newline at end of file
+}
diff --git a/examples/custom-command-sample.json b/examples/custom-command-sample.json
index 9c39e15f..8d8d611d 100644
--- a/examples/custom-command-sample.json
+++ b/examples/custom-command-sample.json
@@ -13,7 +13,7 @@
"keyboard-layout": "us",
"mirror-region": "Worldwide",
"nic": {
- "NetworkManager": true
+ "type": "NM"
},
"ntp": true,
"packages": ["docker", "git", "wget", "zsh"],
diff --git a/examples/guided.py b/examples/guided.py
index 23fd45a6..d2447341 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -145,11 +145,11 @@ def perform_installation(mountpoint):
# 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
-
+
# Retrieve list of additional repositories and set boolean values appropriately
enable_testing = 'testing' in archinstall.arguments.get('additional-repositories', None)
enable_multilib = 'multilib' in archinstall.arguments.get('additional-repositories', None)
-
+
if installation.minimal_installation(testing=enable_testing, multilib=enable_multilib):
installation.set_locale(archinstall.arguments['sys-language'], archinstall.arguments['sys-encoding'].upper())
installation.set_hostname(archinstall.arguments['hostname'])
@@ -163,16 +163,10 @@ def perform_installation(mountpoint):
# If user selected to copy the current ISO network configuration
# Perform a copy of the config
- if archinstall.arguments.get('nic', {}).get('type', '') == 'iso_config':
- 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', {}):
- installation.configure_nic(**archinstall.arguments.get('nic', {}))
- installation.enable_service('systemd-networkd')
- installation.enable_service('systemd-resolved')
+ network_config = archinstall.arguments.get('nic', None)
+
+ if network_config:
+ network_config.config_installer(installation)
if archinstall.arguments.get('audio', None) is not None:
installation.log(f"This audio server will be used: {archinstall.arguments.get('audio', None)}", level=logging.INFO)
diff --git a/examples/swiss.py b/examples/swiss.py
index f60ff60f..4eb51a05 100644
--- a/examples/swiss.py
+++ b/examples/swiss.py
@@ -393,19 +393,10 @@ def os_setup(installation):
if archinstall.arguments['swap']:
installation.setup_swap('zram')
- # If user selected to copy the current ISO network configuration
- # Perform a copy of the config
- if archinstall.arguments.get('nic', {}).get('type', '') == 'iso_config':
- 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', {}):
- installation.configure_nic(**archinstall.arguments.get('nic', {}))
- installation.enable_service('systemd-networkd')
- installation.enable_service('systemd-resolved')
+ network_config = archinstall.arguments.get('nic', None)
+
+ if network_config:
+ network_config.config_installer(installation)
if archinstall.arguments.get('audio', None) is not None:
installation.log(f"This audio server will be used: {archinstall.arguments.get('audio', None)}",level=logging.INFO)