From 66da62121a45682ac3d22398c4a0c4b39fcb5e16 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 30 Jan 2024 15:35:03 +0100 Subject: [dev] Fix ro path expression --- modules/dev.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dev.inc b/modules/dev.inc index c054b63..c83e7fe 100644 --- a/modules/dev.inc +++ b/modules/dev.inc @@ -46,7 +46,7 @@ dev_find_partitions() { done local label number mbrid uuid for dev in $(find $target* -type b); do - [ -n "$rw" ] && [ "$( cat "/sys/class/block/$dev/ro" )" = "1" ] && continue + [ -n "$rw" ] && [ "$( cat "/sys/class/block/${dev##*/}/ro" )" = "1" ] && continue dev_get_type "$dev" || continue echo "$dev is $number - MBR=$mbrid, UUID=$uuid, label=$label" >&2 if regex_imatch "$mbrid" "^($want_type)$" || regex_imatch "$uuid" "^($want_uuid)$" \ -- cgit v1.2.3-55-g7522