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);
master v41
Fabio Erculiani 11 years ago
parent 3b2aa3077c
commit b832cf7a95

@ -69,7 +69,12 @@ _open_luks() {
# do not force the link to /dev/mapper/root # do not force the link to /dev/mapper/root
# but rather use the value from root=, which is # but rather use the value from root=, which is
# in ${REAL_ROOT} # 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= local luks_name_prefix=
if echo "${real_dev}" | grep -q "^/dev/mapper/"; then if echo "${real_dev}" | grep -q "^/dev/mapper/"; then

Loading…
Cancel
Save