From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Schweizer Date: Wed, 10 Nov 2004 23:25:26 +0000 Subject: Re: udev and cdrom permissions Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Wed, 10 Nov 2004 23:10:49 +0100, Marco d'Itri wrote: > md@wonderland:~$cat /etc/udev/simple-cd-aliases.rules > # grouping of optical drives from multiple kernel subsystems > KERNEL="sr*", NAME="%k", SYMLINK="cdrom%e" > KERNEL="scd*", NAME="%k", SYMLINK="cdrom%e" > KERNEL="pcd*", NAME="%k", SYMLINK="cdrom%e" > KERNEL="hd[a-z]", NAME="%k", SYMLINK="cdrom%e", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT="cdrom" > > md@wonderland:~$ > > Just add GROUP statements. This is a very good idea. ide-devfs.sh should be modified to also produce GROUP= output. And of course the default rule to also contain the GROUP= statement, calculated by ide-devfs.sh. Change needed to make this work: --- namedev.c.orig 2004-11-11 00:22:11.646609480 +0100 +++ namedev.c 2004-11-11 00:23:24.228575344 +0100 @@ -785,6 +785,11 @@ goto done; udev->partitions = dev->partitions; + if (dev->group[0] != '\0') { + strfieldcpy(udev->group, dev->group); + apply_format(udev, udev->group, sizeof(udev->group), class_dev, sysfs_device); + + } /* get permissions given in rule */ set_empty_perms(udev, dev->mode, in /etc/udev/rules.d/udev.rules: BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/scripts/ide-devfs.sh %k %b %n", NAME="%k", SYMLINK="%c{1} %c{2}", GROUP="%c{3}" in /etc/udev/scripts/ide-devfs.sh: echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/cd cdroms/cdrom`get_dev_number $1 cdrom` cdrom elif [ "${MEDIA}" = "floppy" ]; then echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc floppies/floppy`get_dev_number $1 floppy`/disc floppy elif [ "${MEDIA}" = "disk" ]; then echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc discs/disc`get_dev_number $1 disk`/disc disk (add the type again at the end) ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_idU88&alloc_id065&op=click _______________________________________________ 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