* [PATCH] Let persistent-cd rules use by-id for usb/firewire
@ 2007-03-21 18:20 Matthias Schwarzott
2007-03-21 22:27 ` Kay Sievers
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Matthias Schwarzott @ 2007-03-21 18:20 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 215 bytes --]
Hi!
I suggest to let extras/rule_generator/75-cd-aliases-generator.rules use by-id
for usb/firewire devices.
Attached patch contains a (at least for me) working solution.
Matthias
--
Matthias Schwarzott (zzam)
[-- Attachment #2: udev-106-usbcd-by-id.patch --]
[-- Type: text/x-diff, Size: 749 bytes --]
diff --git a/extras/rule_generator/75-cd-aliases-generator.rules b/extras/rule_generator/75-cd-aliases-generator.rules
index c3eb887..df44d31 100644
--- a/extras/rule_generator/75-cd-aliases-generator.rules
+++ b/extras/rule_generator/75-cd-aliases-generator.rules
@@ -1,3 +1,4 @@
# these rules generate rules for the /dev/{cdrom,dvd,...} symlinks
-ACTION=="add", SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{GENERATED}!="?*", PROGRAM="write_cd_rules", SYMLINK+="%c"
+ACTION=="add", SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", SUBSYSTEMS=="usb|ieee1394", ENV{ID_CDROM_PERSISTENCE_METHOD}="by-id"
+ACTION=="add", SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{GENERATED}!="?*", PROGRAM="write_cd_rules $env{ID_CDROM_PERSISTENCE_METHOD}", SYMLINK+="%c"
[-- Attachment #3: Type: text/plain, Size: 345 bytes --]
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
[-- Attachment #4: Type: text/plain, Size: 226 bytes --]
_______________________________________________
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 related [flat|nested] 7+ messages in thread
* Re: [PATCH] Let persistent-cd rules use by-id for usb/firewire
2007-03-21 18:20 [PATCH] Let persistent-cd rules use by-id for usb/firewire Matthias Schwarzott
@ 2007-03-21 22:27 ` Kay Sievers
2007-03-21 22:34 ` Marco d'Itri
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2007-03-21 22:27 UTC (permalink / raw)
To: linux-hotplug
On 3/21/07, Matthias Schwarzott <zzam@gentoo.org> wrote:
> I suggest to let extras/rule_generator/75-cd-aliases-generator.rules use by-id
> for usb/firewire devices.
>
> Attached patch contains a (at least for me) working solution.
At the time the script runs, you already have
ID_BUS={ata,scsi,usb,ieee1394} in the environment. Shouldn't we put
the logic, which default id-type to use in the script?
Kay
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
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] 7+ messages in thread
* Re: [PATCH] Let persistent-cd rules use by-id for usb/firewire
2007-03-21 18:20 [PATCH] Let persistent-cd rules use by-id for usb/firewire Matthias Schwarzott
2007-03-21 22:27 ` Kay Sievers
@ 2007-03-21 22:34 ` Marco d'Itri
2007-03-21 22:55 ` Matthias Schwarzott
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Marco d'Itri @ 2007-03-21 22:34 UTC (permalink / raw)
To: linux-hotplug
On Mar 21, Kay Sievers <kay.sievers@vrfy.org> wrote:
> At the time the script runs, you already have
> ID_BUS={ata,scsi,usb,ieee1394} in the environment. Shouldn't we put
> the logic, which default id-type to use in the script?
Why? I used a similar approach in the Debian package and it has the
important advantages of being easier to understand and
user-configurable.
--
ciao,
Marco
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
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] 7+ messages in thread
* Re: [PATCH] Let persistent-cd rules use by-id for usb/firewire
2007-03-21 18:20 [PATCH] Let persistent-cd rules use by-id for usb/firewire Matthias Schwarzott
2007-03-21 22:27 ` Kay Sievers
2007-03-21 22:34 ` Marco d'Itri
@ 2007-03-21 22:55 ` Matthias Schwarzott
2007-03-21 23:16 ` Kay Sievers
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Matthias Schwarzott @ 2007-03-21 22:55 UTC (permalink / raw)
To: linux-hotplug
On Mittwoch, 21. März 2007, Kay Sievers wrote:
> On 3/21/07, Matthias Schwarzott <zzam@gentoo.org> wrote:
> > I suggest to let extras/rule_generator/75-cd-aliases-generator.rules use
> > by-id for usb/firewire devices.
> >
> > Attached patch contains a (at least for me) working solution.
>
> At the time the script runs, you already have
> ID_BUS={ata,scsi,usb,ieee1394} in the environment. Shouldn't we put
> the logic, which default id-type to use in the script?
>
Sounds like a good idea :)
Matthias
--
Matthias Schwarzott (zzam)
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
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] 7+ messages in thread
* Re: [PATCH] Let persistent-cd rules use by-id for usb/firewire
2007-03-21 18:20 [PATCH] Let persistent-cd rules use by-id for usb/firewire Matthias Schwarzott
` (2 preceding siblings ...)
2007-03-21 22:55 ` Matthias Schwarzott
@ 2007-03-21 23:16 ` Kay Sievers
2007-03-22 10:03 ` Matthias Schwarzott
2007-03-22 20:11 ` Kay Sievers
5 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2007-03-21 23:16 UTC (permalink / raw)
To: linux-hotplug
On 3/21/07, Marco d'Itri <md@linux.it> wrote:
> On Mar 21, Kay Sievers <kay.sievers@vrfy.org> wrote:
>
> > At the time the script runs, you already have
> > ID_BUS={ata,scsi,usb,ieee1394} in the environment. Shouldn't we put
> > the logic, which default id-type to use in the script?
> Why? I used a similar approach in the Debian package and it has the
> important advantages of being easier to understand and
> user-configurable.
Sure, you can still pass the type down if you need. It's just that the
script could have a matching default itself.
Kay
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
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] 7+ messages in thread
* Re: [PATCH] Let persistent-cd rules use by-id for usb/firewire
2007-03-21 18:20 [PATCH] Let persistent-cd rules use by-id for usb/firewire Matthias Schwarzott
` (3 preceding siblings ...)
2007-03-21 23:16 ` Kay Sievers
@ 2007-03-22 10:03 ` Matthias Schwarzott
2007-03-22 20:11 ` Kay Sievers
5 siblings, 0 replies; 7+ messages in thread
From: Matthias Schwarzott @ 2007-03-22 10:03 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 675 bytes --]
On Mittwoch, 21. März 2007, Matthias Schwarzott wrote:
> On Mittwoch, 21. März 2007, Kay Sievers wrote:
> > On 3/21/07, Matthias Schwarzott <zzam@gentoo.org> wrote:
> > > I suggest to let extras/rule_generator/75-cd-aliases-generator.rules
> > > use by-id for usb/firewire devices.
> > >
> > > Attached patch contains a (at least for me) working solution.
> >
> > At the time the script runs, you already have
> > ID_BUS={ata,scsi,usb,ieee1394} in the environment. Shouldn't we put
> > the logic, which default id-type to use in the script?
>
> Sounds like a good idea :)
>
Try this as a sample implementation.
Matthias
--
Matthias Schwarzott (zzam)
[-- Attachment #2: udev-107-usbcd-by-id.patch --]
[-- Type: text/x-diff, Size: 412 bytes --]
diff --git a/extras/rule_generator/write_cd_rules b/extras/rule_generator/write_cd_rules
index 1dbe6b7..bd951c5 100644
--- a/extras/rule_generator/write_cd_rules
+++ b/extras/rule_generator/write_cd_rules
@@ -53,7 +53,15 @@ fi
if [ "$1" ]; then
METHOD="$1"
else
- METHOD='by-path'
+ case "$ID_BUS" in
+ usb|ieee1394)
+ METHOD='by-id'
+ ;;
+
+ *)
+ METHOD='by-path'
+ ;;
+ esac
fi
case "$METHOD" in
[-- Attachment #3: Type: text/plain, Size: 345 bytes --]
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
[-- Attachment #4: Type: text/plain, Size: 226 bytes --]
_______________________________________________
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 related [flat|nested] 7+ messages in thread
* Re: [PATCH] Let persistent-cd rules use by-id for usb/firewire
2007-03-21 18:20 [PATCH] Let persistent-cd rules use by-id for usb/firewire Matthias Schwarzott
` (4 preceding siblings ...)
2007-03-22 10:03 ` Matthias Schwarzott
@ 2007-03-22 20:11 ` Kay Sievers
5 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2007-03-22 20:11 UTC (permalink / raw)
To: linux-hotplug
On 3/22/07, Matthias Schwarzott <zzam@gentoo.org> wrote:
> On Mittwoch, 21. März 2007, Matthias Schwarzott wrote:
> > On Mittwoch, 21. März 2007, Kay Sievers wrote:
> > > On 3/21/07, Matthias Schwarzott <zzam@gentoo.org> wrote:
> > > > I suggest to let extras/rule_generator/75-cd-aliases-generator.rules
> > > > use by-id for usb/firewire devices.
> > > >
> > > > Attached patch contains a (at least for me) working solution.
> > >
> > > At the time the script runs, you already have
> > > ID_BUS={ata,scsi,usb,ieee1394} in the environment. Shouldn't we put
> > > the logic, which default id-type to use in the script?
> >
> > Sounds like a good idea :)
> >
> Try this as a sample implementation.
Looks like a good default. I've applied that.
Thanks,
Kay
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
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] 7+ messages in thread
end of thread, other threads:[~2007-03-22 20:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-21 18:20 [PATCH] Let persistent-cd rules use by-id for usb/firewire Matthias Schwarzott
2007-03-21 22:27 ` Kay Sievers
2007-03-21 22:34 ` Marco d'Itri
2007-03-21 22:55 ` Matthias Schwarzott
2007-03-21 23:16 ` Kay Sievers
2007-03-22 10:03 ` Matthias Schwarzott
2007-03-22 20:11 ` Kay Sievers
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).