linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [patch] udev: cool test scripts
@ 2003-10-17 22:58 Greg KH
  2003-10-17 23:18 ` Robert Love
  2003-10-18  0:18 ` Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: Greg KH @ 2003-10-17 22:58 UTC (permalink / raw)
  To: linux-hotplug

On Fri, Oct 17, 2003 at 06:35:22PM -0400, Robert Love wrote:
> Hi, Greg.
> 
> I dunno if these are desired, but they are pretty useful to me.
> 
> This patch changes test.tty and test.block to add/remove each tty and
> block device, respectively, on the system.  Great way to
> populate/unpopulate udev rapidly.
> 
> Its just a simple for loop over the sysfs entries.

Nice, thanks for the patch, I've applied it.

But the test.block script doesn't catch any partitions on the block
devices :)

thanks,

greg k-h


-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise 
Linux in the Boardroom; in the Front Office; & in the Server Room 
http://www.enterpriselinuxforum.com
_______________________________________________
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

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [patch] udev: cool test scripts
@ 2003-10-17 22:35 Robert Love
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Love @ 2003-10-17 22:35 UTC (permalink / raw)
  To: linux-hotplug

Hi, Greg.

I dunno if these are desired, but they are pretty useful to me.

This patch changes test.tty and test.block to add/remove each tty and
block device, respectively, on the system.  Great way to
populate/unpopulate udev rapidly.

Its just a simple for loop over the sysfs entries.

Patch is against udev-003.

	Robert Love


 test.block |   18 ++++++++++--------
 test.tty   |   18 ++++++++++--------
 2 files changed, 20 insertions(+), 16 deletions(-)

diff -urN udev-cvs/test.block udev/test.block
--- udev-cvs/test.block	2003-07-24 22:12:14.000000000 -0400
+++ udev/test.block	2003-10-17 18:30:07.314143640 -0400
@@ -1,10 +1,12 @@
-#!/bin/sh
-export ACTION­d
-#export ACTION=remove
+#! /bin/sh
+#
+# test.block - run udev(8) on each block device in /sys/block
 
-export DEVPATH=/block/hda
-export DEVPATH=/block/sda/sda1
-#export DEVPATH=/block/sda
+SYSFSDIR=/sys		# change this for a nonstand sysfs mount point
+BIN=./udev		# location of your udev binary
+export ACTION­d	# 'add' or 'remove'
 
-
-./udev block
+for i in ${SYSFSDIR}/block/*; do
+	export DEVPATH="/"`echo $i | cut --delimiter='/' --fields=3-`
+	$BIN block
+done
diff -urN udev-cvs/test.tty udev/test.tty
--- udev-cvs/test.tty	2003-07-23 15:32:19.000000000 -0400
+++ udev/test.tty	2003-10-17 18:28:25.808574832 -0400
@@ -1,10 +1,12 @@
-#!/bin/sh
-export ACTION­d
-#export ACTION=remove
-export DEVPATH=/devices/pci0/00:09.0/usb1/1-1/1-1.1/ttyUSB7
-export DEVPATH=/class/tty/ttyUSB0
-#export DEVPATH=/block/hda
+#! /bin/sh
+#
+# test.tty - run udev(8) on each tty device in /sys/class/tty
 
+SYSFSDIR=/sys		# change this for a nonstand sysfs mount point
+BIN=./udev		# location of your udev binary
+export ACTION­d	# 'add' or 'remove'
 
-#./udev block
-./udev tty
+for i in ${SYSFSDIR}/class/tty/*; do
+	export DEVPATH="/"`echo $i | cut --delimiter='/' --fields=3-`
+	$BIN tty
+done





-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise 
Linux in the Boardroom; in the Front Office; & in the Server Room 
http://www.enterpriselinuxforum.com
_______________________________________________
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-10-18  0:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-17 22:58 [patch] udev: cool test scripts Greg KH
2003-10-17 23:18 ` Robert Love
2003-10-18  0:18 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2003-10-17 22:35 Robert Love

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