After you edit, what you need to do is more understandable. First, you need to find the devices you are about to request. The easiest way to do this is to actually scan sysfs. If you want to request a specific device, you just need to tell udev the place in sysfs where the device is described. Therefore, if you are looking for sdb , you can, for example, go through /block/sdb or select the correct node from /dev/block or something like that. If you have a path to your devices, say $DEVPATH , you can do something like:
udevadm info --attribute-walk --name=$DEVPATH
This will result in the release of a large amount of information, including deletion. Another set of information is displayed if you replace attribute-walk with query=property , however I could not find the deletion information.
If you want to do this for multiple devices, find and xargs will be your friends, which is basically your replacement for hal-find-by-capability , since you just need to find the right folder in sysfs.
Depending on what you are going to do, you can also read the udev rules , which allow you to run a script when the device is connected (by matching with the values ββspecified by --attribute-walk ). You can also easily set up ownership and permissions, etc.
source share