From 2aed8c6ad5a8ab31accb6d618bca4798591cf415 Mon Sep 17 00:00:00 2001 From: Yash Tripathi Date: Mon, 24 May 2021 19:23:08 +0530 Subject: removed builtins usage and added gfx_package key in config --- examples/guided.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/guided.py b/examples/guided.py index 73fded4e..1f67a460 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -5,7 +5,7 @@ import time import archinstall from archinstall.lib.general import run_custom_user_commands -from archinstall.lib.hardware import has_uefi +from archinstall.lib.hardware import has_uefi, AVAILABLE_GFX_DRIVERS from archinstall.lib.networking import check_mirror_reachable from archinstall.lib.profiles import Profile @@ -450,5 +450,8 @@ else: archinstall.arguments['mirror-region'] = {selected_region: archinstall.list_mirrors()[selected_region]} archinstall.arguments['sys-language'] = archinstall.arguments.get('sys-language', 'en_US') archinstall.arguments['sys-encoding'] = archinstall.arguments.get('sys-encoding', 'utf-8') - + if archinstall.arguments.get('gfx_driver', None) is not None: + archinstall.storage['gfx_driver_packages'] = AVAILABLE_GFX_DRIVERS.get(archinstall.arguments.get('gfx_driver', None), None) + + perform_installation_steps() -- cgit v1.2.3-70-g09d2 From 26a33000d8bbd99fd4c9c0b9f5103fd012f8769a Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 27 May 2021 07:55:22 -0400 Subject: Add descriptions for top-level profiles --- examples/guided.py | 2 -- profiles/desktop.py | 2 ++ profiles/minimal.py | 2 ++ profiles/server.py | 2 ++ profiles/xorg.py | 2 ++ 5 files changed, 8 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/guided.py b/examples/guided.py index 1f67a460..a43fc9b1 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -61,7 +61,6 @@ def ask_user_questions(): if not archinstall.arguments.get('sys-encoding', None): archinstall.arguments['sys-encoding'] = 'utf-8' - # Ask which harddrive/block-device we will install to if archinstall.arguments.get('harddrive', None): archinstall.arguments['harddrive'] = archinstall.BlockDevice(archinstall.arguments['harddrive']) @@ -453,5 +452,4 @@ else: if archinstall.arguments.get('gfx_driver', None) is not None: archinstall.storage['gfx_driver_packages'] = AVAILABLE_GFX_DRIVERS.get(archinstall.arguments.get('gfx_driver', None), None) - perform_installation_steps() diff --git a/profiles/desktop.py b/profiles/desktop.py index 631c7f76..73df9256 100644 --- a/profiles/desktop.py +++ b/profiles/desktop.py @@ -4,6 +4,8 @@ import archinstall is_top_level_profile = True +__description__ = 'Provides a selection of desktop environments and tiling window managers, e.g. gnome, kde, sway' + # New way of defining packages for a profile, which is iterable and can be used out side # of the profile to get a list of "what packages will be installed". __packages__ = [ diff --git a/profiles/minimal.py b/profiles/minimal.py index 13cfd05a..c7df517c 100644 --- a/profiles/minimal.py +++ b/profiles/minimal.py @@ -2,6 +2,8 @@ is_top_level_profile = True +__description__ = 'A very basic installation that allows you to customize Arch Linux as you see fit.' + def _prep_function(*args, **kwargs): """ diff --git a/profiles/server.py b/profiles/server.py index 704c8efe..79aa9481 100644 --- a/profiles/server.py +++ b/profiles/server.py @@ -6,6 +6,8 @@ import archinstall is_top_level_profile = True +__description__ = 'Provides a selection of various server packages to install and enable, e.g. httpd, nginx, mariadb' + available_servers = [ "cockpit", "docker", diff --git a/profiles/xorg.py b/profiles/xorg.py index 9006a430..ce13664d 100644 --- a/profiles/xorg.py +++ b/profiles/xorg.py @@ -4,6 +4,8 @@ import archinstall is_top_level_profile = True +__description__ = 'Installs a minimal system as well as xorg and graphics drivers.' + __packages__ = [ 'dkms', 'xorg-server', -- cgit v1.2.3-70-g09d2 From fd4b2c97fb6f4953b0ecc7f43096b49979c038d1 Mon Sep 17 00:00:00 2001 From: Yash Tripathi Date: Thu, 27 May 2021 21:29:14 +0530 Subject: Update custom-command-sample.json --- examples/custom-command-sample.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'examples') diff --git a/examples/custom-command-sample.json b/examples/custom-command-sample.json index 5e7a70e3..f38bcca1 100644 --- a/examples/custom-command-sample.json +++ b/examples/custom-command-sample.json @@ -8,6 +8,7 @@ ], "!encryption-password": "supersecret", "filesystem": "btrfs", + "gfx_driver": "VMware / VirtualBox (open-source)", "harddrive": { "path": "/dev/nvme0n1" }, @@ -16,14 +17,11 @@ "linux" ], "keyboard-language": "us", - "mirror-region": { - "Worldwide": { - "https://mirror.rackspace.com/archlinux/$repo/os/$arch": true - } - }, + "mirror-region": "Worldwide", "nic": { "NetworkManager": true }, + "ntp": true, "packages": ["docker", "git", "wget", "zsh"], "profile": "gnome", "services": ["docker"], @@ -32,6 +30,8 @@ "!password": "devel" } }, + "sys-encoding": "utf-8", + "sys-language": "en_US", "timezone": "US/Eastern", "users": {} } -- cgit v1.2.3-70-g09d2 From eb8f45952531394875e5911b89ae013fe61f9171 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Thu, 27 May 2021 22:24:09 -0400 Subject: Write user configuration JSON to a file in logs directory --- examples/guided.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/guided.py b/examples/guided.py index a43fc9b1..bad9b625 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -258,7 +258,10 @@ def perform_installation_steps(): print() print('This is your chosen configuration:') archinstall.log("-- Guided template chosen (with below config) --", level=logging.DEBUG) - archinstall.log(json.dumps(archinstall.arguments, indent=4, sort_keys=True, cls=archinstall.JSON), level=logging.INFO) + user_configuration = json.dumps(archinstall.arguments, indent=4, sort_keys=True, cls=archinstall.JSON) + archinstall.log(user_configuration, level=logging.INFO) + with open("/var/log/archinstall/user_configuration.json") as config_file: + config_file.write(user_configuration) print() if not archinstall.arguments.get('silent'): -- cgit v1.2.3-70-g09d2 From 04e58f98fac6a3834d3ce60f3a13f0bb980b165e Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 27 May 2021 22:50:38 -0400 Subject: Needed to set file mode to write. --- examples/guided.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/guided.py b/examples/guided.py index bad9b625..320bcfd8 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -260,7 +260,7 @@ def perform_installation_steps(): archinstall.log("-- Guided template chosen (with below config) --", level=logging.DEBUG) user_configuration = json.dumps(archinstall.arguments, indent=4, sort_keys=True, cls=archinstall.JSON) archinstall.log(user_configuration, level=logging.INFO) - with open("/var/log/archinstall/user_configuration.json") as config_file: + with open("/var/log/archinstall/user_configuration.json", "w") as config_file: config_file.write(user_configuration) print() -- cgit v1.2.3-70-g09d2 From c3c55f59928a6b07739114aa4e25713051bbbcca Mon Sep 17 00:00:00 2001 From: Yash Tripathi Date: Fri, 28 May 2021 08:44:28 +0530 Subject: added support for setting mirror-region to a dict or a string in config --- examples/guided.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/guided.py b/examples/guided.py index 320bcfd8..b26887a5 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -448,8 +448,11 @@ else: else: archinstall.arguments['profile'] = None if archinstall.arguments.get('mirror-region', None) is not None: - selected_region = archinstall.arguments.get('mirror-region', None) - archinstall.arguments['mirror-region'] = {selected_region: archinstall.list_mirrors()[selected_region]} + if type(archinstall.arguments.get('mirror-region', None)) is dict: + archinstall.arguments['mirror-region'] = archinstall.arguments.get('mirror-region', None) + else: + selected_region = archinstall.arguments.get('mirror-region', None) + archinstall.arguments['mirror-region'] = {selected_region: archinstall.list_mirrors()[selected_region]} archinstall.arguments['sys-language'] = archinstall.arguments.get('sys-language', 'en_US') archinstall.arguments['sys-encoding'] = archinstall.arguments.get('sys-encoding', 'utf-8') if archinstall.arguments.get('gfx_driver', None) is not None: -- cgit v1.2.3-70-g09d2 From 3aee3611c4081272c622a86f09bbd1c8c382b098 Mon Sep 17 00:00:00 2001 From: Yash Tripathi Date: Fri, 28 May 2021 08:50:27 +0530 Subject: added support for setting profile to a dict or a string in config --- examples/guided.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/guided.py b/examples/guided.py index b26887a5..42429370 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -444,7 +444,10 @@ else: archinstall.arguments['harddrive'].keep_partitions = False # Temporary workaround to make Desktop Environments work if archinstall.arguments.get('profile', None) is not None: - archinstall.arguments['profile'] = archinstall.Profile(None, archinstall.arguments.get('profile', None)) + if type(archinstall.arguments.get('profile', None)) is dict: + archinstall.arguments['profile'] = archinstall.Profile(None, archinstall.arguments.get('profile', None)['path']) + else: + archinstall.arguments['profile'] = archinstall.Profile(None, archinstall.arguments.get('profile', None)) else: archinstall.arguments['profile'] = None if archinstall.arguments.get('mirror-region', None) is not None: -- cgit v1.2.3-70-g09d2