Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYash Tripathi <tripathiyash97@gmail.com>2021-05-23 00:09:32 +0530
committerYash Tripathi <tripathiyash97@gmail.com>2021-05-23 00:09:32 +0530
commit1d984625c8b18180ad9e62332d32b20c9e2d4c7e (patch)
tree07b28e2f59716f2bbabee6f7d8c052043bbaebae
parent9a9d385d8c9936dc7b2d54aa07c7224f0cc887ef (diff)
parent35974e662459066db6e2ad8538bb83a7dee56028 (diff)
Merge branch 'archlinux:master' into master
-rw-r--r--README.md4
-rw-r--r--archinstall/lib/general.py4
-rw-r--r--archinstall/lib/installer.py3
-rw-r--r--examples/guided.py12
4 files changed, 20 insertions, 3 deletions
diff --git a/README.md b/README.md
index 0aef2097..c9ca63fa 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@ Or use `pip install --upgrade archinstall` to use as a library.
Assuming you are on an Arch Linux live-ISO and booted into EFI mode.
- # python -m archinstall --script guided
+ # archinstall
## Running from a declarative configuration file or URL
@@ -34,7 +34,7 @@ Prequisites:
Assuming you are on a Arch Linux live-ISO and booted into EFI mode.
- # python -m archinstall --config <path to config file or URL> --vars '<space_seperated KEY=VALUE pairs>'
+ # archinstall --config <path to config file or URL> [optional: --vars '<space_seperated KEY=VALUE pairs>']
# Help?
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py
index 249c7890..3b62c891 100644
--- a/archinstall/lib/general.py
+++ b/archinstall/lib/general.py
@@ -333,6 +333,10 @@ class SysCommand:
while self.session.ended is None:
self.session.poll()
+ if self.peak_output:
+ sys.stdout.write('\n')
+ sys.stdout.flush()
+
except SysCallError:
return False
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 29b3bc1a..1be398e9 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -453,6 +453,7 @@ class Installer:
self.pacstrap('efibootmgr')
o = b''.join(SysCommand(f'/usr/bin/arch-chroot {self.target} grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB'))
SysCommand('/usr/bin/arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg')
+ self.helper_flags['bootloder'] = True
return True
else:
root_device = subprocess.check_output(f'basename "$(readlink -f /sys/class/block/{root_partition.path.replace("/dev/", "")}/..)"', shell=True).decode().strip()
@@ -460,7 +461,7 @@ class Installer:
root_device = f"{root_partition.path}"
o = b''.join(SysCommand(f'/usr/bin/arch-chroot {self.target} grub-install --target=i386-pc /dev/{root_device}'))
SysCommand('/usr/bin/arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg')
- self.helper_flags['bootloader'] = bootloader
+ self.helper_flags['bootloader'] = True
return True
else:
raise RequirementError(f"Unknown (or not yet implemented) bootloader requested: {bootloader}")
diff --git a/examples/guided.py b/examples/guided.py
index f61548e1..e60cd0f8 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -12,6 +12,9 @@ from archinstall.lib.profiles import Profile
if archinstall.arguments.get('help'):
print("See `man archinstall` for help.")
exit(0)
+if os.getuid() != 0:
+ print("Archinstall requires root privileges to run. See --help for more.")
+ exit(1)
# For support reasons, we'll log the disk layout pre installation to match against post-installation layout
archinstall.log(f"Disk states before installing: {archinstall.disk_layouts()}", level=logging.DEBUG)
@@ -234,6 +237,12 @@ def ask_user_questions():
if not archinstall.arguments.get('timezone', None):
archinstall.arguments['timezone'] = archinstall.ask_for_a_timezone()
+ if archinstall.arguments['timezone']:
+ if not archinstall.arguments.get('ntp', False):
+ archinstall.arguments['ntp'] = input("Would you like to use automatic time synchronization (NTP) with the default time servers? [Y/n]: ").strip().lower() in ('y', 'yes')
+ if archinstall.arguments['ntp']:
+ archinstall.log("Hardware time and other post-configuration steps might be required in order for NTP to work. For more information, please check the Arch wiki.", fg="yellow")
+
def perform_installation_steps():
print()
@@ -366,6 +375,9 @@ def perform_installation(mountpoint):
if timezone := archinstall.arguments.get('timezone', None):
installation.set_timezone(timezone)
+ if archinstall.arguments.get('ntp', False):
+ installation.activate_ntp()
+
if (root_pw := archinstall.arguments.get('!root-password', None)) and len(root_pw):
installation.user_set_pw('root', root_pw)