Linux Hotplug development
 help / color / mirror / Atom feed
* Seek help on rule
@ 2010-05-05  5:23 Yan Zhang
  2010-05-05  6:28 ` Kay Sievers
  0 siblings, 1 reply; 2+ messages in thread
From: Yan Zhang @ 2010-05-05  5:23 UTC (permalink / raw)
  To: linux-hotplug

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


      


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-05-05  6:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-05  5:23 Seek help on rule Yan Zhang
2010-05-05  6:28 ` Kay Sievers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox