mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
fix activate luks
This commit is contained in:
parent
3fcdbda222
commit
3659044446
1 changed files with 15 additions and 11 deletions
|
@ -152,21 +152,25 @@ activate_luks()
|
|||
ACTIVATE_LUKS=""
|
||||
if [ -e /sbin/cryptsetup ]; then
|
||||
DIALOG --infobox "Scanning for luks encrypted devices..." 0 0
|
||||
for PART in $(blkid -c=/dev/null | grep "TYPE=\"crypto_LUKS\"" | sed -e 's#:.*##g'); do
|
||||
# skip already encrypted devices, device mapper!
|
||||
OPEN_LUKS=""
|
||||
for devpath in $(ls /dev/mapper 2>/dev/null | grep -v control); do
|
||||
[ "$(cryptsetup status $devpath | grep $PART)" ] && OPEN_LUKS="no"
|
||||
done
|
||||
if ! [ "$OPEN_LUKS" = "no" ]; then
|
||||
if [ "$(blkid -c=/dev/null | grep "TYPE=\"crypto_LUKS\"")" ]; then
|
||||
for PART in $(blkid -c=/dev/null | grep "TYPE=\"crypto_LUKS\"" | sed -e 's#:.*##g'); do
|
||||
# skip already encrypted devices, device mapper!
|
||||
OPEN_LUKS=""
|
||||
for devpath in $(ls /dev/mapper 2>/dev/null | grep -v control); do
|
||||
[ "$(cryptsetup status $devpath | grep $PART)" ] && OPEN_LUKS="no"
|
||||
done
|
||||
if ! [ "$OPEN_LUKS" = "no" ]; then
|
||||
RUN_LUKS=""
|
||||
DIALOG --yesno "Setup detected luks encrypted device, do you want to activate $PART ?" 0 0 && RUN_LUKS="1"
|
||||
[ "$RUN_LUKS" = "1" ] && _enter_luks_name && _enter_luks_passphrase && _opening_luks
|
||||
[ "$RUN_LUKS" = "" ] && ACTIVATE_LUKS="no"
|
||||
else
|
||||
ACTIVATE_LUKS="no"
|
||||
fi
|
||||
done
|
||||
else
|
||||
ACTIVATE_LUKS="no"
|
||||
fi
|
||||
done
|
||||
else
|
||||
ACTIVATE_LUKS="no"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue