From b832cf7a95f6d7b56769efda12e75bb193670a9f Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Fri, 25 Oct 2013 22:08:21 +0200 Subject: [PATCH] 00-crypt.sh: use find_real_device to resolve UUID= or LABEL= dev names This reduces the likelihood of generating a very long string that could trigger a cryptsetup log error: log_err(NULL, _("DM-UUID for device %s was truncated.\n"), name); --- defaults/initrd.d/00-crypt.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/defaults/initrd.d/00-crypt.sh b/defaults/initrd.d/00-crypt.sh index 2628f30..094995a 100755 --- a/defaults/initrd.d/00-crypt.sh +++ b/defaults/initrd.d/00-crypt.sh @@ -69,7 +69,12 @@ _open_luks() { # do not force the link to /dev/mapper/root # but rather use the value from root=, which is # in ${REAL_ROOT} - local luks_dev_name=$(basename "${luks_device}") + # Using find_real_device to convert UUID= or LABEL= + # strings into actual device paths, this and basename + # avoid to create long strings that could be truncated + # by cryptsetup, generating a "DM-UUID for device %s was truncated" + # error. + local luks_dev_name=$(basename $(find_real_device "${luks_device}")) local luks_name_prefix= if echo "${real_dev}" | grep -q "^/dev/mapper/"; then