I need to port a bash script which uses deprecated HAL tools like hal-get-property
or hal-find-by-capability
to udev. HAL states that HAL was merged into udev, but I couldn't find useful informations on how to proper port this script to udev.
Example: If I want a list of all storage hardware (with HAL) I could run
hal-find-by-capability --capability storage
which would give me a list of UDI's (Unique Device Identifier) looking like that:
/org/freedesktop/Hal/devices/storage_model_Virtual_disk
/org/freedesktop/Hal/devices/storage_serial_00000000000000000001
/org/freedesktop/Hal/devices/platform_floppy_0_storage
If I now want to find out if /org/freedesktop/Hal/devices/storage_model_Virtual_disk
is removable I could issue the following query
hal-get-property --udi /org/freedesktop/Hal/devices/storage_model_Virtual_disk --key storage.removable
and it would answer true
or false
.
So my question is:
How can I do those things wihout HAL?
sysfsutils (systool
) could work, but it doesn't seem to be a proper replacement.
Does this work with udevadm info
?