summaryrefslogtreecommitdiff
path: root/hotplug/hotplug-20030501/busybox.patch
blob: 65146afa801b707a1715ed8e3efb02dac2ff2b41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
--- hotplug-2003_05_01/etc/hotplug/net.agent~busybox
+++ hotplug-2003_05_01/etc/hotplug/net.agent
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # Network hotplug policy agent for Linux 2.4 kernels
 #
@@ -17,7 +17,7 @@
 #
 
 cd /etc/hotplug
-. hotplug.functions
+. ./hotplug.functions
 # DEBUG=yes export DEBUG
 
 if [ "$INTERFACE" = "" ]; then
@@ -36,11 +36,6 @@
 	    ;;
 	# interfaces that are registered then brought up
 	*)
-	    # NOTE:  network configuration relies on administered state,
-	    # we can't do much here without distro-specific knowledge
-	    # such as whether/how to invoke DHCP, set up bridging, etc.
-
-	    # RedHat and similar
 	    if [ -x /sbin/ifup ]; then
 		debug_mesg invoke ifup $INTERFACE
 		exec /sbin/ifup $INTERFACE
@@ -52,6 +47,27 @@
     mesg $1 $ACTION event not handled
     ;;
 
+unregister)
+    case $INTERFACE in
+	# interfaces that are unregistered after being "down"
+	ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*)
+	    debug_mesg assuming $INTERFACE is already down
+	    exit 0
+	    ;;
+
+	# interfaces that are registered then brought down
+	*)
+	    if [ -x /sbin/ifdown ]; then
+		debug_mesg invoke ifdown $INTERFACE
+		exec /sbin/ifdown $INTERFACE
+	    else
+		mesg "how do I bring interfaces up on this distro?"
+	    fi
+	    ;;
+	
+    esac
+    mesg $1 $ACTION event not handled
+    ;;
 *)
     debug_mesg NET $ACTION event not supported
     exit 1 ;;
--- hotplug-2003_05_01/etc/hotplug/scsi.agent~busybox
+++ hotplug-2003_05_01/etc/hotplug/scsi.agent
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # SCSI hotplug agent for 2.5 kernels 
 #
@@ -7,7 +7,7 @@
 #
 
 cd /etc/hotplug
-. hotplug.functions
+. ./hotplug.functions
 
 case $ACTION in
 
--- hotplug-2003_05_01/etc/hotplug/usb.handmap~busybox
+++ hotplug-2003_05_01/etc/hotplug/usb.handmap
@@ -3,7 +3,7 @@
 # with special driver mappings that the kernel
 # for some reason does not expose through modutils
 #
-# Comments get read by bash so dont use punctuation
+# Comments get read by the shell so dont use punctuation
 # RETEST ESPECIALLY AFER CHANGES TO COMMENTS
 #
 #
--- hotplug-2003_05_01/etc/hotplug.d/default/default.hotplug~busybox
+++ hotplug-2003_05_01/etc/hotplug.d/default/default.hotplug
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # This version of /sbin/hotplug should works on most GNU/Linux systems
 # using Linux 2.2.18+ or 2.4.* kernels.  On 2.2.*, only USB has such
@@ -24,7 +24,7 @@
 #
 
 cd /etc/hotplug
-. hotplug.functions
+. ./hotplug.functions
 
 # DEBUG=yes export DEBUG
 
--- hotplug-2003_05_01/etc/hotplug/hotplug.functions~busybox
+++ hotplug-2003_05_01/etc/hotplug/hotplug.functions
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # Setup and utility functions for use in hotplug agents
 #
@@ -25,7 +25,7 @@
 #
 # for diagnostics
 #
-if [ -t -o ! -x /usr/bin/logger ]; then
+if [ ! -x /usr/bin/logger ]; then
     mesg () {
 	echo "$@"
     }
@@ -40,15 +40,9 @@
     mesg "$@"
 }
 
-#
-# The modules.*map parsing uses BASH ("declare -i") and some version
-# of AWK, typically /bin/gawk.  Most GNU/Linux distros have these,
-# but some specialized ones (floppy based, etc) may not.  ("type -p"
-# is also a bash-ism, more robust than "which".)
-#
-AWK=`type -p gawk`
+AWK=`which gawk`
 if [ "$AWK" = "" ]; then
-    AWK=`type -p awk`
+    AWK=`which awk`
 fi
 
 
--- hotplug-2003_05_01/etc/hotplug/usb.rc~busybox
+++ hotplug-2003_05_01/etc/hotplug/usb.rc
@@ -75,7 +75,7 @@
 	#
 
 	# synthesize hotplug events if we can 
-	# we need (non-bash) programs to parse descriptors.
+	# we need (non-shell) programs to parse descriptors.
 	LISTER=`type -p usbmodules`
 	if [ "$LISTER" = "" -o ! -f /proc/bus/usb/devices ]; then
 		echo $"** can't synthesize root hub events"
--- hotplug-2003_05_01/etc/hotplug/ieee1394.agent~busybox
+++ hotplug-2003_05_01/etc/hotplug/ieee1394.agent
@@ -24,7 +24,7 @@
 #
 
 cd /etc/hotplug
-. hotplug.functions
+. ./hotplug.functions
 # DEBUG=yes export DEBUG
 
 # generated by modutils 2.4.9 or later, for 2.4.10 and later kernels
--- hotplug-2003_05_01/etc/hotplug/pci.agent~busybox
+++ hotplug-2003_05_01/etc/hotplug/pci.agent
@@ -33,7 +33,7 @@
 #
 
 cd /etc/hotplug
-. hotplug.functions
+. ./hotplug.functions
 
 # generated by modutils, for current 2.4.x kernels
 MAP_CURRENT=$MODULE_DIR/modules.pcimap
--- hotplug-2003_05_01/etc/hotplug/usb.agent~busybox
+++ hotplug-2003_05_01/etc/hotplug/usb.agent
@@ -79,7 +79,7 @@
 fi
 
 cd /etc/hotplug
-. hotplug.functions
+. ./hotplug.functions
 # DEBUG=yes export DEBUG
 
 # generated by modutils, for current 2.4.x (and later) kernels
--- hotplug-2003_05_01/etc/hotplug/pci.rc~busybox
+++ hotplug-2003_05_01/etc/hotplug/pci.rc
@@ -17,7 +17,7 @@
 	. /etc/rc.d/init.d/functions
 fi
 
-. hotplug.functions
+. ./hotplug.functions
 
 
 # # override any of the defaults?