SCIENTIFIC-LINUX-USERS Archives

March 2010

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Stodola <[log in to unmask]>
Reply To:
Mark Stodola <[log in to unmask]>
Date:
Fri, 5 Mar 2010 08:16:16 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (40 lines)
Tim Edwards wrote:
> We have a process here were users must push files onto USB disks. The
> user logs in remotely to a machine which may have many USB disks
> attached and he/she knows the serial number of the disk to write to.
>
> In trying to do away with some complex, hacky scripts I'm trying to
> udev-ise this. Ie. when a USB disk is plugged into the machine a symlink
> to it is made that is /dev/disknumber-123456 where '123456' is the
> serial number of the disk.
>
> My udev rule is:
> KERNEL=="sd*", SUBSYSTEMS=="scsi", SYMLINK+="disknumber-%E{serial}"
> It can create devices with symlink '/dev/disknumber-' but the
> substitution of the ATRR{serial} bit seems to be impossible to get working.
>
> The man page is usual includes no examples which might actually give me
> the context I need to properly understand the 'printf-like substitution'
> syntax that the developers are talking about.
>
> Tim Edwards
>   
Tim,

I think you are confusing sysfs with environment variables.  the %E{key} 
is used for environment variables.  The serial number is a SYSFS 
attribute.  Try changing %E{serial} to %s{serial} and see if it works.

Cheers,
Mark

-- 
Mr. Mark V. Stodola
Digital Systems Engineer

National Electrostatics Corp.
P.O. Box 620310
Middleton, WI 53562-0310 USA
Phone: (608) 831-7600
Fax: (608) 831-9591

ATOM RSS1 RSS2