Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorm1ten <57693631+m1ten@users.noreply.github.com>2021-04-04 12:46:31 -0400
committerGitHub <noreply@github.com>2021-04-04 12:46:31 -0400
commit5018bef41dd36060b0604d711f42ce8050d5f5cc (patch)
treee396db4dd82fddb399f9db50e861dac99bffaf36
parent77c30fcb04599c631511943871f491d706a2d540 (diff)
parent0dcb4da799ae3beba807bfe9bfb56e97b6d64dc8 (diff)
Merge pull request #2 from archlinux/torxed-v2.2.0
Torxed v2.2.0
-rw-r--r--.github/CODEOWNERS6
-rw-r--r--archinstall/lib/disk.py4
-rw-r--r--archinstall/lib/general.py36
-rw-r--r--archinstall/lib/installer.py2
-rw-r--r--archinstall/lib/user_interaction.py4
-rw-r--r--examples/guided.py6
6 files changed, 50 insertions, 8 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index d499f478..4c93403a 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -1,3 +1,7 @@
# As per https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#example-of-a-codeowners-file
-* @Torxed @grazzolini
+* @Torxed
+
+# Any PKGBUILD changes should tag grazzolini
+/PKGBUILDs/ @grazzolini
+/PKGBUILD @grazzolini
diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py
index 31e8e007..4ea9f214 100644
--- a/archinstall/lib/disk.py
+++ b/archinstall/lib/disk.py
@@ -198,9 +198,9 @@ class Partition():
This is more reliable than relying on /dev/disk/by-partuuid as
it doesn't seam to be able to detect md raid partitions.
"""
- lsblk = b''.join(sys_command(f'lsblk -J {self.path}'))
+ lsblk = b''.join(sys_command(f'lsblk -J -o+PARTUUID {self.path}'))
for partition in json.loads(lsblk.decode('UTF-8'))['blockdevices']:
- return partition['partuuid']
+ return partition.get('partuuid', None)
@property
def encrypted(self):
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py
index ae2501c2..5b1b3c2a 100644
--- a/archinstall/lib/general.py
+++ b/archinstall/lib/general.py
@@ -76,7 +76,7 @@ class sys_command():#Thread):
"""
Stolen from archinstall_gui
"""
- def __init__(self, cmd, callback=None, start_callback=None, *args, **kwargs):
+ def __init__(self, cmd, callback=None, start_callback=None, peak_output=False, *args, **kwargs):
kwargs.setdefault("worker_id", gen_uid())
kwargs.setdefault("emulate", False)
kwargs.setdefault("suppress_errors", False)
@@ -101,6 +101,7 @@ class sys_command():#Thread):
self.args = args
self.kwargs = kwargs
+ self.peak_output = peak_output
self.kwargs.setdefault("worker", None)
self.callback = callback
@@ -158,6 +159,38 @@ class sys_command():#Thread):
'exit_code': self.exit_code
}
+ def peak(self, output :str):
+ if type(output) == bytes:
+ try:
+ output = output.decode('UTF-8')
+ except UnicodeDecodeError:
+ return None
+
+ output = output.strip('\r\n ')
+ if len(output) <= 0:
+ return None
+
+ if self.peak_output:
+ from .user_interaction import get_terminal_width
+
+ # Move back to the beginning of the terminal
+ sys.stdout.flush()
+ sys.stdout.write("\033[%dG" % 0)
+ sys.stdout.flush()
+
+ # Clear the line
+ sys.stdout.write(" " * get_terminal_width())
+ sys.stdout.flush()
+
+ # Move back to the beginning again
+ sys.stdout.flush()
+ sys.stdout.write("\033[%dG" % 0)
+ sys.stdout.flush()
+
+ # And print the new output we're peaking on:
+ sys.stdout.write(output)
+ sys.stdout.flush()
+
def run(self):
self.status = 'running'
old_dir = os.getcwd()
@@ -189,6 +222,7 @@ class sys_command():#Thread):
for fileno, event in poller.poll(0.1):
try:
output = os.read(child_fd, 8192)
+ self.peak(output)
self.trace_log += output
except OSError:
alive = False
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index c0323c61..a99bc944 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -137,7 +137,7 @@ class Installer():
self.log(f'Installing packages: {packages}', level=LOG_LEVELS.Info)
if (sync_mirrors := sys_command('/usr/bin/pacman -Syy')).exit_code == 0:
- if (pacstrap := sys_command(f'/usr/bin/pacstrap {self.mountpoint} {" ".join(packages)}', **kwargs)).exit_code == 0:
+ if (pacstrap := sys_command(f'/usr/bin/pacstrap {self.mountpoint} {" ".join(packages)}', peak_output=True, **kwargs)).exit_code == 0:
return True
else:
self.log(f'Could not strap in packages: {pacstrap.exit_code}', level=LOG_LEVELS.Info)
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index 630862ee..58f88bd2 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -94,10 +94,12 @@ def ask_to_configure_network():
# Optionally configure one network interface.
#while 1:
# {MAC: Ifname}
- interfaces = {'ISO-CONFIG' : 'Copy ISO network configuration to installation', **list_interfaces()}
+ interfaces = {'ISO-CONFIG' : 'Copy ISO network configuration to installation','NetworkManager':'Use NetworkManager to control and manage your internet connection', **list_interfaces()}
nic = generic_select(interfaces.values(), "Select one network interface to configure (leave blank to skip): ")
if nic and nic != 'Copy ISO network configuration to installation':
+ if nic == 'Use NetworkManager to control and manage your internet connection':
+ return {'nic': nic,'NetworkManager':True}
mode = generic_select(['DHCP (auto detect)', 'IP (static)'], f"Select which mode to configure for {nic}: ")
if mode == 'IP (static)':
while 1:
diff --git a/examples/guided.py b/examples/guided.py
index cfa8b37c..eba6e142 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -320,7 +320,9 @@ def perform_installation(device, boot_partition, language, mirrors):
# Perform a copy of the config
if archinstall.arguments.get('nic', None) == 'Copy ISO network configuration to installation':
installation.copy_ISO_network_config(enable_services=True) # Sources the ISO network configuration to the install medium.
-
+ elif archinstall.arguments.get('nic',{}).get('NetworkManager',False):
+ installation.add_additional_packages("networkmanager")
+ installation.enable_service('NetworkManager.service')
# Otherwise, if a interface was selected, configure that interface
elif archinstall.arguments.get('nic', None):
installation.configure_nic(**archinstall.arguments.get('nic', {}))
@@ -348,4 +350,4 @@ def perform_installation(device, boot_partition, language, mirrors):
ask_user_questions()
-perform_installation_steps() \ No newline at end of file
+perform_installation_steps()