Skip to content

Commit

Permalink
Support /dev/disk/by-id/ symlinks in command-line installer (#1422)
Browse files Browse the repository at this point in the history
* Allow symlinks as target device (for supporting /dev/disk/by-id)

* Use correct test (-L) for checking if it is a symlink

Co-authored-by: Jakob Lell <jakob@srlabs.com>
  • Loading branch information
jakoblell and Jakob Lell authored Feb 6, 2022
1 parent c57717a commit 7f717a7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions INSTALL/tool/VentoyWorker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ while [ -n "$1" ]; do
exit 1
fi
DISK=$1
# Resolve symlinks now, will be needed to look up information about the device in
# the /sys/ filesystem, for example /sys/class/block/${DISK#/dev/}/start
# The main use case is supporting /dev/disk/by-id/ symlinks instead of raw devices
if [ -L "$DISK" ]; then
DISK=$(readlink -e -n "$DISK")
fi
fi

shift
Expand Down

0 comments on commit 7f717a7

Please sign in to comment.