linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: %c option does not handle LF as a seperator
@ 2004-03-03  0:36 Sabharwal, Atul
  2004-03-03  0:42 ` Greg KH
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Sabharwal, Atul @ 2004-03-03  0:36 UTC (permalink / raw)
  To: linux-hotplug

 
> Greg,
> 
> There is a problem with %c as it only accepts the space de-limitted
> fields. The last
> Field may be <LF> delimitted rather than space de-limitted. 
> 
> I am not able to reference the last field. My rules is like
> 
> BUS="scsi", PROGRAM="/sbin/scsi_id", RESULT="SSEAGATE ST318436LW
> 3BM07NKA000070456Z6B", 
>   NAME="disk-sda-%c{3}"
> 
> %c{1} & %c{2} options in NAME key work fine. %c{0} gives whole string
> and %c{3} does not work
> Although it should return the serial number.

--
Atul


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id\x1356&alloc_id438&opÌk
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: %c option does not handle LF as a seperator
  2004-03-03  0:36 %c option does not handle LF as a seperator Sabharwal, Atul
@ 2004-03-03  0:42 ` Greg KH
  2004-03-03  0:46 ` Kay Sievers
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Greg KH @ 2004-03-03  0:42 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Mar 02, 2004 at 04:36:57PM -0800, Sabharwal, Atul wrote:
>  
> > Greg,
> > 
> > There is a problem with %c as it only accepts the space de-limitted
> > fields. The last
> > Field may be <LF> delimitted rather than space de-limitted. 
> > 
> > I am not able to reference the last field. My rules is like
> > 
> > BUS="scsi", PROGRAM="/sbin/scsi_id", RESULT="SSEAGATE ST318436LW
> > 3BM07NKA000070456Z6B", 
> >   NAME="disk-sda-%c{3}"
> > 
> > %c{1} & %c{2} options in NAME key work fine. %c{0} gives whole string
> > and %c{3} does not work
> > Although it should return the serial number.

Care to send a patch?  Or how about a scsi_id fix?

thanks,

greg k-h


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id\x1356&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* RE: %c option does not handle LF as a seperator
  2004-03-03  0:36 %c option does not handle LF as a seperator Sabharwal, Atul
  2004-03-03  0:42 ` Greg KH
@ 2004-03-03  0:46 ` Kay Sievers
  2004-03-03  0:51 ` Sabharwal, Atul
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Kay Sievers @ 2004-03-03  0:46 UTC (permalink / raw)
  To: linux-hotplug

On Wed, 2004-03-03 at 01:36, Sabharwal, Atul wrote:
>  > Greg,
> > 
> > There is a problem with %c as it only accepts the space de-limitted
> > fields. The last
> > Field may be <LF> delimitted rather than space de-limitted. 
> > 
> > I am not able to reference the last field. My rules is like
> > 
> > BUS="scsi", PROGRAM="/sbin/scsi_id", RESULT="SSEAGATE ST318436LW
> > 3BM07NKA000070456Z6B", 
> >   NAME="disk-sda-%c{3}"
> > 
> > %c{1} & %c{2} options in NAME key work fine. %c{0} gives whole string
> > and %c{3} does not work
> > Although it should return the serial number.

You may try:

  RESULT="SSEAGATE ST318436LW?3BM07NKA000070456Z6B"

or

  RESULT="SSEAGATE ST318436LW*3BM07NKA000070456Z6B"


Please report if it works.

Kay



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id\x1356&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* RE: %c option does not handle LF as a seperator
  2004-03-03  0:36 %c option does not handle LF as a seperator Sabharwal, Atul
  2004-03-03  0:42 ` Greg KH
  2004-03-03  0:46 ` Kay Sievers
@ 2004-03-03  0:51 ` Sabharwal, Atul
  2004-03-03  1:02 ` Kay Sievers
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Sabharwal, Atul @ 2004-03-03  0:51 UTC (permalink / raw)
  To: linux-hotplug

