Filter luks_open menu

This commit is contained in:
Chrysostomus 2017-03-05 00:22:22 +08:00
parent fb2d05a05c
commit 6f215404b1
2 changed files with 11 additions and 0 deletions

1
lib/0 Normal file
View File

@ -0,0 +1 @@
9

View File

@ -188,6 +188,10 @@ list_containing_crypt() {
blkid | awk '/TYPE="crypto_LUKS"/{print $1}' | sed 's/.$//'
}
list_non_crypt() {
blkid | awk '!/TYPE="crypto_LUKS"/{print $1}' | sed 's/.$//'
}
# delete partition in list $PARTITIONS
# param: partition to delete
delete_partition_in_list() {
@ -468,6 +472,12 @@ luks_open() {
INCLUDE_PART='part\|crypt\|lvm'
umount_partitions
find_partitions
# Filter out partitions that don't contain crypt device
list_non_crypt > /tmp/.ignore_part
for part in $(cat /tmp/.ignore_part); do
delete_partition_in_list $part
done
# Select encrypted partition to open
DIALOG " $_LuksOpen " --menu "$_LuksMenuBody" 0 0 12 ${PARTITIONS} 2>${ANSWER} || return 1