Hi
Mark,
Thanks for
this. I have a piece of HAL code which give me some details about USBs
which I parse to get mounting info. I tried other source, but it didn't
all appear to be there.
This what I have
now:
#!/bin/ksh93
#
# list attached USB storage
devices
#
for udi in
$(/usr/bin/hal-find-by-capability --capability
storage)
do
device=$(hal-get-property --udi $udi --key
block.device)
#device2=$(hal-get-property --udi $udi --key
block.storage_device)
vendor=$(hal-get-property --udi $udi
--key storage.vendor)
model=$(hal-get-property --udi $udi
--key storage.model)
product=$(hal-get-property --udi $udi
--key info.product)
#dev=$(hal-get-property --udi $device2
--key linux.sysfs_path)
if [[ $(hal-get-property --udi
$udi --key storage.bus) = "usb" ]]
then
parent_udi=$(hal-find-by-property --key block.storage_device --string
$udi)
mount=$(hal-get-property
--udi $parent_udi --key
volume.mount_point)
label=$(hal-get-property --udi $parent_udi --key
volume.label)
media_removable=$(hal-get-property --udi $udi --key
storage.removable)
media_size=$(hal-get-property --udi $udi --key
storage.removable.media_size)
size=$(( ceil(media_size/(1000*1000*1000))
))
printf
"-------------------------------------------------\n"
printf "Vendor: $vendor\n"
printf
"Model: $model\n"
printf
"Device: $device\n"
printf
"Product: $product\n"
printf
"Mount: $mount\n"
printf
"Size "${size}" GB \n"
printf
"Removable: $media_removable\n"
#printf "Dev: $dev\n"
fi
done
But it is not
clear to me how I might get the same attributes from udev.
Regards
Steve