udev rule for matching USB class and subclass?
Felipe Sateler
fsateler at debian.org
Mon Oct 10 16:20:32 BST 2016
On 10 October 2016 at 10:26, Petter Reinholdtsen <pere at hungry.com> wrote:
>
> Hi.
>
> I've been trying to figure out if it is possible to write a udev rule
> matching USB class and subclass, without any success so far. My goal is
> to write a rule matching any smart card reader, instead of individual
> smart card readers. But is it possible with udev?
>
> With AppStream / isenkram I can match it using the modaliases from the
> kernel.
I think so. There is the the ENV{MODALIAS} attribute that you can match on.
> The following oneliner will print the modalias for any smart
> card reader installed in the system:
>
> for mod in $(cat $(find /sys/|grep modalias|grep usb)); do \
> case "$mod" in usb:*ic0Bisc00ip*) echo $mod; esac; \
> done
>
> But the scdaemon udev rule list individual vendor/product IDs instead of
> specifying class 0B and subclass 00. It there any way around this?
I do not have any idea why upstream scdaemon would have chosen that
path. Perhaps the modalias can bring a false positive? I see that the
rules also sets a gnupg driver, perhaps the scdaemon supports other
smartcard readers not supported by the gnupg driver?
--
Saludos,
Felipe Sateler
More information about the Pkg-systemd-maintainers
mailing list