filesystems: use udisks instead of sysfs to detect removable (not system-internal) devices

This commit is contained in:
Silvan Calarco 2011-11-04 20:16:47 +01:00
parent 06da04babd
commit 48f4138813

View File

@ -173,8 +173,7 @@ blkid | while read line; do
[ "$label" ] || label="disk"
if [ -e $dev ]; then
# skip removable partitions
[ "`cat /sys/block/${dev:5:3}/removable 2>/dev/null`" = "1" \
-a ! -e /sys/block/${dev:5:3}/device/unload_heads ] && {
udisks --show-info $dev | grep "system internal:[[:space:]]*0$" || {
[ "$DEBUG" ] && logmsg "$me" $"skipped device $dev ($uuid): removable"
continue;
}