I do not have a patch ready. I found a bug and thought it would be good
to report
It.  Once, I have a patch ready, I will surely e-mail it to you as I
have been
Trying fixes for scsi_id.

Hope that works out well for you.

Regards,

Atul

-------------------------------------------------------------
P.S:  All opinions are my personal opinion(s) & responsibility and do
not represent the view of my employer ( Intel Corporation ).

-----Original Message-----
From: Greg KH [mailto:greg@kroah.com] 
Sent: Tuesday, March 02, 2004 4:43 PM
To: Sabharwal, Atul
Cc: Caushik, Ramesh; linux-hotplug-devel@lists.sourceforge.net
Subject: Re: %c option does not handle LF as a seperator

On Tue, Mar 02, 2004 at 04:36:57PM -0800, Sabharwal, Atul wrote:
>  
> > Greg,
> > 
> > There is a problem with %c as it only accepts the space de-limitted
> > fields. The last
> > Field may be <LF> delimitted rather than space de-limitted. 
> > 
> > I am not able to reference the last field. My rules is like
> > 
> > BUS="scsi", PROGRAM="/sbin/scsi_id", RESULT="SSEAGATE ST318436LW
> > 3BM07NKA000070456Z6B", 
> >   NAME="disk-sda-%c{3}"
> > 
> > %c{1} & %c{2} options in NAME key work fine. %c{0} gives whole
string
> > and %c{3} does not work
> > Although it should return the serial number.

Care to send a patch?  Or how about a scsi_id fix?

thanks,

greg k-h



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id\x1356&alloc_id438&opÌk
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* RE: %c option does not handle LF as a seperator
  2004-03-03  0:36 %c option does not handle LF as a seperator Sabharwal, Atul
                   ` (2 preceding siblings ...)
  2004-03-03  0:51 ` Sabharwal, Atul
@ 2004-03-03  1:02 ` Kay Sievers
  2004-03-03  1:06 ` Sabharwal, Atul
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Kay Sievers @ 2004-03-03  1:02 UTC (permalink / raw)
  To: linux-hotplug

On Wed, 2004-03-03 at 01:46, Kay Sievers wrote:
> On Wed, 2004-03-03 at 01:36, Sabharwal, Atul wrote:
> >  > Greg,
> > > 
> > > There is a problem with %c as it only accepts the space de-limitted
> > > fields. The last
> > > Field may be <LF> delimitted rather than space de-limitted. 
> > > 
> > > I am not able to reference the last field. My rules is like
> > > 
> > > BUS="scsi", PROGRAM="/sbin/scsi_id", RESULT="SSEAGATE ST318436LW
> > > 3BM07NKA000070456Z6B", 
> > >   NAME="disk-sda-%c{3}"
> > > 
> > > %c{1} & %c{2} options in NAME key work fine. %c{0} gives whole string
> > > and %c{3} does not work
> > > Although it should return the serial number.
> 
> You may try:
> 
>   RESULT="SSEAGATE ST318436LW?3BM07NKA000070456Z6B"
> 
> or
> 
>   RESULT="SSEAGATE ST318436LW*3BM07NKA000070456Z6B"

Sorry, I didn't see that you want to use the serial number in
the node name. With the model name prepended it may work,
but sure that's not really the same :)

I will look if I can do something for you with the %c{num} logic.

thanks,
Kay



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id\x1356&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* RE: %c option does not handle LF as a seperator
  2004-03-03  0:36 %c option does not handle LF as a seperator Sabharwal, Atul
                   ` (3 preceding siblings ...)
  2004-03-03  1:02 ` Kay Sievers
@ 2004-03-03  1:06 ` Sabharwal, Atul
  2004-03-03  1:14 ` Patrick Mansfield
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Sabharwal, Atul @ 2004-03-03  1:06 UTC (permalink / raw)
  To: linux-hotplug

IMHO, this is a small bug in namedev. Putting ? Or * in result field
does not make
Any difference as the rule will trigger but the string seperator is a
space. The
strsep() function can work of multiple seperators ( line 285 in
namedev.c ) but I 
Am not sure by just adding LF to the list of seperators would fix it.

