Seek help on rule

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

 



Dear Madam/Sir.

I am writing to seek help from you over a rule. This is my rule

IMPORT{program}="/bin/echo iii=0"

KERNEL=="sdb", SUBSYSTEM=="block", IMPORT{program}="/sbin/scsi_id -g -u -x -a -s %p -d $tempnode", ENV{ID_SERIAL}=="360a980006e424539576f57487a4b6232", NAME="sdz$ENV{iii}", ENV{iii}="1"
KERNEL=="sdc", SUBSYSTEM=="block", IMPORT{program}="/sbin/scsi_id -g -u -x -a -s %p -d $tempnode", ENV{ID_SERIAL}=="360a980006e424539576f57487a4b6232", NAME="sdz$ENV{iii}", ENV{iii}="2"
KERNEL=="sdd", SUBSYSTEM=="block", IMPORT{program}="/sbin/scsi_id -g -u -x -a -s %p -d $tempnode", ENV{ID_SERIAL}=="360a980006e424539576f57487a4b6232", NAME="sdz$ENV{iii}", ENV{iii}="3"
KERNEL=="sde", SUBSYSTEM=="block", IMPORT{program}="/sbin/scsi_id -g -u -x -a -s %p -d $tempnode", ENV{ID_SERIAL}=="360a980006e424539576f57487a4b6232", NAME="sdz$ENV{iii}", ENV{iii}="4"


It is working and I can get /dev/sdz0, /dev/sdz1, /dev/sdz2, and /dev/sdz3. But, could you tell me how to let rule increasing ENV{iii} automatically? Here I have to set ENV{iii}="1", ENV{iii}="2", ENV{iii}="3", and ENV{iii}="4" manually.

By any change, could you tell me a single line rule, just like the following format, to realize my rule's function?

KERNEL=="sd*", SUBSYSTEM=="block", IMPORT{program}="/sbin/scsi_id -g -u 
-x -a -s %p -d $tempnode", 
ENV{ID_SERIAL}=="360a980006e424539576f57487a4b6232", 
NAME="sdz <automatically increase number by 1>"


Thanks for your help in advance.



Best regards,



Yan Zhang


      

--
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