summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2024-01-30 15:35:03 +0100
committerSimon Rettberg2024-01-30 15:35:03 +0100
commit66da62121a45682ac3d22398c4a0c4b39fcb5e16 (patch)
tree508e82ee9c94fa04888fde60c7d2001a7639b440
parent[dev] find_partitions: Add --rw option to skip scanning ro devices (diff)
downloadslx-tools-66da62121a45682ac3d22398c4a0c4b39fcb5e16.tar.gz
slx-tools-66da62121a45682ac3d22398c4a0c4b39fcb5e16.tar.xz
slx-tools-66da62121a45682ac3d22398c4a0c4b39fcb5e16.zip
[dev] Fix ro path expression
-rw-r--r--modules/dev.inc2
1 files changed, 1 insertions, 1 deletions
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)$" \