Merge branch 'master' into post-installation-scripts

This commit is contained in:
Dylan Taylor 2021-05-20 08:13:57 -04:00
commit 9c8d55dd76
7 changed files with 12 additions and 13 deletions

View File

@ -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?

View File

@ -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)

View File

@ -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
return False

View File

@ -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:

View File

@ -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',

View File

@ -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()

View File

@ -22,7 +22,7 @@ classifers =
[options]
packages = find:
python_requires = >= 3.8
[options.packages.find]
include =
archinstall