--
Atul


-------------------------------------------------------------
P.S:  All opinions are my personal opinion(s) & responsibility and do
not represent the view of my employer ( Intel Corporation ).

-----Original Message-----
From: Kay Sievers [mailto:kay.sievers@vrfy.org] 
Sent: Tuesday, March 02, 2004 4:46 PM
To: Sabharwal, Atul
Cc: Greg KH; gregkh@us.ibm.com; Caushik, Ramesh;
linux-hotplug-devel@lists.sourceforge.net
Subject: RE: %c option does not handle LF as a seperator

On Wed, 2004-03-03 at 01:36, Sabharwal, Atul wrote:
>  > Greg,
> > 
> > There is a problem with %c as it only accepts the space de-limitted
> > fields. The last
> > Field may be <LF> delimitted rather than space de-limitted. 
> > 
> > I am not able to reference the last field. My rules is like
> > 
> > BUS="scsi", PROGRAM="/sbin/scsi_id", RESULT="SSEAGATE ST318436LW
> > 3BM07NKA000070456Z6B", 
> >   NAME="disk-sda-%c{3}"
> > 
> > %c{1} & %c{2} options in NAME key work fine. %c{0} gives whole
string
> > and %c{3} does not work
> > Although it should return the serial number.

You may try:

  RESULT="SSEAGATE ST318436LW?3BM07NKA000070456Z6B"

or

  RESULT="SSEAGATE ST318436LW*3BM07NKA000070456Z6B"


Please report if it works.

Kay




-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id\x1356&alloc_id438&opÌk
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: %c option does not handle LF as a seperator
  2004-03-03  0:36 %c option does not handle LF as a seperator Sabharwal, Atul
                   ` (4 preceding siblings ...)
  2004-03-03  1:06 ` Sabharwal, Atul
@ 2004-03-03  1:14 ` Patrick Mansfield
  2004-03-03  1:23 ` Sabharwal, Atul
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Patrick Mansfield @ 2004-03-03  1:14 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Mar 02, 2004 at 04:42:43PM -0800, Greg KH wrote:
> On Tue, Mar 02, 2004 at 04:36:57PM -0800, Sabharwal, Atul wrote:
> >  
> > > Greg,
> > > 
> > > There is a problem with %c as it only accepts the space de-limitted
> > > fields. The last
> > > Field may be <LF> delimitted rather than space de-limitted. 
> > > 
> > > I am not able to reference the last field. My rules is like
> > > 
> > > BUS="scsi", PROGRAM="/sbin/scsi_id", RESULT="SSEAGATE ST318436LW
> > > 3BM07NKA000070456Z6B", 
> > >   NAME="disk-sda-%c{3}"
> > > 
> > > %c{1} & %c{2} options in NAME key work fine. %c{0} gives whole string
> > > and %c{3} does not work
> > > Although it should return the serial number.
> 
> Care to send a patch?  Or how about a scsi_id fix?

I haven't ever seen a LF in the SCSI vendor, model, or page 0x80. I am not
sure if it is allowed by the standards.

There should be more spaces after the "ST318436LW", since there are 16
bytes for the model and it is space filled ('S' followed by vendor 8
bytes, model 16 bytes, and the serial number of variable size).

Are you certain that rule is matching? Did your editor auto-wrap that
line? i.e. does /sbin/scsi_id -s /block/sda (or whatever the kernel name)
output have a line feed?

-- Patrick Mansfield


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id\x1356&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* RE: %c option does not handle LF as a seperator
  2004-03-03  0:36 %c option does not handle LF as a seperator Sabharwal, Atul
                   ` (5 preceding siblings ...)
  2004-03-03  1:14 ` Patrick Mansfield
@ 2004-03-03  1:23 ` Sabharwal, Atul
  2004-03-03  1:32 ` Sabharwal, Atul
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Sabharwal, Atul @ 2004-03-03  1:23 UTC (permalink / raw)
  To: linux-hotplug

