This patch fixes this issue. I tested the functionality of this function by creating a script invoking this function as standalone.
$ sudo ./test.sh + resolve_device PARTUUID=275f782b-3c55-4b3f-acb2-c17db0eaee8d + DEV=PARTUUID=275f782b-3c55-4b3f-acb2-c17db0eaee8d + case "$DEV" in + case "$DEV" in ++ echo PARTUUID=275f782b-3c55-4b3f-acb2-c17db0eaee8d ++ cut -f 1 -d = + local type=PARTUUID ++ echo PARTUUID=275f782b-3c55-4b3f-acb2-c17db0eaee8d ++ tr '[:upper:]' '[:lower:]' ++ cut -f 2 -d = + local value=275f782b-3c55-4b3f-acb2-c17db0eaee8d + DEV=PARTUUID=275f782b-3c55-4b3f-acb2-c17db0eaee8d + command -v blkid ++ blkid -l -t PARTUUID=275f782b-3c55-4b3f-acb2-c17db0eaee8d -o device + DEV=/dev/sda2 + '[' -e /dev/sda2 ']' + echo /dev/sda2 /dev/sda2 + resolve_device PARTUUID=275F782B-3C55-4B3F-ACB2-C17DB0EAEE8D + DEV=PARTUUID=275F782B-3C55-4B3F-ACB2-C17DB0EAEE8D + case "$DEV" in + case "$DEV" in ++ echo PARTUUID=275F782B-3C55-4B3F-ACB2-C17DB0EAEE8D ++ cut -f 1 -d = + local type=PARTUUID ++ echo PARTUUID=275F782B-3C55-4B3F-ACB2-C17DB0EAEE8D ++ cut -f 2 -d = ++ tr '[:upper:]' '[:lower:]' + local value=275f782b-3c55-4b3f-acb2-c17db0eaee8d + DEV=PARTUUID=275f782b-3c55-4b3f-acb2-c17db0eaee8d + command -v blkid ++ blkid -l -t PARTUUID=275f782b-3c55-4b3f-acb2-c17db0eaee8d -o device + DEV=/dev/sda2 + '[' -e /dev/sda2 ']' + echo /dev/sda2 /dev/sda2
This patch fixes this issue. I tested the functionality of this function by creating a script invoking this function as standalone.
$ sudo ./test.sh 275f782b- 3c55-4b3f- acb2-c17db0eaee 8d 275f782b- 3c55-4b3f- acb2-c17db0eaee 8d 275f782b- 3c55-4b3f- acb2-c17db0eaee 8d 275f782b- 3c55-4b3f- acb2-c17db0eaee 8d 3c55-4b3f- acb2-c17db0eaee 8d 275f782b- 3c55-4b3f- acb2-c17db0eaee 8d 275f782b- 3c55-4b3f- acb2-c17db0eaee 8d -o device 275F782B- 3C55-4B3F- ACB2-C17DB0EAEE 8D 275F782B- 3C55-4B3F- ACB2-C17DB0EAEE 8D 275F782B- 3C55-4B3F- ACB2-C17DB0EAEE 8D 275F782B- 3C55-4B3F- ACB2-C17DB0EAEE 8D 3c55-4b3f- acb2-c17db0eaee 8d 275f782b- 3c55-4b3f- acb2-c17db0eaee 8d 275f782b- 3c55-4b3f- acb2-c17db0eaee 8d -o device
+ resolve_device PARTUUID=
+ DEV=PARTUUID=
+ case "$DEV" in
+ case "$DEV" in
++ echo PARTUUID=
++ cut -f 1 -d =
+ local type=PARTUUID
++ echo PARTUUID=
++ tr '[:upper:]' '[:lower:]'
++ cut -f 2 -d =
+ local value=275f782b-
+ DEV=PARTUUID=
+ command -v blkid
++ blkid -l -t PARTUUID=
+ DEV=/dev/sda2
+ '[' -e /dev/sda2 ']'
+ echo /dev/sda2
/dev/sda2
+ resolve_device PARTUUID=
+ DEV=PARTUUID=
+ case "$DEV" in
+ case "$DEV" in
++ echo PARTUUID=
++ cut -f 1 -d =
+ local type=PARTUUID
++ echo PARTUUID=
++ cut -f 2 -d =
++ tr '[:upper:]' '[:lower:]'
+ local value=275f782b-
+ DEV=PARTUUID=
+ command -v blkid
++ blkid -l -t PARTUUID=
+ DEV=/dev/sda2
+ '[' -e /dev/sda2 ']'
+ echo /dev/sda2
/dev/sda2