Don't offer to encrypt /boot, exlude it from the set available to the user (#1273)

* WIP: Don't offer to encrypt /boot

* This filter might work

* Ref: https://github.com/archlinux/archinstall/blob/master/archinstall/lib/storage.py

* Use list comprehension

* I wonder if I can use this filter_ argument that exists already

* flake8 fix

* Show index
This commit is contained in:
Dylan M. Taylor 2022-05-29 03:25:22 -04:00 committed by GitHub
parent 121e077b4e
commit b2f85889a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -206,8 +206,9 @@ class GlobalMenu(GeneralMenu):
for blockdevice in storage['arguments']['disk_layouts']:
if storage['arguments']['disk_layouts'][blockdevice].get('partitions'):
for partition_index in select_encrypted_partitions(
title="Select which partitions to encrypt:",
partitions=storage['arguments']['disk_layouts'][blockdevice]['partitions']
title=_('Select which partitions to encrypt:'),
partitions=storage['arguments']['disk_layouts'][blockdevice]['partitions'],
filter_=(lambda p: p['mountpoint'] != '/boot')
):
partition = storage['arguments']['disk_layouts'][blockdevice]['partitions'][partition_index]

View File

@ -376,7 +376,7 @@ def select_encrypted_partitions(
# show current partition layout:
if len(partitions):
title += current_partition_layout(partitions) + '\n'
title += current_partition_layout(partitions, with_idx=True) + '\n'
choice = Menu(title, partition_indexes, multi=multiple).run()