From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Love Date: Fri, 17 Oct 2003 22:35:22 +0000 Subject: [patch] udev: cool test scripts Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org 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=ADd -#export ACTION=3Dremove +#! /bin/sh +# +# test.block - run udev(8) on each block device in /sys/block =20 -export DEVPATH=3D/block/hda -export DEVPATH=3D/block/sda/sda1 -#export DEVPATH=3D/block/sda +SYSFSDIR=3D/sys # change this for a nonstand sysfs mount point +BIN=3D./udev # location of your udev binary +export ACTION=ADd # 'add' or 'remove' =20 - -./udev block +for i in ${SYSFSDIR}/block/*; do + export DEVPATH=3D"/"`echo $i | cut --delimiter=3D'/' --fields=3D3-` + $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=ADd -#export ACTION=3Dremove -export DEVPATH=3D/devices/pci0/00:09.0/usb1/1-1/1-1.1/ttyUSB7 -export DEVPATH=3D/class/tty/ttyUSB0 -#export DEVPATH=3D/block/hda +#! /bin/sh +# +# test.tty - run udev(8) on each tty device in /sys/class/tty =20 +SYSFSDIR=3D/sys # change this for a nonstand sysfs mount point +BIN=3D./udev # location of your udev binary +export ACTION=ADd # 'add' or 'remove' =20 -#./udev block -./udev tty +for i in ${SYSFSDIR}/class/tty/*; do + export DEVPATH=3D"/"`echo $i | cut --delimiter=3D'/' --fields=3D3-` + $BIN tty +done ------------------------------------------------------- This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo The Event For Linux Datacenter Solutions & Strategies in The Enterprise=20 Linux in the Boardroom; in the Front Office; & in the Server Room=20 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