filesystems: use udisks instead of sysfs to detect removable (not system-internal) devices
This commit is contained in:
parent
06da04babd
commit
48f4138813
@ -173,8 +173,7 @@ blkid | while read line; do
|
|||||||
[ "$label" ] || label="disk"
|
[ "$label" ] || label="disk"
|
||||||
if [ -e $dev ]; then
|
if [ -e $dev ]; then
|
||||||
# skip removable partitions
|
# skip removable partitions
|
||||||
[ "`cat /sys/block/${dev:5:3}/removable 2>/dev/null`" = "1" \
|
udisks --show-info $dev | grep "system internal:[[:space:]]*0$" || {
|
||||||
-a ! -e /sys/block/${dev:5:3}/device/unload_heads ] && {
|
|
||||||
[ "$DEBUG" ] && logmsg "$me" $"skipped device $dev ($uuid): removable"
|
[ "$DEBUG" ] && logmsg "$me" $"skipped device $dev ($uuid): removable"
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user