linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* hotplug remover support
@ 2001-06-04 17:18 Stephen Williams
  2001-06-06 17:20 ` Greg KH
  2001-06-07 22:57 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Williams @ 2001-06-04 17:18 UTC (permalink / raw)
  To: linux-hotplug


Is there any objection to the remover patch I submitted a while ago
to the hotplug and usb-devel lists? It seems to help my design of
applications that use USB devices, so I would like to get it integrated
into the main hotplug repository. If there are specific objections,
I can address them.

If they don't get integrated, then I'll choose to package and distribute
my patch on my own, along with my application, at least until there is
an adequate equivilent.

(Or until I find a better way.)

I've attached a fresh copy, as the patch is very small.
-- 
Steve Williams                "The woods are lovely, dark and deep.
steve@icarus.com              But I have promises to keep,
steve@picturel.com            and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."

Index: etc/hotplug/usb.agent
=================================RCS file: /cvsroot/linux-hotplug/admin/etc/hotplug/usb.agent,v
retrieving revision 1.12
diff -u -r1.12 usb.agent
--- etc/hotplug/usb.agent	2001/04/24 15:07:33	1.12
+++ etc/hotplug/usb.agent	2001/05/23 00:35:47
@@ -18,6 +18,14 @@
 #	DEVFS=/proc/bus/usb
 #	DEVICE=/proc/bus/usb/%03d/%03d
 #
+# This script then adds the variable:
+#
+#       REMOVER=/var/run/usb/<some string unique to $DEVICE>
+#
+# This is the path where the script would like to find a remover, if
+# the target device needs one. This script is executed on remove if
+# it is executable when the remove happens.
+#
 # If usbdevfs is mounted on /proc/bus/usb, $DEVICE is a file which
 # can be read to get the device's current configuration descriptor.
 # (The "usbmodules" utility helps do that.)
@@ -269,6 +277,11 @@
     done
 }
 
+#
+# declare a REMOVER name that the add action can use to create a
+# remover, or that the remove action can use to execute a remover.
+#
+declare -rx REMOVER=/var/run/usb/`echo $DEVICE | sed -e 's;/;%;g'`
 
 #
 # What to do with this USB hotplug event?
@@ -281,6 +294,10 @@
     FOUNDúlse
     LABEL="USB product $PRODUCT"
 
+    if [ -e "$REMOVER" ]; then
+	rm -f "$REMOVER"
+    fi
+
     # on 2.4 systems, modutils 2.4.2+ maintains MAP_CURRENT
     # ... otherwise we can't rely on it (sigh)
     case "$KERNEL" in
@@ -320,6 +337,13 @@
 	exit 2
     fi
 
+    ;;
+
+remove)
+    if [ -x $REMOVER ]; then
+	$REMOVER
+    fi
+    rm -f $REMOVER
     ;;
 
 *)
Index: etc/hotplug/usb.rc
=================================RCS file: /cvsroot/linux-hotplug/admin/etc/hotplug/usb.rc,v
retrieving revision 1.8
diff -u -r1.8 usb.rc
--- etc/hotplug/usb.rc	2001/03/22 04:52:56	1.8
+++ etc/hotplug/usb.rc	2001/05/23 00:35:47
@@ -134,6 +134,11 @@
 	return 1
     fi
 
+    # Create a directory to hold remover programs. Close it up so
+    # that only hotplug scripts can write to this directory.
+    mkdir /var/run/usb
+    chmod 0700 /var/run/usb
+
     # hotplug events didn't fire during booting;
     # cope with devices that enumerated earlier
     # and may not have been fully configured.



_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: hotplug remover support
  2001-06-04 17:18 hotplug remover support Stephen Williams
@ 2001-06-06 17:20 ` Greg KH
  2001-06-07 22:57 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2001-06-06 17:20 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Jun 06, 2001 at 09:16:08AM -0700, Stephen Williams wrote:
> david-b@pacbell.net said:
> > I thought Greg was going to integrate these... 
> 
> Well, when I do a cvs diff (I have an anonymous copy) I don't see
> any changes. Is this a sourceforge problem?

No, it's a "Greg needs to get the chance to apply them" problem.  I'll
try to get to it tonight.

Sorry about this.

greg k-h

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: hotplug remover support
  2001-06-04 17:18 hotplug remover support Stephen Williams
  2001-06-06 17:20 ` Greg KH
@ 2001-06-07 22:57 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2001-06-07 22:57 UTC (permalink / raw)
  To: linux-hotplug

On Mon, Jun 04, 2001 at 10:18:31AM -0700, Stephen Williams wrote:
> 
> Is there any objection to the remover patch I submitted a while ago
> to the hotplug and usb-devel lists? It seems to help my design of
> applications that use USB devices, so I would like to get it integrated
> into the main hotplug repository. If there are specific objections,
> I can address them.

I added half the patch.
Making the directory should be up to the install process, not the
script's normal procedure.

thanks for being so patient,

greg k-h

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

end of thread, other threads:[~2001-06-07 22:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-06-04 17:18 hotplug remover support Stephen Williams
2001-06-06 17:20 ` Greg KH
2001-06-07 22:57 ` Greg KH

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