Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archinstall/__init__.py4
-rw-r--r--archinstall/lib/installer.py6
-rw-r--r--archinstall/lib/locale_helpers.py3
-rw-r--r--archinstall/lib/mirrors.py9
-rw-r--r--examples/guided.py4
-rw-r--r--profiles/awesome.py4
6 files changed, 21 insertions, 9 deletions
diff --git a/archinstall/__init__.py b/archinstall/__init__.py
index 9943ab3c..d98b6daa 100644
--- a/archinstall/__init__.py
+++ b/archinstall/__init__.py
@@ -16,10 +16,6 @@ from .lib.hardware import *
__version__ = "2.1.3"
-if hasUEFI() is False:
- log("ArchInstall currently only supports machines booted with UEFI. MBR & GRUB support is coming in version 2.2.0!", level=LOG_LEVELS.Error, fg="red")
- exit(1)
-
## Basic version of arg.parse() supporting:
## --key=value
## --boolean
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index c50b2ac7..758033a7 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -447,6 +447,12 @@ class Installer():
o = b''.join(sys_command(f"/usr/bin/arch-chroot {self.target} sh -c \"echo '{user}:{password}' | chpasswd\""))
pass
+
+ def user_set_shell(self, user, shell):
+ self.log(f'Setting shell for {user} to {shell}', level=LOG_LEVELS.Info)
+
+ o = b''.join(sys_command(f"/usr/bin/arch-chroot {self.target} sh -c \"chsh -s {shell} {user}\""))
+ pass
def set_keyboard_language(self, language):
if len(language.strip()):
diff --git a/archinstall/lib/locale_helpers.py b/archinstall/lib/locale_helpers.py
index 523a23d5..82964dc9 100644
--- a/archinstall/lib/locale_helpers.py
+++ b/archinstall/lib/locale_helpers.py
@@ -1,3 +1,4 @@
+import subprocess
import os
from .exceptions import *
@@ -26,4 +27,4 @@ def search_keyboard_layout(filter, layout='qwerty'):
yield language
def set_keyboard_language(locale):
- return os.system(f'loadkeys {locale}') == 0
+ return subprocess.call(['loadkeys',locale]) == 0
diff --git a/archinstall/lib/mirrors.py b/archinstall/lib/mirrors.py
index d7d35782..04f47c0d 100644
--- a/archinstall/lib/mirrors.py
+++ b/archinstall/lib/mirrors.py
@@ -74,10 +74,15 @@ def re_rank_mirrors(top=10, *positionals, **kwargs):
def list_mirrors():
url = f"https://archlinux.org/mirrorlist/?protocol=https&ip_version=4&ip_version=6&use_mirror_status=on"
-
- response = urllib.request.urlopen(url)
regions = {}
+ try:
+ response = urllib.request.urlopen(url)
+ except urllib.error.URLError as err:
+ log(f'Could not fetch an active mirror-list: {err}', level=LOG_LEVELS.Warning, fg="yellow")
+ return regions
+
+
region = 'Unknown region'
for line in response.readlines():
if len(line.strip()) == 0:
diff --git a/examples/guided.py b/examples/guided.py
index d50063f3..7353b7a7 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -3,6 +3,10 @@ import archinstall
from archinstall.lib.hardware import hasUEFI
from archinstall.lib.profiles import Profile
+if hasUEFI() is False:
+ log("ArchInstall currently only supports machines booted with UEFI. MBR & GRUB support is coming in version 2.2.0!", fg="red", level=archinstall.LOG_LEVELS.Error)
+ exit(1)
+
def ask_user_questions():
"""
First, we'll ask the user for a bunch of user input.
diff --git a/profiles/awesome.py b/profiles/awesome.py
index 0b00a424..cbd52a3c 100644
--- a/profiles/awesome.py
+++ b/profiles/awesome.py
@@ -39,13 +39,13 @@ if __name__ == 'awesome':
alacritty.install()
# TODO: Copy a full configuration to ~/.config/awesome/rc.lua instead.
- with open(f'{installation.mountpoint}/etc/xdg/awesome/rc.lua', 'r') as fh:
+ with open(f'{installation.target}/etc/xdg/awesome/rc.lua', 'r') as fh:
awesome_lua = fh.read()
## Replace xterm with alacritty for a smoother experience.
awesome_lua = awesome_lua.replace('"xterm"', '"alacritty"')
- with open(f'{installation.mountpoint}/etc/xdg/awesome/rc.lua', 'w') as fh:
+ with open(f'{installation.target}/etc/xdg/awesome/rc.lua', 'w') as fh:
fh.write(awesome_lua)
## TODO: Configure the right-click-menu to contain the above packages that were installed. (as a user config)