From 8acd6e4ad29ae5834f5f2f19124d99c58ede3089 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 18 May 2021 14:59:36 -0400 Subject: Add CI status badge to README --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c03b2e0f..4aaf0b6b 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ - drawing -# Arch Installer +[![Lint Python and Find Syntax Errors](https://github.com/archlinux/archinstall/actions/workflows/lint-python.yaml/badge.svg)](https://github.com/archlinux/archinstall/actions/workflows/lint-python.yaml) - +# Arch Installer Just another guided/automated [Arch Linux](https://wiki.archlinux.org/index.php/Arch_Linux) installer with a twist. The installer also doubles as a python library to install Arch Linux and manage services, packages and other things inside the installed system *(Usually from a live medium)*. -- cgit v1.2.3-54-g00ecf From b94fee2242b74dacc3f53021c5ff30ce2b1f789a Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Wed, 19 May 2021 15:41:44 -0400 Subject: very minor whitespace fixes --- archinstall/lib/general.py | 2 +- archinstall/lib/networking.py | 2 ++ setup.cfg | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index cec3891a..81793cb8 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -365,4 +365,4 @@ def pid_exists(pid: int): try: return any(subprocess.check_output(['/usr/bin/ps', '--no-headers', '-o', 'pid', '-p', str(pid)]).strip()) except subprocess.CalledProcessError: - return False \ No newline at end of file + return False diff --git a/archinstall/lib/networking.py b/archinstall/lib/networking.py index eb11a47e..0643c9cf 100644 --- a/archinstall/lib/networking.py +++ b/archinstall/lib/networking.py @@ -10,6 +10,7 @@ from .general import SysCommand from .output import log from .storage import storage + def get_hw_addr(ifname): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) info = fcntl.ioctl(s.fileno(), 0x8927, struct.pack('256s', bytes(ifname, 'utf-8')[:15])) @@ -35,6 +36,7 @@ def check_mirror_reachable(): return False + def enrich_iface_types(interfaces: dict): result = {} for iface in interfaces: diff --git a/setup.cfg b/setup.cfg index 79dff732..e5d79ef3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,7 +22,7 @@ classifers = [options] packages = find: python_requires = >= 3.8 - + [options.packages.find] include = archinstall -- cgit v1.2.3-54-g00ecf From 29ee237d805fa606b8df0d5a6d97eed604489fc7 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Wed, 19 May 2021 17:22:32 -0400 Subject: Fix configuration sample link --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 100288f3..7590f3e5 100644 --- a/README.md +++ b/README.md @@ -27,10 +27,10 @@ Assuming you are on an Arch Linux live-ISO and booted into EFI mode. # python -m archinstall --script guided -## Running from a declarative [config](examples/base-config.json) +## Running from a declarative [config](examples/config-sample.json) Prequisites: - 1. Edit the [config](examples/base-config.json) according to your requirements. + 1. Edit the [config](examples/config-sample.json) according to your requirements. Assuming you are on a Arch Linux live-ISO and booted into EFI mode. -- cgit v1.2.3-54-g00ecf From 434ed8f67fbe4a03c8d7fe8f8a9c41843895e122 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Wed, 19 May 2021 17:24:51 -0400 Subject: Point out that a URL can be used as well in README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7590f3e5..21fc6d80 100644 --- a/README.md +++ b/README.md @@ -27,14 +27,14 @@ Assuming you are on an Arch Linux live-ISO and booted into EFI mode. # python -m archinstall --script guided -## Running from a declarative [config](examples/config-sample.json) +## Running from a declarative configuration file or URL Prequisites: - 1. Edit the [config](examples/config-sample.json) according to your requirements. + 1. Edit the [configuration file](examples/config-sample.json) according to your requirements. Assuming you are on a Arch Linux live-ISO and booted into EFI mode. - # python -m archinstall --config --vars '' + # python -m archinstall --config --vars '' # Help? -- cgit v1.2.3-54-g00ecf From 5b0f918d1bdbcac25502b3b8a195b97b13490255 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 19 May 2021 18:16:28 -0400 Subject: Have the configuration file request identify itself as coming from ArchInstall This is necessary to allow proper filtering of these requests server-side, and some services block urllib requests (known issue with Cloudflare). --- archinstall/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archinstall/__init__.py b/archinstall/__init__.py index 91e0cb12..ee4748f6 100644 --- a/archinstall/__init__.py +++ b/archinstall/__init__.py @@ -51,7 +51,7 @@ def initialize_arguments(): with open(args.config) as file: config = json.load(file) else: # Attempt to load the configuration from the URL. - with urllib.request.urlopen(args.config) as response: + with urllib.request.urlopen(urllib.request.Request(args.config, headers={'User-Agent': 'ArchInstall'})) as response: config = json.loads(response.read()) except Exception as e: print(e) -- cgit v1.2.3-54-g00ecf From 8fc236ac779a9c158eb4f59b811ad646c0c91544 Mon Sep 17 00:00:00 2001 From: Simon Peeters Date: Thu, 20 May 2021 03:00:57 +0200 Subject: look for default profiles in correct location The default `profiles` directory is a sibling of the `lib` directory, not of `storage.py` itself. --- archinstall/lib/storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archinstall/lib/storage.py b/archinstall/lib/storage.py index 42214572..4e19e4d4 100644 --- a/archinstall/lib/storage.py +++ b/archinstall/lib/storage.py @@ -11,7 +11,7 @@ storage = { 'PROFILE_PATH': [ './profiles', '~/.config/archinstall/profiles', - os.path.join(os.path.dirname(os.path.abspath(__file__)), 'profiles'), + os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'profiles'), # os.path.abspath(f'{os.path.dirname(__file__)}/../examples') ], 'UPSTREAM_URL': 'https://raw.githubusercontent.com/archlinux/archinstall/master/profiles', -- cgit v1.2.3-54-g00ecf From 0544274233f98b16554b1d220e40b6cf0c03e71b Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Thu, 20 May 2021 09:08:58 +0200 Subject: Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4aaf0b6b..152eca61 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ + drawing [![Lint Python and Find Syntax Errors](https://github.com/archlinux/archinstall/actions/workflows/lint-python.yaml/badge.svg)](https://github.com/archlinux/archinstall/actions/workflows/lint-python.yaml) + # Arch Installer Just another guided/automated [Arch Linux](https://wiki.archlinux.org/index.php/Arch_Linux) installer with a twist. -- cgit v1.2.3-54-g00ecf From 86fd64ef8ae804ae26bd02f90dbb780a8151f439 Mon Sep 17 00:00:00 2001 From: Yash Tripathi Date: Thu, 20 May 2021 13:22:58 +0530 Subject: fixed desktop install from config --- examples/guided.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/examples/guided.py b/examples/guided.py index f0d0db7a..b3e87df7 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -179,8 +179,6 @@ def ask_user_questions(): # Ask for archinstall-specific profiles (such as desktop environments etc) if not archinstall.arguments.get('profile', None): archinstall.arguments['profile'] = archinstall.select_profile(archinstall.list_profiles(filter_top_level_profiles=True)) - else: - archinstall.arguments['profile'] = archinstall.list_profiles()[archinstall.arguments['profile']] # Check the potentially selected profiles preparations to get early checks if some additional questions are needed. if archinstall.arguments['profile'] and archinstall.arguments['profile'].has_prep_function(): @@ -410,8 +408,6 @@ else: # Temporarily disabling keep_partitions if config file is loaded archinstall.arguments['harddrive'].keep_partitions = False # Temporary workaround to make Desktop Environments work - archinstall.storage['_desktop_profile'] = archinstall.arguments.get('desktop', None) - if archinstall.arguments.get('profile', None): - archinstall.arguments['profile'] = Profile(installer=None, path=archinstall.arguments['profile']['path']) + archinstall.arguments['profile'] = archinstall.Profile(None, archinstall.arguments.get('desktop', None)) perform_installation_steps() -- cgit v1.2.3-54-g00ecf