linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lindsay Haisley <fmouse-gentoo@fmp.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: udevstart.c -> kscan.c
Date: Mon, 25 Oct 2004 07:46:22 +0000	[thread overview]
Message-ID: <20041025074622.GD23239@fmp.com> (raw)
In-Reply-To: <20041025063019.GB23239@fmp.com>

Thus spake Lindsay Haisley on Mon, Oct 25, 2004 at 02:22:28AM CDT
> 
> > 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.

For what it's worth, this prettys it up a bit and adds copy 'n paste
convenience.

-------------------------------------

#! /bin/bash                                                                                        
#                                                                                                   
# Directory where sysfs is mounted                                                                  
SYSFS_DIR=/sys

# handle block devices and their partitions                                                         
echo "Block Devices:"
for i in ${SYSFS_DIR}/block/*; do
        # each drive
        echo -n "    KERNEL=\""                                                                   
        echo -n ${i#${SYSFS_DIR}/block/}
        echo \"

        # each partition, on each device                                                            
        for j in $i/*; do
                if [ -f $j/dev ]; then
                        echo -n ${j#${SYSFS_DIR}} | awk -F/ '{printf("    KERNEL=\"%s\"\n", $4)}'
                fi
        done
done
echo; echo "Other Devices:"
# all other device classes                                                                          
for i in ${SYSFS_DIR}/class/*; do
        for j in $i/*; do
                if [ -f $j/dev ]; then
                        echo -n ${j#${SYSFS_DIR}} | awk -F/ '{printf("    KERNEL=\"%s\"\n", $4)}'
			
                fi
        done
done


-- 
Lindsay Haisley       | "Fighting against human |     PGP public key
FMP Computer Services |    creativity is like   |      available at
512-259-1190          |    trying to eradicate  | <http://pubkeys.fmp.com>
http://www.fmp.com    |        dandelions"      |
                      |      (Pamela Jones)     |


-------------------------------------------------------
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

      parent reply	other threads:[~2004-10-25  7:46 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
2004-10-25  7:22 ` Lindsay Haisley
2004-10-25  7:46 ` Lindsay Haisley [this message]

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=20041025074622.GD23239@fmp.com \
    --to=fmouse-gentoo@fmp.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).