Re: Debugging udev question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/22/09, Christopher Piggott <cpiggott@xxxxxxxxx> wrote:
> I have another question.
>
> Here is a test script I wrote to help debug my problem;
>
>     ACTION!="add", GOTO="vzwusb_end"
>
>     ATTRS{product}=="*Novatel*", RUN+="/usr/bin/logger IT IS A NOVATEL"
>     ATTRS{product}!="*Novatel*", GOTO="vzwusb_end1"
>
>     DRIVERS=="option1", RUN+="/usr/bin/logger DRIVER IS OPTION1"
>     DRIVERS!="option1", GOTO="vzwusb_end2"
>
>     ATTRS{port_number}=="0", RUN+="/usr/bin/logger IT IS PORT ZERO"
>     ATTRS{port_number}!="0", GOTO="vzwusb_end3"
>
>     KERNEL=="ttyUSB[0-9]*", RUN+="/usr/bin/logger IT IS A TTY"
>     KERNEL!="ttyUSB[0-9]*", GOTO="vzwusb_end4"
>
>     GOTO="vzwusb_success"
>
>     LABEL="vzwusb_end1"
>     RUN+="/usr/bin/logger end1"
>     GOTO=vzwusb_end
>
>     LABEL="vzwusb_end2"
>     RUN+="/usr/bin/logger end2"
>     GOTO=vzwusb_end
>
>     LABEL="vzwusb_end3"
>     RUN+="/usr/bin/logger end3"
>     GOTO=vzwusb_end
>
>     LABEL="vzwusb_end4"
>     RUN+="/usr/bin/logger end4"
>     GOTO=vzwusb_end
>
>     LABEL="vzwusb_success"
>     RUN+="/usr/bin/logger SUCCESS"
>
>     LABEL="vzwusb_end"
>     RUN+="/usr/bin/logger END OF SCRIPT"
>
>
>
> The output I get is (relevant part only)
>
>     udevadm_test: run: '/usr/bin/logger IT IS A NOVATEL'
>     udevadm_test: run: '/usr/bin/logger end1'
>     udevadm_test: run: '/usr/bin/logger END OF SCRIPT'
>
>
>
> Tracing through what it did, it said IT IS A NOVATEL so it should have
> gone on to the next option.  Instead, the next rule (which says != but
> with the same condtion) also fires, and sends us to end1.  It's the
> exact same condition ... one says if product == "*Novatel*" that it
> should run the command, the next line says that if it is NOT
> "*Novatel*" that it should jump to end1.  So it's as if both of these
> conditions evaluate to true?  Does that make any sense?

Hmm.  What does "/sbin/udevadm info -n ttyUSB0 --attribute-walk" say?

It could make sense, if you have two different "product" attributes in
the chain of parent devices.  The first rule could find the matching
attribute, and the second rule could find the other, non-matching
attribute.

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux