Skip to content

Commit

Permalink
Merge pull request #342 from archlinux/torxed-patch1
Browse files Browse the repository at this point in the history
/ and /boot requirement when keeping partition layout
  • Loading branch information
Torxed authored Apr 22, 2021
2 parents 1c6aa6b + 3cf8ec7 commit b963ed2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/guided.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,18 @@ def ask_user_questions():

archinstall.log(f" ** You will now select which partitions to use by selecting mount points (inside the installation). **")
archinstall.log(f" ** The root would be a simple / and the boot partition /boot (as all paths are relative inside the installation). **")
mountpoints_set = []
while True:
# Select a partition
# If we provide keys as options, it's better to convert them to list and sort before passing
mountpoints_list = sorted(list(partition_mountpoints.keys()))
partition = archinstall.generic_select(mountpoints_list,
"Select a partition by number that you want to set a mount-point for (leave blank when done): ")
if not partition:
break
if set(mountpoints_set) & {'/', '/boot'} == {'/', '/boot'}:
break

continue

# Select a mount-point
mountpoint = input(f"Enter a mount-point for {partition}: ").strip(' ')
Expand Down Expand Up @@ -122,6 +126,7 @@ def ask_user_questions():
# We can safely mark the partition for formatting and where to mount it.
# TODO: allow_formatting might be redundant since target_mountpoint should only be
# set if we actually want to format it anyway.
mountpoints_set.append(mountpoint)
partition.allow_formatting = True
partition.target_mountpoint = mountpoint
# Only overwrite the filesystem definition if we selected one:
Expand Down

0 comments on commit b963ed2

Please sign in to comment.