On Wednesday 14 July 2010 22:12:32 Dale wrote:
> Alan McKinnon wrote:
> > On Wednesday 14 July 2010 09:58:02 Stéphane Guedon wrote:
> >> I agree with you, but I like to make things in order with the rules
> >> (without  relation to udev).
> >> 
> >> But I don't like udev, its syntax is really hard to understand for user
> >> !
> > 
> > Dale, here's your chance to jump in and comment.
> > 
> > This user *obviously* never had to deal with hal.
> 
> Oh crap.  You mean udev uses xml config files too?  Well, at least udev
> hasn't broke my keyboard and mouse.  lol   I don't have to much trouble
> with udev.  Heck, the one time I did, I deleted all the config files and
> re-emerged the thing.  Worked great then.  I think one got messed up
> somehow.
> 
> Dale
> 
> :-)  :-)

No, not XML. It uses something MUCH better. It uses this:

$ cat rules.d/70-persistent-cd.rules 
# This file was automatically generated by the /lib64/udev/write_cd_rules
# program, probably run by the cd-aliases-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line
# and set the $GENERATED variable.

# DVD+-RW_AD-7640A (pci-0000:00:1f.1-scsi-0:0:0:0)
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-0:0:0:0", 
SYMLINK+="cdrom", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-0:0:0:0", 
SYMLINK+="cdrw", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-0:0:0:0", 
SYMLINK+="dvd", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-0:0:0:0", 
SYMLINK+="dvdrw", ENV{GENERATED}="1"
# Mass_Storage (pci-0000:00:1d.0-usb-0:2:1.2-scsi-0:0:0:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", 
ENV{ID_SERIAL}=="HUAWEI_Mass_Storage-0:0", SYMLINK+="cdrom1", 
ENV{GENERATED}="1"



See how fantastic this is? See how this conforms to The One True (Unix) Way?

See how it looks nothing like XML (invented by a Windows user, obviously), and 
actually looks a lot like perl with regexes?

On second thoughts, it looks nothing like perl. There aren't enough $, @ and % 
symbols in it. But the regex bit stands.

:-)


-- 
alan dot mckinnon at gmail dot com

Reply via email to