Skip to content

Commit

Permalink
fix(usrmount): do not empty _dev variable
Browse files Browse the repository at this point in the history
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: d353297
  • Loading branch information
puleglot authored and johannbg committed Aug 17, 2021
1 parent 7374943 commit 4afdcba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules.d/98usrmount/mount-usr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ mount_usr() {
while read -r _dev _mp _fs _opts _freq _passno || [ -n "$_dev" ]; do
[ "${_dev%%#*}" != "$_dev" ] && continue
if [ "$_mp" = "/usr" ]; then
_dev="$(label_uuid_to_dev "$_dev")"
case "$_dev" in
LABEL=* | UUID=* | PARTUUID=* | PARTLABEL=*)
_dev="$(label_uuid_to_dev "$_dev")"
;;
*) ;;
esac

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

0 comments on commit 4afdcba

Please sign in to comment.