Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples/guided.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-04-02 10:42:26 +0200
committerAnton Hvornum <anton@hvornum.se>2021-04-02 10:42:26 +0200
commit65ec50dae5beee594681a6d2057d380994188987 (patch)
treed9d46aefaa9898274f8b46dc943d36e8e139176b /examples/guided.py
parent99dd9b1fb7856b864d816119f0742950941e97a8 (diff)
parentb5e32f980a27f272c1e3c42969323dff82617a84 (diff)
Merge PR #113 into torxed-v2.2.0 feature branch.
This merge should add BIOS through MBR support and GRUB.
Diffstat (limited to 'examples/guided.py')
-rw-r--r--examples/guided.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 4766301e..f374a41c 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -1,5 +1,6 @@
import getpass, time, json, sys, signal, os
import archinstall
+from archinstall.lib.hardware import hasUEFI
"""
This signal-handler chain (and global variable)
@@ -139,7 +140,7 @@ def ask_user_questions():
# Get disk encryption password (or skip if blank)
if not archinstall.arguments.get('!encryption-password', None):
- if passwd := archinstall.get_password(prompt='Enter disk encryption password (leave blank for no encryption): '):
+ if (passwd := archinstall.get_password(prompt='Enter disk encryption password (leave blank for no encryption): ')):
archinstall.arguments['!encryption-password'] = passwd
archinstall.arguments['harddrive'].encryption_password = archinstall.arguments['!encryption-password']
@@ -244,13 +245,18 @@ def perform_installation_steps():
Setup the blockdevice, filesystem (and optionally encryption).
Once that's done, we'll hand over to perform_installation()
"""
- with archinstall.Filesystem(archinstall.arguments['harddrive'], archinstall.GPT) as fs:
+ # maybe we can ask the user what they would prefer on uefi systems?
+ if hasUEFI():
+ mode = archinstall.GPT
+ else:
+ mode = archinstall.MBR
+ with archinstall.Filesystem(archinstall.arguments['harddrive'],mode) as fs:
# Wipe the entire drive if the disk flag `keep_partitions`is False.
if archinstall.arguments['harddrive'].keep_partitions is False:
- fs.use_entire_disk(root_filesystem_type=archinstall.arguments.get('filesystem', 'btrfs'),
- encrypt_root_partition=archinstall.arguments.get('!encryption-password', False))
- # Otherwise, check if encryption is desired and mark the root partition as encrypted.
- elif archinstall.arguments.get('!encryption-password', None):
+ fs.use_entire_disk(root_filesystem_type=archinstall.arguments.get('filesystem', 'btrfs'))
+
+ # Check if encryption is desired and mark the root partition as encrypted.
+ if archinstall.arguments.get('!encryption-password', None):
root_partition = fs.find_partition('/')
root_partition.encrypted = True