fix(usrmount): do not empty _dev variable

Currently $_dev is always overridden with the value returned by
label_uuid_to_dev(). This results in an empty value if $_dev is a
device path. Fix this by calling label_uuid_to_dev() conditionally.

Bug: https://bugs.gentoo.org/807971
Fixes: d3532978de
master
Alexander Tsoy 2021-08-16 18:54:34 +03:00 committed by Jóhann B. Guðmundsson
parent 7374943ae3
commit 4afdcba212
1 changed files with 6 additions and 1 deletions

View File

@ -55,7 +55,12 @@ mount_usr() {
while read -r _dev _mp _fs _opts _freq _passno || [ -n "$_dev" ]; do while read -r _dev _mp _fs _opts _freq _passno || [ -n "$_dev" ]; do
[ "${_dev%%#*}" != "$_dev" ] && continue [ "${_dev%%#*}" != "$_dev" ] && continue
if [ "$_mp" = "/usr" ]; then if [ "$_mp" = "/usr" ]; then
case "$_dev" in
LABEL=* | UUID=* | PARTUUID=* | PARTLABEL=*)
_dev="$(label_uuid_to_dev "$_dev")" _dev="$(label_uuid_to_dev "$_dev")"
;;
*) ;;
esac


if strstr "$_opts" "subvol=" \ if strstr "$_opts" "subvol=" \
&& [ "${root#block:}" -ef "$_dev" ] \ && [ "${root#block:}" -ef "$_dev" ] \