Demise of the Hardware Abstraction Layer (HAL)
Mark Greenwood
fatgerman at gmail.com
Wed Mar 14 16:25:45 UTC 2012
On 14 Mar 2012, at 15:57, Steve Cookson wrote:
> As I understand it, HAL is officially deprecated. It's only included in distros now to support old code which hasn't yet been made udev aware. It depends on what you mean by 'be able to use HAL', but I would suggest you start removing any dependence you have on it ASAP.
>
> 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.
I'm no expert but I know KDE uses disks now so it must be possible. There must be a udev mailing list you could try.
Mark
>
> Regards
>
> Steve
> --
> kubuntu-users mailing list
> kubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/kubuntu-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/kubuntu-users/attachments/20120314/b704f000/attachment.html>
More information about the kubuntu-users
mailing list