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-04-02 10:42:26 +0200
committerAnton Hvornum <anton@hvornum.se>2021-04-02 10:42:26 +0200
commit65ec50dae5beee594681a6d2057d380994188987 (patch)
treed9d46aefaa9898274f8b46dc943d36e8e139176b /examples
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')
-rw-r--r--examples/guided.py18
-rw-r--r--examples/minimal.py2
2 files changed, 13 insertions, 7 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
diff --git a/examples/minimal.py b/examples/minimal.py
index 664bad0d..b5bb34e0 100644
--- a/examples/minimal.py
+++ b/examples/minimal.py
@@ -8,7 +8,7 @@ archinstall.sys_command(f'cryptsetup close /dev/mapper/luksloop', suppress_error
harddrive = archinstall.select_disk(archinstall.all_disks())
disk_password = getpass.getpass(prompt='Disk password (won\'t echo): ')
-with archinstall.Filesystem(harddrive, archinstall.GPT) as fs:
+with archinstall.Filesystem(harddrive) as fs:
# Use the entire disk instead of setting up partitions on your own
fs.use_entire_disk('luks2')