summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-08-11 13:19:21 -0400
committerTom Gundersen <teg@jklm.no>2012-08-11 19:38:07 +0200
commita969f05ed3ead0f422c14dd750197f201f7ebb15 (patch)
tree09cd14bd68a1e8e682cf0bd3622c99844dba0ea2
parentac6b435d40c8295fcc0fc4cb751ccd092a77e433 (diff)
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 <dreisner@archlinux.org>
-rw-r--r--functions10
1 files changed, 10 insertions, 0 deletions
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