From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Mon, 25 Oct 2004 06:45:10 +0000 Subject: Re: udevstart.c -> kscan.c Message-Id: <20041025064510.GA16016@kroah.com> List-Id: References: <20041025063019.GB23239@fmp.com> In-Reply-To: <20041025063019.GB23239@fmp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Mon, Oct 25, 2004 at 01:30:19AM -0500, Lindsay Haisley wrote: > Here's a rather more polished, less buggy version of kscan.c, as a diff > against udevstart.c. You do realize that the current version of udev is 042, not 030, right? udevstart is radically different in the current version. Also, what you are looking for (a list of all kernel class devices) can be done with the following short bit of shell code. Feel free to add the 'KERNEL=' portion to the beginning of every line if you think it's necessary. thanks, greg k-h ------------------------ #! /bin/bash # # Directory where sysfs is mounted SYSFS_DIR=/sys # handle block devices and their partitions for i in ${SYSFS_DIR}/block/*; do # each drive echo ${i#${SYSFS_DIR}/block/} # each partition, on each device for j in $i/*; do if [ -f $j/dev ]; then echo ${j#${SYSFS_DIR}} | cut --delimiter='/' --fields=4- fi done done # all other device classes for i in ${SYSFS_DIR}/class/*; do for j in $i/*; do if [ -f $j/dev ]; then echo ${j#${SYSFS_DIR}} | cut --delimiter='/' --fields=4- fi done done ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ 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