Skip to contentSkip to conversation

udev.rules syntax question

DISCUSSION Jeremy Higdon 4 participants 7 messages Nov 23, 2004

lore
Share & tools
lore
#0 lore raw

Hello,

I have a rules file with the following rules:

BUS="scsi", PROGRAM="/sbin/udev_xscsi", SYMLINK="%c"
BUS="scsi", PROGRAM="/sbin/udev.get_persistent_device_name.sh", NAME="%k" SYMLINK="%c{1+}"

By my reading of the documentation, both rules should provide a symlink to the canonical name (/dev/sda, or whatever).

However, I only get the symlinks from the second rule. If I change the first line to:

BUS="scsi", PROGRAM="/sbin/udev_xscsi", NAME="%k" SYMLINK="%c"

then I only get the symlink from the first rule.

I'm running udev version 021, if that makes a difference.

thanks

jeremy

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 11 lines · Jeremy Higdon

Hello,

I have a rules file with the following rules:

BUS="scsi", PROGRAM="/sbin/udev_xscsi", SYMLINK="%c"
BUS="scsi", PROGRAM="/sbin/udev.get_persistent_device_name.sh", NAME="%k" SYMLINK="%c{1+}"

By my reading of the documentation, both rules should provide a symlink to the canonical name (/dev/sda, or whatever).

Quoted 7 lines

However, I only get the symlinks from the second rule. If I change the first line to:

BUS="scsi", PROGRAM="/sbin/udev_xscsi", NAME="%k" SYMLINK="%c"

then I only get the symlink from the first rule.

That should work, right.

Quoted 1 line

I'm running udev version 021, if that makes a difference.

Huh, that's 9 months old, the whole project is 20 months old :) So you may try an update, we are at v046 now :)

That may be the reason:
http://linuxusb.bkbits.net:8080/udev/cset@4061c688A1oxsmFdksypgMHPeY9kEA

Kay

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Jeremy Higdon
Quoted 22 lines · Kay Sievers
Quoted 11 lines · Jeremy Higdon

Hello,

I have a rules file with the following rules:

BUS="scsi", PROGRAM="/sbin/udev_xscsi", SYMLINK="%c"
BUS="scsi", PROGRAM="/sbin/udev.get_persistent_device_name.sh", NAME="%k" SYMLINK="%c{1+}"

By my reading of the documentation, both rules should provide a symlink to the canonical name (/dev/sda, or whatever).

Quoted 7 lines

However, I only get the symlinks from the second rule. If I change the first line to:

BUS="scsi", PROGRAM="/sbin/udev_xscsi", NAME="%k" SYMLINK="%c"

then I only get the symlink from the first rule.

That should work, right.

Quoted 7 lines
Quoted 1 line

I'm running udev version 021, if that makes a difference.

Huh, that's 9 months old, the whole project is 20 months old :) So you may try an update, we are at v046 now :)

That may be the reason:
http://linuxusb.bkbits.net:8080/udev/cset@4061c688A1oxsmFdksypgMHPeY9kEA

I'd like to upgrade, but I need to work with what's in SLES9. That change along with the one before and after took care of the problem. I thought I was following the rules in the manpage :-)

Thanks for the reply,

jeremy

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Jeremy Higdon
Quoted 4 lines · Jeremy Higdon

I'd like to upgrade, but I need to work with what's in SLES9. That change along with the one before and after took care of the problem. I thought I was following the rules in the manpage :-)

You were, those patches were bugfixes :)

You might want to pester SuSE to fix this in their next SLES9 service pack release.

thanks,

greg k-h

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to Jeremy Higdon
Quoted 16 lines · Kay Sievers
Quoted 14 lines · Jeremy Higdon

Hello,

I have a rules file with the following rules:

BUS="scsi", PROGRAM="/sbin/udev_xscsi", SYMLINK="%c"
BUS="scsi", PROGRAM="/sbin/udev.get_persistent_device_name.sh", NAME="%k" SYMLINK="%c{1+}"

By my reading of the documentation, both rules should provide a symlink to the canonical name (/dev/sda, or whatever).

However, I only get the symlinks from the second rule. If I change the first line to:

Quoted 8 lines
Quoted 4 lines

BUS="scsi", PROGRAM="/sbin/udev_xscsi", NAME="%k" SYMLINK="%c"

then I only get the symlink from the first rule.

That should work, right.

Should it? IIRC the parsing stops after the first matched rule. Or has this behaviour changed?

Quoted 11 lines
Quoted 2 lines

I'm running udev version 021, if that makes a difference.

Huh, that's 9 months old, the whole project is 20 months old :) So you may try an update, we are at v046 now :)

That may be the reason:
http://linuxusb.bkbits.net:8080/udev/cset@4061c688A1oxsmFdksypgMHPeY9kEA

Ok, you're correct. I will put that in. Jeremy, care to open a SuSE bugzilla?

Cheers,

Hannes

Signature · 15 lines
Dr. Hannes Reinecke			[email protected]
SuSE Linux AG				S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#5 lore raw
In reply to Jeremy Higdon
Quoted 20 lines · Hannes Reinecke
Quoted 19 lines · Kay Sievers
Quoted 17 lines · Jeremy Higdon

Hello,

I have a rules file with the following rules:

BUS="scsi", PROGRAM="/sbin/udev_xscsi", SYMLINK="%c"
BUS="scsi", PROGRAM="/sbin/udev.get_persistent_device_name.sh", NAME="%k" SYMLINK="%c{1+}"

By my reading of the documentation, both rules should provide a symlink to the canonical name (/dev/sda, or whatever).

However, I only get the symlinks from the second rule. If I change the first line to:

BUS="scsi", PROGRAM="/sbin/udev_xscsi", NAME="%k" SYMLINK="%c"

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

then I only get the symlink from the first rule.

That should work, right.

Should it? IIRC the parsing stops after the first matched rule. Or has this behaviour changed?

No, we have this a long time. It is called "symlink only rule". You can collect matching rules with only SYMLINK and no NAME, all symlinks are going to be appended to the symlink string of the finally matching rule. It's in the man page.

Best,
Kay

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#6 lore raw
In reply to Jeremy Higdon
Quoted 12 lines · Kay Sievers
Quoted 3 lines · Hannes Reinecke

Should it? IIRC the parsing stops after the first matched rule. Or has this behaviour changed?

No, we have this a long time. It is called "symlink only rule". You can collect matching rules with only SYMLINK and no NAME, all symlinks are going to be appended to the symlink string of the finally matching rule. It's in the man page.

So I'll better fix it then :-)

Cheers,

Hannes

Signature · 15 lines
Dr. Hannes Reinecke			[email protected]
SuSE Linux AG				S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel