Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-05-19 14:45:13 +0000
committerGitHub <noreply@github.com>2021-05-19 16:45:13 +0200
commit49e6cbdc545402e066bdc2daf6054abf6c1bf977 (patch)
treea1d4afcc6473d93bc958eab8241dbad616033dba /examples
parent52960bd686c92af4813ce302a21eb63a5aa67343 (diff)
Reworking SysCommand & Moving to localectl for locale related activities
* Moving to `localectl` rather than local file manipulation *(both for listing locales and setting them)*. * Swapped `loadkeys` for localectl. * Renamed `main` to `maim` in awesome profile. * Created `archinstall.Boot(<installation>)` which spawns a `systemd-nspawn` container against the installation target. * Exposing systemd.py's internals to archinstall global scope. * Re-worked `SysCommand` completely, it's now a wrapper for `SysCommandWorker` which supports interacting with the process in a different way. `SysCommand` should behave just like the old one, for backwards compatibility reasons. This fixes #68 and #69. * `SysCommand()` now has a `.decode()` function that defaults to `UTF-8`. * Adding back peak_output=True to pacstrap. Co-authored-by: Anton Hvornum <anton.feeds@gmail.com> Co-authored-by: Dylan Taylor <dylan@dylanmtaylor.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/guided.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/examples/guided.py b/examples/guided.py
index cce06b29..b9b06a64 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -1,6 +1,7 @@
import json
import logging
import time
+import os
import archinstall
from archinstall.lib.hardware import has_uefi
@@ -51,7 +52,7 @@ def ask_user_questions():
else:
archinstall.arguments['harddrive'] = archinstall.select_disk(archinstall.all_disks())
if archinstall.arguments['harddrive'] is None:
- archinstall.arguments['target-mount'] = '/mnt'
+ archinstall.arguments['target-mount'] = archinstall.storage.get('MOUNT_POINT', '/mnt')
# Perform a quick sanity check on the selected harddrive.
# 1. Check if it has partitions
@@ -291,14 +292,14 @@ def perform_installation_steps():
# unlocks the drive so that it can be used as a normal block-device within archinstall.
with archinstall.luks2(fs.find_partition('/'), 'luksloop', archinstall.arguments.get('!encryption-password', None)) as unlocked_device:
unlocked_device.format(fs.find_partition('/').filesystem)
- unlocked_device.mount('/mnt')
+ unlocked_device.mount(archinstall.storage.get('MOUNT_POINT', '/mnt'))
else:
- fs.find_partition('/').mount('/mnt')
+ fs.find_partition('/').mount(archinstall.storage.get('MOUNT_POINT', '/mnt'))
if has_uefi():
- fs.find_partition('/boot').mount('/mnt/boot')
+ fs.find_partition('/boot').mount(archinstall.storage.get('MOUNT_POINT', '/mnt')+'/boot')
- perform_installation('/mnt')
+ perform_installation(archinstall.storage.get('MOUNT_POINT', '/mnt'))
def perform_installation(mountpoint):
@@ -324,7 +325,6 @@ def perform_installation(mountpoint):
installation.set_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors in the installation medium
if archinstall.arguments["bootloader"] == "grub-install" and has_uefi():
installation.add_additional_packages("grub")
- installation.set_keyboard_language(archinstall.arguments['keyboard-language'])
installation.add_bootloader(archinstall.arguments["bootloader"])
# If user selected to copy the current ISO network configuration
@@ -370,6 +370,10 @@ def perform_installation(mountpoint):
if (root_pw := archinstall.arguments.get('!root-password', None)) and len(root_pw):
installation.user_set_pw('root', root_pw)
+ # This step must be after profile installs to allow profiles to install language pre-requisits.
+ # After which, this step will set the language both for console and x11 if x11 was installed for instance.
+ installation.set_keyboard_language(archinstall.arguments['keyboard-language'])
+
if archinstall.arguments['profile'] and archinstall.arguments['profile'].has_post_install():
with archinstall.arguments['profile'].load_instructions(namespace=f"{archinstall.arguments['profile'].namespace}.py") as imported:
if not imported._post_install():
@@ -389,7 +393,8 @@ def perform_installation(mountpoint):
if not check_mirror_reachable():
- archinstall.log("Arch Linux mirrors are not reachable. Please check your internet connection and try again.", level=logging.INFO, fg="red")
+ log_file = os.path.join(archinstall.storage.get('LOG_PATH', None), archinstall.storage.get('LOG_FILE', None))
+ archinstall.log(f"Arch Linux mirrors are not reachable. Please check your internet connection and the log file '{log_file}'.", level=logging.INFO, fg="red")
exit(1)
ask_user_questions()