linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* recent hotplug changes are too distro specific
@ 2003-10-15 20:12 Olaf Hering
  0 siblings, 0 replies; 2+ messages in thread
From: Olaf Hering @ 2003-10-15 20:12 UTC (permalink / raw)
  To: linux-hotplug

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

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

* Re: recent hotplug changes are too distro specific
@ 2004-01-05 18:07 Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2004-01-05 18:07 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Oct 15, 2003 at 10:12:54PM +0200, Olaf Hering wrote:
> 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.

Well, they all did come from a Red Hat employee ;)

> 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

Ok, that sounds good, but can we keep the scripts for distros in
/etc/hotplug/ to keep from cluttering up /usr/sbin?

Care to send a patch against the recent changes?

thanks,

greg k-h


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
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] 2+ messages in thread

end of thread, other threads:[~2004-01-05 18:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-05 18:07 recent hotplug changes are too distro specific Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2003-10-15 20:12 Olaf Hering

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