Demise of the Hardware Abstraction Layer (HAL)

9 views
Skip to first unread message

Steve Cookson

unread,
Mar 13, 2012, 8:34:46 PM3/13/12
to Kubuntu user technical support

Hi Guys,

I understand that the Hardware Abstraction Layer (HAL) is being phased out and being replaced by a number of other functions including udisk. 

Do we have a date or release for this change?  When will I no longer be able to use HAL?

Regards

Steve

 
Blank Bkgrd.gif

Mark Greenwood

unread,
Mar 13, 2012, 8:44:34 PM3/13/12
to Kubuntu user technical support
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.

Mark

Regards

Steve

 
-- 
kubuntu-users mailing list
kubunt...@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/kubuntu-users

Steve Cookson

unread,
Mar 14, 2012, 11:57:20 AM3/14/12
to Kubuntu user technical support
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.
 
Regards
 
Steve

Mark Greenwood

unread,
Mar 14, 2012, 12:25:45 PM3/14/12
to Kubuntu user technical support
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.
Reply all
Reply to author
Forward
0 new messages