On Thu, Nov 13, 2003 at 11:49:03AM -0800, Greg KH wrote: > On Thu, Nov 13, 2003 at 09:30:08AM +0100, Kay Sievers wrote: > > Yes, it doesn't append the number when a label is specified for a > > partition. But what when i want my partition labeled "data" not "data1" > > LABEL, BUS="ide", size="117210177", NAME="data" > > Problem is, if you use the LABEL rule to match a device, like a SCSI > vendor, then all of the partitions, as well as the main block device, > will end up with the same name. That's why I added the "add the number" > hack to the LABEL rule. > > So yes, your patch is correct in that we shouldn't always be adding the > number to any match for LABEL (like for char devices), but if we do > that, then we break partitions. Your '%' patch fixes this, but I'd just > like to extend it a bit. Let me see what I can come up with... Oh, I see. Do you mean something like this: LABEL, BUS="usb", model="Creative Labs WebCam 3", NAME="webcam%n-%M:%m-test" results in: "webcam0-81:0-test" Nov 15 16:51:53 pim udev[16193]: get_class_dev: looking at /sys/class/video4linux/video0 Nov 15 16:51:53 pim udev[16193]: get_class_dev: class_dev->name = video0 Nov 15 16:51:53 pim udev[16193]: get_major_minor: dev = 81:0 Nov 15 16:51:53 pim udev[16193]: get_major_minor: found major = 81, minor = 0 Nov 15 16:51:53 pim udev[16193]: udev_add_device: name = webcam0-81:0-test Nov 15 16:51:53 pim udev[16193]: create_node: mknod(/udev/webcam0-81:0-test, 020666, 81, 0) thanks, Kay 04-udev-add.c-minor_before_namedev.diff move get_major_minor() before namedev_name_device(), so namedev knows major/minor of device 04-namedev.c-multiple-placeholder-support.diff implement printf-like placeholder support for NAME %n-kernel number, %M-major number, %m-minor number