Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDaniel <blackrabbit256@gmail.com>2022-02-03 00:26:09 +1100
committerGitHub <noreply@github.com>2022-02-02 14:26:09 +0100
commit37d6da7e4eb8897dfb80797f28db85ccdd09d376 (patch)
treee905face839487c47a246b521bf905e47d2fb8cb /examples
parentd3cf8a3655fe258a6291c05f94c7e3cff2a91a62 (diff)
Migrate old input to new menu (#874)
* Migrate old input to new menu * Fix imports * Remove imports * Update * Fixed import by changing 'import archinstall', to 'from ..menu import Menu' and use Menu() directly * Converted archinstall.<thing> to from ..where import <thing>. This enables us to use archinstall as a module, a git repository in testing and other things without having to install archinstall as an actual module. Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com> Co-authored-by: Anton Hvornum <anton@hvornum.se>
Diffstat (limited to 'examples')
-rw-r--r--examples/guided.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 45e213df..9cc39c86 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -58,15 +58,16 @@ def ask_user_questions():
will we continue with the actual installation steps.
"""
+ # ref: https://github.com/archlinux/archinstall/pull/831
+ # we'll set NTP to true by default since this is also
+ # the default value specified in the menu options; in
+ # case it will be changed by the user we'll also update
+ # the system immediately
+ archinstall.SysCommand('timedatectl set-ntp true')
+
global_menu = archinstall.GlobalMenu()
global_menu.enable('keyboard-layout')
- 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")
- archinstall.SysCommand('timedatectl set-ntp true')
-
# Set which region to download packages from during the installation
global_menu.enable('mirror-region')
@@ -293,8 +294,9 @@ def perform_installation(mountpoint):
installation.log("For post-installation tips, see https://wiki.archlinux.org/index.php/Installation_guide#Post-installation", fg="yellow")
if not archinstall.arguments.get('silent'):
- choice = input("Would you like to chroot into the newly created installation and perform post-installation configuration? [Y/n] ")
- if choice.lower() in ("y", ""):
+ prompt = 'Would you like to chroot into the newly created installation and perform post-installation configuration?'
+ choice = archinstall.Menu(prompt, ['yes', 'no'], default_option='yes').run()
+ if choice == 'yes':
try:
installation.drop_to_shell()
except: