This commit is contained in:
illiliti 2020-05-13 19:42:30 +03:00
parent f4712b3143
commit 55008b4c98

View File

@ -4,7 +4,9 @@
create_symlink() create_symlink()
{ {
sym="$1" dir="$1"; sym="$2"
# remove double quotes
sym="${sym%\"}" sym="${sym%\"}"
sym="${sym#\"}" sym="${sym#\"}"
sym="${dir}/${sym}" sym="${dir}/${sym}"
@ -23,18 +25,9 @@ create_symlink()
while ! blkid "/dev/${dev_name}"; do sleep 1; done while ! blkid "/dev/${dev_name}"; do sleep 1; done
for line in $(blkid "/dev/${dev_name}"); do case "${line%%=*}" in for line in $(blkid "/dev/${dev_name}"); do case "${line%%=*}" in
UUID) UUID) create_symlink /dev/disk/by-uuid "${line##*=}" ;;
dir=/dev/disk/by-uuid LABEL) create_symlink /dev/disk/by-label "${line##*=}" ;;
create_symlink "${line##*=}" PARTUUID) create_symlink /dev/disk/by-partuuid "${line##*=}" ;;
;;
LABEL)
dir=/dev/disk/by-label
create_symlink "${line##*=}"
;;
PARTUUID)
dir=/dev/disk/by-partuuid
create_symlink "${line##*=}"
;;
esac; done esac; done
[ -e "/sys/block/${dev_name}/dm/name" ] && { [ -e "/sys/block/${dev_name}/dm/name" ] && {