All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olh@suse.de>
To: linux-hotplug@vger.kernel.org
Subject: recent hotplug changes are too distro specific
Date: Wed, 15 Oct 2003 20:12:54 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-106624903610051@msgid-missing> (raw)

Greg,

I have to veto against a few of the CVS changes from this week. They are
too distro specific, and I think one of them cant work at all.

I suggest to not check for a distro specifc tool, instead we should
check if a generic distro provided script exists and execute it. This
would reduce the patch mess.

if [ -x /usr/sbin/distro.usb.agent.sh ] ; then
        /usr/sbin/distro.usb.agent.sh
fi

same for net, ieee1394 and so on. Possible with parameter passing, but I
think most of it can be grabbed from enviroment.

diff -urN hotplug.prev/admin/etc/hotplug/hotplug.functions hotplug/admin/etc/hotplug/hotplug.functions
--- hotplug.prev/admin/etc/hotplug/hotplug.functions	2003-06-14 04:00:56.000000000 +0200
+++ hotplug/admin/etc/hotplug/hotplug.functions	2003-10-13 04:02:11.000000000 +0200
@@ -6,7 +6,7 @@
 # on-line at http://linux-hotplug.sourceforge.net or the
 # sources for each hotplug-aware kernel subsystem.
 #
-# $Id: hotplug.functions,v 1.20 2003/06/09 23:06:27 dbrownell Exp $
+# $Id: hotplug.functions,v 1.22 2003/10/07 21:15:38 kroah Exp $
 #
 #
 
@@ -174,6 +177,9 @@
 	if [ $LOADED = false ]; then
 	    mesg "missing kernel or user mode driver $MODULE "
 	fi
+	if echo "$MODULE" | grep -q "usb-storage" > /dev/null 2>&1 ; then
+	    [ -x /usr/sbin/updfstab ] &&  /usr/sbin/updfstab
+	fi
     done
 }
 
diff -urN hotplug.prev/admin/etc/hotplug/net.agent hotplug/admin/etc/hotplug/net.agent
--- hotplug.prev/admin/etc/hotplug/net.agent	2003-07-15 04:01:54.000000000 +0200
+++ hotplug/admin/etc/hotplug/net.agent	2003-10-13 04:02:11.000000000 +0200
@@ -13,7 +13,7 @@
 # 23-Jan-2001	Log invocation of "ifup" if debugging
 # 04-Jan-2001	Initial version of "new" hotplug agent.
 #
-# $Id: net.agent,v 1.12 2003/06/28 00:16:15 kroah Exp $
+# $Id: net.agent,v 1.15 2003/10/07 19:56:24 kroah Exp $
 #
 
 cd /etc/hotplug
@@ -27,10 +27,14 @@
 
 case $ACTION in
 add|register)
+    # Don't do anything if the network is stopped
+    if [ ! -f /var/lock/subsys/network ]; then
+       exit 0
+    fi
 

This looks broken. is /var/lock/subsys/network some LSB or FHS blessed
file? I doubt that. Again, this is distro specific.



@@ -41,6 +45,7 @@
 	    # such as whether/how to invoke DHCP, set up bridging, etc.
 
 	    # RedHat and similar
+	    export IN_HOTPLUG=1
 	    if [ -x /sbin/ifup ]; then
 		debug_mesg invoke ifup $INTERFACE
 		exec /sbin/ifup $INTERFACE

The ifup calls could go into a distro.net.agent.sh

diff -urN hotplug.prev/admin/etc/hotplug/usb.agent hotplug/admin/etc/hotplug/usb.agent
--- hotplug.prev/admin/etc/hotplug/usb.agent	2003-09-25 04:01:22.000000000 +0200
+++ hotplug/admin/etc/hotplug/usb.agent	2003-10-13 04:02:12.000000000 +0200
@@ -71,7 +71,7 @@
 #		Norbert Preining, Florian Lohoff, David Brownell and
 #		others.  To replace the original /etc/usb/policy. (db)
 #
-# $Id: usb.agent,v 1.32 2003/09/16 19:42:17 kroah Exp $
+# $Id: usb.agent,v 1.33 2003/10/07 20:03:49 kroah Exp $
 #
 
 if [ -f /etc/sysconfig/usb ]; then
@@ -428,6 +428,10 @@
 	$REMOVER
     fi
     rm -f $REMOVER
+
+    if [ -x /usr/sbin/updfstab ]; then
+        /usr/sbin/updfstab
+    fi
     ;;
 
 *)


same here.


I will provide a patch if we agree on a good name for distro.$1.agent. 
Running stuff from /etc/hotplug-beta.d/$1 could screw up the call order.
stuff called from usb.agent as example would require a zzzusb.hotplug.
And even that would not work because the default/default.hotplug is
called last. One could kill the $PPID but thats not very pretty.


-- 
USB is for mice, FireWire is for men!

sUse lINUX ag, n√úRNBERG


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
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:[~2003-10-15 20:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-15 20:12 Olaf Hering [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-01-05 18:07 recent hotplug changes are too distro specific Greg KH

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=marc-linux-hotplug-106624903610051@msgid-missing \
    --to=olh@suse.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.