I am not sure what the end marker is when /sbin/scsi_id returns. The
strsep()
call is set with space delimitter and the output is "Seagate <model #>
<serial#>" 

The end marker would be either a NULL or a LF. The actual part is %c{3}
should
give the serial number as I referred it in NAME="disk-%c{3}" field.
--
Atul


-------------------------------------------------------------
P.S:  All opinions are my personal opinion(s) & responsibility and do
not represent the view of my employer ( Intel Corporation ).

-----Original Message-----
From: Patrick Mansfield [mailto:patmans@us.ibm.com] 
Sent: Tuesday, March 02, 2004 5:14 PM
To: Greg KH
Cc: Sabharwal, Atul; Caushik, Ramesh;
linux-hotplug-devel@lists.sourceforge.net
Subject: Re: %c option does not handle LF as a seperator

On Tue, Mar 02, 2004 at 04:42:43PM -0800, Greg KH wrote:
> On Tue, Mar 02, 2004 at 04:36:57PM -0800, Sabharwal, Atul wrote:
> >  
> > > Greg,
> > > 
> > > There is a problem with %c as it only accepts the space
de-limitted
> > > fields. The last
> > > Field may be <LF> delimitted rather than space de-limitted. 
> > > 
> > > I am not able to reference the last field. My rules is like
> > > 
> > > BUS="scsi", PROGRAM="/sbin/scsi_id", RESULT="SSEAGATE ST318436LW
> > > 3BM07NKA000070456Z6B", 
> > >   NAME="disk-sda-%c{3}"
> > > 
> > > %c{1} & %c{2} options in NAME key work fine. %c{0} gives whole
string
> > > and %c{3} does not work
> > > Although it should return the serial number.
> 
> Care to send a patch?  Or how about a scsi_id fix?

I haven't ever seen a LF in the SCSI vendor, model, or page 0x80. I am
not
sure if it is allowed by the standards.

There should be more spaces after the "ST318436LW", since there are 16
bytes for the model and it is space filled ('S' followed by vendor 8
bytes, model 16 bytes, and the serial number of variable size).

Are you certain that rule is matching? Did your editor auto-wrap that
line? i.e. does /sbin/scsi_id -s /block/sda (or whatever the kernel
name)
output have a line feed?

-- Patrick Mansfield



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id\x1356&alloc_id438&opÌk
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* RE: %c option does not handle LF as a seperator
  2004-03-03  0:36 %c option does not handle LF as a seperator Sabharwal, Atul
                   ` (6 preceding siblings ...)
  2004-03-03  1:23 ` Sabharwal, Atul
@ 2004-03-03  1:32 ` Sabharwal, Atul
  2004-03-03  1:59 ` Kay Sievers
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Sabharwal, Atul @ 2004-03-03  1:32 UTC (permalink / raw)
  To: linux-hotplug

 
I haven't ever seen a LF in the SCSI vendor, model, or page 0x80. I am
not
sure if it is allowed by the standards.

There should be more spaces after the "ST318436LW", since there are 16
bytes for the model and it is space filled ('S' followed by vendor 8
bytes, model 16 bytes, and the serial number of variable size).

Are you certain that rule is matching? Did your editor auto-wrap that
line? i.e. does /sbin/scsi_id -s /block/sda (or whatever the kernel
name)
output have a line feed?

>> The rule is matching as disk-sda is being created. It like %c{3}
returned
   a Null.  In other cases I get disk-sda<vendor_name> and
disk-sda<model#>
   when I use c{1} and c{2}. Its c{3} when this does not work.

   --
   Atul




-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id\x1356&alloc_id438&opÌk
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: %c option does not handle LF as a seperator
  2004-03-03  0:36 %c option does not handle LF as a seperator Sabharwal, Atul
                   ` (7 preceding siblings ...)
  2004-03-03  1:32 ` Sabharwal, Atul
@ 2004-03-03  1:59 ` Kay Sievers
  2004-03-03  2:28 ` Sabharwal, Atul
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Kay Sievers @ 2004-03-03  1:59 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 327 bytes --]

On Tue, Mar 02, 2004 at 05:06:53PM -0800, Sabharwal, Atul wrote:
>  but I Am not sure by just adding LF to the list of seperators would fix it.

Seems so, it works for me. You may try it if you like:

   BUS="scsi", PROGRAM="/sbin/scsi_id", RESULT="SSEAGATE ST318436LW*3BM07NKA000070456Z6B", NAME="disk-sda-%c{3}"

thanks,
Kay

[-- Attachment #2: 01-multiline-result.patch --]
[-- Type: text/plain, Size: 363 bytes --]

===== namedev.c 1.121 vs edited =====
--- 1.121/namedev.c	Tue Mar  2 01:02:05 2004
+++ edited/namedev.c	Wed Mar  3 02:35:03 2004
@@ -282,7 +282,7 @@
 				pos2 = temp1;
 				while (i) {
 					i--;
-					pos3 = strsep(&pos2, " ");
+					pos3 = strsep(&pos2, " \n\r");
 					if (pos3 == NULL) {
 						dbg("requested part of result string not found");
 						break;

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

* RE: %c option does not handle LF as a seperator
  2004-03-03  0:36 %c option does not handle LF as a seperator Sabharwal, Atul
                   ` (8 preceding siblings ...)
  2004-03-03  1:59 ` Kay Sievers
@ 2004-03-03  2:28 ` Sabharwal, Atul
  2004-03-04 12:05 ` Hannes Reinecke
  2004-03-04 22:51 ` Patrick Mansfield
  11 siblings, 0 replies; 13+ messages in thread
From: Sabharwal, Atul @ 2004-03-03  2:28 UTC (permalink / raw)
  To: linux-hotplug

It still does not work for me. 

--
Atul 


-------------------------------------------------------------
P.S:  All opinions are my personal opinion(s) & responsibility and do
not represent the view of my employer ( Intel Corporation ).

-----Original Message-----
From: Kay Sievers [mailto:kay.sievers@vrfy.org] 
Sent: Tuesday, March 02, 2004 5:59 PM
To: Sabharwal, Atul
Cc: Greg KH; gregkh@us.ibm.com; Caushik, Ramesh;
linux-hotplug-devel@lists.sourceforge.net
Subject: Re: %c option does not handle LF as a seperator

On Tue, Mar 02, 2004 at 05:06:53PM -0800, Sabharwal, Atul wrote:
>  but I Am not sure by just adding LF to the list of seperators would
fix it.

Seems so, it works for me. You may try it if you like:

   BUS="scsi", PROGRAM="/sbin/scsi_id", RESULT="SSEAGATE
ST318436LW*3BM07NKA000070456Z6B", NAME="disk-sda-%c{3}"

thanks,
Kay



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id\x1356&alloc_id438&opÌk
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: %c option does not handle LF as a seperator
  2004-03-03  0:36 %c option does not handle LF as a seperator Sabharwal, Atul
                   ` (9 preceding siblings ...)
  2004-03-03  2:28 ` Sabharwal, Atul
@ 2004-03-04 12:05 ` Hannes Reinecke
  2004-03-04 22:51 ` Patrick Mansfield
  11 siblings, 0 replies; 13+ messages in thread
From: Hannes Reinecke @ 2004-03-04 12:05 UTC (permalink / raw)
  To: linux-hotplug

Patrick Mansfield wrote:
> On Tue, Mar 02, 2004 at 04:42:43PM -0800, Greg KH wrote:
> 
>>On Tue, Mar 02, 2004 at 04:36:57PM -0800, Sabharwal, Atul wrote:
>>
>>> 
>>>
>>>>Greg,
>>>>
>>>>There is a problem with %c as it only accepts the space de-limitted
>>>>fields. The last
>>>>Field may be <LF> delimitted rather than space de-limitted. 
>>>>
>>>>I am not able to reference the last field. My rules is like
>>>>
>>>>BUS="scsi", PROGRAM="/sbin/scsi_id", RESULT="SSEAGATE ST318436LW
>>>>3BM07NKA000070456Z6B", 
>>>>  NAME="disk-sda-%c{3}"
>>>>
>>>>%c{1} & %c{2} options in NAME key work fine. %c{0} gives whole string
>>>>and %c{3} does not work
>>>>Although it should return the serial number.
>>
>>Care to send a patch?  Or how about a scsi_id fix?
> 
> 
> I haven't ever seen a LF in the SCSI vendor, model, or page 0x80. I am not
> sure if it is allowed by the standards.
> 
It's not. At least not for page 0x80:

ASCII data fields shall contain only ASCII graphic codes (i.e., code 
values 20h through 7Eh) (from SPC-3).

But actually it's not page 0x80 which is the culprit (0x80 returns only 
the serial number, which seems to be ok), but rather the model name 
(from INQUIRY or page 0x83).

What does the device say at initialisation?
There should be boot messages from the SCSI layer; if something's dodgy 
with the data it should show up there, too.

Care to send me the output of dmesg?

Cheers,

Hannes
-- 
Dr. Hannes Reinecke			hare@suse.de
SuSE Linux AG				S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: %c option does not handle LF as a seperator
  2004-03-03  0:36 %c option does not handle LF as a seperator Sabharwal, Atul
                   ` (10 preceding siblings ...)
  2004-03-04 12:05 ` Hannes Reinecke
@ 2004-03-04 22:51 ` Patrick Mansfield
  11 siblings, 0 replies; 13+ messages in thread
From: Patrick Mansfield @ 2004-03-04 22:51 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Mar 04, 2004 at 01:05:27PM +0100, Hannes Reinecke wrote:
> Patrick Mansfield wrote:
> > On Tue, Mar 02, 2004 at 04:42:43PM -0800, Greg KH wrote:
> > 
> >>On Tue, Mar 02, 2004 at 04:36:57PM -0800, Sabharwal, Atul wrote:

> >>>>
> >>>>BUS="scsi", PROGRAM="/sbin/scsi_id", RESULT="SSEAGATE ST318436LW
> >>>>3BM07NKA000070456Z6B", 
> >>>>  NAME="disk-sda-%c{3}"
> >>>>

> > I haven't ever seen a LF in the SCSI vendor, model, or page 0x80. I am not
> > sure if it is allowed by the standards.
> > 
> It's not. At least not for page 0x80:
> 
> ASCII data fields shall contain only ASCII graphic codes (i.e., code 
> values 20h through 7Eh) (from SPC-3).
> 
> But actually it's not page 0x80 which is the culprit (0x80 returns only 
> the serial number, which seems to be ok), but rather the model name 
> (from INQUIRY or page 0x83).
> 
> What does the device say at initialisation?
> There should be boot messages from the SCSI layer; if something's dodgy 
> with the data it should show up there, too.
> 
> Care to send me the output of dmesg?

In working to debug the problem, I got offlist email from Atul (using od,
so the mind numbing line wrapping was not an issue) showing no linefeeds
or such in the model, vendor, or scsi_id output.

-- Patrick Mansfield


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

end of thread, other threads:[~2004-03-04 22:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-03  0:36 %c option does not handle LF as a seperator Sabharwal, Atul
2004-03-03  0:42 ` Greg KH
2004-03-03  0:46 ` Kay Sievers
2004-03-03  0:51 ` Sabharwal, Atul
2004-03-03  1:02 ` Kay Sievers
2004-03-03  1:06 ` Sabharwal, Atul
2004-03-03  1:14 ` Patrick Mansfield
2004-03-03  1:23 ` Sabharwal, Atul
2004-03-03  1:32 ` Sabharwal, Atul
2004-03-03  1:59 ` Kay Sievers
2004-03-03  2:28 ` Sabharwal, Atul
2004-03-04 12:05 ` Hannes Reinecke
2004-03-04 22:51 ` Patrick Mansfield

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).