index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Yash Tripathi <tripathiyash97@gmail.com> | 2021-05-23 00:09:32 +0530 |
---|---|---|
committer | Yash Tripathi <tripathiyash97@gmail.com> | 2021-05-23 00:09:32 +0530 |
commit | 1d984625c8b18180ad9e62332d32b20c9e2d4c7e (patch) | |
tree | 07b28e2f59716f2bbabee6f7d8c052043bbaebae /examples | |
parent | 9a9d385d8c9936dc7b2d54aa07c7224f0cc887ef (diff) | |
parent | 35974e662459066db6e2ad8538bb83a7dee56028 (diff) |
-rw-r--r-- | examples/guided.py | 12 |
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) |