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-02-16 08:51:00 +0100
committerAnton Hvornum <anton@hvornum.se>2021-02-16 08:51:00 +0100
commit76d3976df6d148e31a0aab04037a7c191b4054fe (patch)
tree1ba468e88b0b71c177f9a4b429fa86a4dbc241c1 /examples
parente2cd617d05d87bbe3fe8f1809faecd8c1ebd230e (diff)
Re-worked guided to allow for unsupported fileformats when checking which are supported, as well as selecting mount-points.
Diffstat (limited to 'examples')
-rw-r--r--examples/guided.py39
1 files changed, 24 insertions, 15 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 5e8a64c1..abbecd3a 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -104,26 +104,35 @@ else:
# 2. If so, ask if we should keep them or wipe everything
if archinstall.arguments['harddrive'].has_partitions():
archinstall.log(f" ! {archinstall.arguments['harddrive']} contains existing partitions", fg='red')
- try:
- partition_mountpoints = {}
- for partition in archinstall.arguments['harddrive']:
+ partition_mountpoints = {}
+ for partition in archinstall.arguments['harddrive']:
+ try:
if partition.filesystem_supported():
archinstall.log(f" {partition}")
partition_mountpoints[partition] = None
+ except archinstall.UnknownFilesystemFormat as err:
+ archinstall.log(f" {partition} (Filesystem not supported)", fg='red')
+ #archinstall.log(f"Current filesystem is not supported: {err}", fg='red')
+ #input(f"Do you wish to erase all data? (y/n):")
+
+ if (option := input('Do you wish to keep one/more existing partitions or format entire drive? (k/f): ')).lower() in ('k', 'keep'):
+ archinstall.arguments['harddrive'].keep_partitions = True
+
+ archinstall.log(f" ** You will now select where (inside the installation) to mount partitions. **")
+ archinstall.log(f" ** The root would be a simple / and the boot partition /boot as it's relative paths. **")
+ while True:
+ partition = archinstall.generic_select(partition_mountpoints.keys(), "Select a partition to assign mount-point to: ")
+ if not partition:
+ break
- if (option := input('Do you wish to keep one/more existing partitions or format entire drive? (k/f): ')).lower() in ('k', 'keep'):
- archinstall.arguments['harddrive'].keep_partitions = True
-
- while True:
- partition = archinstall.generic_select(partition_mountpoints.values(), "Select a partition to assign mount-point to")
+ mountpoint = input(f"Select a mount-point for {partition}: ")
+ #partition.mountpoint = mountpoint
+ partition.allow_formatting = True
+ partition.target_mountpoint = mountpoint
- archinstall.arguments['harddrive'].allocate_partitions(selections)
- archinstall.log('Using existing partition table reported above.')
- else:
- archinstall.arguments['harddrive'].keep_partitions = False
- except archinstall.UnknownFilesystemFormat as err:
- archinstall.log(f"Current filesystem is not supported: {err}", fg='red')
- input(f"Do you wish to erase all data? (y/n):")
+ archinstall.log('Using existing partition table reported above.')
+ else:
+ archinstall.arguments['harddrive'].keep_partitions = False
exit(0)
while (disk_password := getpass.getpass(prompt='Enter disk encryption password (leave blank for no encryption): ')):