Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archinstall/__init__.py6
-rw-r--r--archinstall/lib/user_interaction.py14
-rw-r--r--examples/guided.py5
3 files changed, 16 insertions, 9 deletions
diff --git a/archinstall/__init__.py b/archinstall/__init__.py
index bbad316d..84595528 100644
--- a/archinstall/__init__.py
+++ b/archinstall/__init__.py
@@ -32,7 +32,9 @@ def initialize_arguments():
parser.add_argument("--config", nargs="?", help="JSON configuration file or URL")
parser.add_argument("--creds", nargs="?", help="JSON credentials configuration file")
parser.add_argument("--silent", action="store_true",
- help="Warning!!! No prompts, ignored if config is not passed")
+ help="WARNING: Disables all prompts for input and confirmation. If no configuration is provided, this is ignored")
+ parser.add_argument("--dry-run", action="store_true",
+ help="Generates a configuration file and then exits instead of performing an installation")
parser.add_argument("--script", default="guided", nargs="?", help="Script to run for installation", type=str)
args, unknowns = parser.parse_known_args()
if args.config is not None:
@@ -61,6 +63,8 @@ def initialize_arguments():
key, val = arg[2:], True
config[key] = val
config["script"] = args.script
+ if args.dry_run is not None:
+ config["dry_run"] = args.dry_run
return config
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index 07b675a4..b8e1c35c 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -11,7 +11,7 @@ import time
from .exceptions import *
from .general import SysCommand
-from .hardware import AVAILABLE_GFX_DRIVERS, has_uefi
+from .hardware import AVAILABLE_GFX_DRIVERS, has_uefi, has_amd_graphics, has_intel_graphics, has_nvidia_graphics
from .locale_helpers import list_keyboard_languages, verify_keyboard_layout, search_keyboard_layout
from .networking import list_interfaces
from .output import log
@@ -702,12 +702,12 @@ def select_driver(options=AVAILABLE_GFX_DRIVERS):
default_option = options["All open-source (default)"]
if drivers:
- for line in SysCommand('/usr/bin/lspci'):
- if b' vga ' in line.lower():
- if b'nvidia' in line.lower():
- print(' ** nvidia card detected, suggested driver: nvidia **')
- elif b'amd' in line.lower():
- print(' ** AMD card detected, suggested driver: AMD / ATI **')
+ if has_amd_graphics():
+ print('For the best compatibility with your AMD hardware, you may want to use either the all open-source or AMD / ATI options.')
+ if has_intel_graphics():
+ print('For the best compatibility with your Intel hardware, you may want to use either the all open-source or Intel options.')
+ if has_nvidia_graphics():
+ print('For the best compatibility with your Nvidia hardware, you may want to use the Nvidia proprietary driver.')
initial_option = generic_select(drivers, input_text="Select your graphics card driver: ")
diff --git a/examples/guided.py b/examples/guided.py
index 56c054fc..266efbd4 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -270,7 +270,10 @@ def perform_installation_steps():
with open("/var/log/archinstall/user_configuration.json", "w") as config_file:
config_file.write(user_configuration)
print()
-
+
+ if archinstall.arguments.get('dry_run'):
+ exit(0)
+
if not archinstall.arguments.get('silent'):
input('Press Enter to continue.')