From a969f05ed3ead0f422c14dd750197f201f7ebb15 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 11 Aug 2012 13:19:21 -0400 Subject: functions: support UUID tags in /etc/crypttab As per crypttab(5), this is supported. This also adds forward looking support for PARTUUID, which is valid and should "just work" for GPT partitioned disks. Signed-off-by: Dave Reisner --- functions | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'functions') diff --git a/functions b/functions index e8ff7b8..e6b9af3 100644 --- a/functions +++ b/functions @@ -475,6 +475,16 @@ do_unlock_legacy() { do_unlock_systemd() { local name=$1 device=$2 password=$3 options=$4 failed=0 + # lazily convert tags to udev symlinks + case $device in + UUID=*) + device=/dev/disk/by-uuid/${device#UUID=} + ;; + PARTUUID=*) + device=/dev/disk/by-partuuid/${device#PARTUUID=} + ;; + esac + if ! /usr/lib/systemd/systemd-cryptsetup attach "$name" "$device" "$password" $options; then failed=1 else -- cgit v1.2.3