Fix double /dev/ prefix bug in collect_partitions

lsblk -p returns PKNAME as a full path (/dev/sda), so stripping
the basename before prepending /dev/ avoids /dev//dev/sda.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-27 16:23:51 +02:00
parent 9e16162077
commit bfa5515d75
+1 -1
View File
@@ -98,7 +98,7 @@ collect_partitions() {
[[ "$LABEL" == "$OEMDRV_LABEL" ]] && continue [[ "$LABEL" == "$OEMDRV_LABEL" ]] && continue
[[ -z "$PKNAME" ]] && continue [[ -z "$PKNAME" ]] && continue
local disk="/dev/$PKNAME" local disk="/dev/${PKNAME##*/}"
local pnum local pnum
pnum=$(cat /sys/class/block/"${NAME##/dev/}"/partition 2>/dev/null) || continue pnum=$(cat /sys/class/block/"${NAME##/dev/}"/partition 2>/dev/null) || continue