Kernel page, once again

Remco remco at d-compu.dyndns.org
Mon Jun 14 02:21:12 PDT 2004


Ian Molton wrote:

> 
> I'd also prefer to use /dev/discs/discN/* in udev too but havent got
> around to working out how yet.

For IDE devices, you may want to consider using the script 'ide-devfs.sh' in
the extras directory of the udev sources. It creates devfs-like device
nodes, like /dev/ide/host?/bus?/target?/lun?/{disc,part?} and a
corresponding /dev/discs/disc?/{disc,part?} or /dev/cdroms/cdrom? node.

The default rule as mentioned in the script is:
BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/ide-devfs.sh %k %b %n",
NAME="%k", SYMLINK="%c{1} %c{2}"

For devices hda, hda1 it will create /dev/hda and symlinks
'/dev/ide/host0/bus0/target0/lun0/disc' and '/dev/discs/disc0/disc', and
for /dev/hda1, symlinks '/dev/ide/host0/bus0/target0/lun0/part1' and
'/dev/discs/disc0/part1'

I don't like the /dev/hd* nodes so I use a rule:
# IDE - hd* (CD and HD) devices
BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/ide-devfs.sh %k %b %n",
NAME="%c{1}", SYMLINK="%c{2}"

It creates device nodes '/dev/ide/host0/bus0/target0/lun0/disc' and
'/dev/ide/host0/bus0/target0/lun0/part1', and corresponding symlinks
'/dev/discs/disc0/disc' and '/dev/discs/disc0/part1'


(I just saw that the script has a similar translation for floppy too)




More information about the lfs-dev mailing list