Linux Hotplug development
 help / color / mirror / Atom feed
From: Yan Zhang <yanzhang012@yahoo.com>
To: linux-hotplug@vger.kernel.org
Subject: Seek help on rule
Date: Wed, 05 May 2010 05:23:38 +0000	[thread overview]
Message-ID: <851760.15837.qm@web56001.mail.re3.yahoo.com> (raw)

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


      


             reply	other threads:[~2010-05-05  5:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-05  5:23 Yan Zhang [this message]
2010-05-05  6:28 ` Seek help on rule Kay Sievers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=851760.15837.qm@web56001.mail.re3.yahoo.com \
    --to=yanzhang012@yahoo.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox