From: jakoblell Date: Sun, 6 Feb 2022 15:13:15 +0000 (+0100) Subject: Support `/dev/disk/by-id/` symlinks in command-line installer (#1422) X-Git-Tag: v1.0.67~6^2 X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/commitdiff_plain/7f717a7fe9f9c799a6f494d294c552386446bfc2?ds=sidebyside Support `/dev/disk/by-id/` symlinks in command-line installer (#1422) * 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 --- diff --git a/INSTALL/tool/VentoyWorker.sh b/INSTALL/tool/VentoyWorker.sh index 9754e5e..cdb1dbb 100644 --- a/INSTALL/tool/VentoyWorker.sh +++ b/INSTALL/tool/VentoyWorker.sh @@ -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