Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-03-20 17:26:48 +0100
committerAnton Hvornum <anton@hvornum.se>2021-03-20 17:26:48 +0100
commitb67257233f43fa8d34dacd6ecc3dc7cbbf60d221 (patch)
tree99671297c0f9a3d74167f2e78d7806a07bdfc089 /archinstall
parent64653565a49a12a712170d7c9b86055373c25ff8 (diff)
Fixed #64. installation.set_timezone() already excisted since earlier versions of archinstall in the library section. The guided.py example simply never asked for a time-zone. There's still no NTP option, which I'll add in later. Mostly because there's a lot of settings one can do to a time-client configuration, and I'm not sure all users want the default time servers etc.
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/installer.py5
-rw-r--r--archinstall/lib/user_interaction.py7
2 files changed, 9 insertions, 3 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 39e3447d..2604e77d 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -1,4 +1,4 @@
-import os, stat, time, shutil
+import os, stat, time, shutil, pathlib
from .exceptions import *
from .disk import *
@@ -171,7 +171,8 @@ class Installer():
def set_timezone(self, zone, *args, **kwargs):
if not len(zone): return True
- o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.mountpoint} ln -s /usr/share/zoneinfo/{zone} /etc/localtime'))
+ (pathlib.Path(self.mountpoint)/"etc"/"localtime").unlink(missing_ok=True)
+ sys_command(f'/usr/bin/arch-chroot {self.mountpoint} ln -s /usr/share/zoneinfo/{zone} /etc/localtime')
return True
def activate_ntp(self):
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index ab2b19bc..6b3e5faa 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -1,4 +1,4 @@
-import getpass
+import getpass, pathlib
from .exceptions import *
from .profiles import Profile
from .locale_helpers import search_keyboard_layout
@@ -50,6 +50,11 @@ def ask_for_additional_users(prompt='Any additional users to install (leave blan
return users, super_users
+def ask_for_a_timezone():
+ timezone = input('Enter a valid timezone (Example: Europe/Stockholm): ').strip()
+ if pathlib.Path(timezone).exists():
+ return timezone
+
def ask_to_configure_network():
# Optionally configure one network interface.
#while 1: