linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: udevstart.c -> kscan.c
Date: Mon, 25 Oct 2004 06:45:10 +0000	[thread overview]
Message-ID: <20041025064510.GA16016@kroah.com> (raw)
In-Reply-To: <20041025063019.GB23239@fmp.com>

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

  reply	other threads:[~2004-10-25  6:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-25  6:30 udevstart.c -> kscan.c Lindsay Haisley
2004-10-25  6:45 ` Greg KH [this message]
2004-10-25  7:22 ` Lindsay Haisley
2004-10-25  7:46 ` Lindsay Haisley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041025064510.GA16016@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).