index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Dylan Taylor <dylan@dylanmtaylor.com> | 2021-05-20 08:13:57 -0400 |
---|---|---|
committer | Dylan Taylor <dylan@dylanmtaylor.com> | 2021-05-20 08:13:57 -0400 |
commit | 9c8d55dd76171909da27c90944ef9a686f6426cf (patch) | |
tree | 8da5e3a43fc4adf99c78a97a30cb548d02737929 | |
parent | f137bc4076ec7e4e0914be466ef403810ab02fca (diff) | |
parent | 86fd64ef8ae804ae26bd02f90dbb780a8151f439 (diff) |
-rw-r--r-- | README.md | 9 | ||||
-rw-r--r-- | archinstall/__init__.py | 2 | ||||
-rw-r--r-- | archinstall/lib/general.py | 2 | ||||
-rw-r--r-- | archinstall/lib/networking.py | 2 | ||||
-rw-r--r-- | archinstall/lib/storage.py | 2 | ||||
-rw-r--r-- | examples/guided.py | 6 | ||||
-rw-r--r-- | setup.cfg | 2 |
@@ -1,9 +1,10 @@ <!-- <div align="center"> --> <img src="https://github.com/archlinux/archinstall/raw/master/docs/logo.png" alt="drawing" width="200"/> -# 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) <!-- </div> --> +# 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)*. @@ -27,14 +28,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/base-config.json) +## Running from a declarative configuration file or URL Prequisites: - 1. Edit the [config](examples/base-config.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 <path to config file> --vars '<space_seperated KEY=VALUE pairs>' + # python -m archinstall --config <path to config file or URL> --vars '<space_seperated KEY=VALUE pairs>' # Help? 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) 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/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', diff --git a/examples/guided.py b/examples/guided.py index 29eea324..82ad0443 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -180,8 +180,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(): @@ -415,8 +413,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'] = archinstall.list_profiles()[archinstall.arguments['profile']] + archinstall.arguments['profile'] = archinstall.Profile(None, archinstall.arguments.get('desktop', None)) perform_installation_steps() @@ -22,7 +22,7 @@ classifers = [options] packages = find: python_requires = >= 3.8 - + [options.packages.find] include = archinstall |