View | Details | Raw Unified | Return to bug 9581
Collapse All | Expand All

(-)hotplug-2004_09_23.orig/etc/hotplug/acpi.rc (-7 / +7 lines)
Lines 18-32 Link Here
18
# start this script only for 2.6 kernel and if acpi namespace enabled
18
# start this script only for 2.6 kernel and if acpi namespace enabled
19
[ -d $SYSFS/firmware/acpi/namespace/ACPI ] || exit 0
19
[ -d $SYSFS/firmware/acpi/namespace/ACPI ] || exit 0
20
20
21
22
start()
21
start()
23
{
22
{
24
	MODULES=`/usr/bin/acpiscan -r 2>/dev/null|sort -u`
23
	MODULES=`/usr/bin/acpiscan -r 2>/dev/null|sort -u && echo "ac"`
25
	for i in $MODULES
24
	for i in $MODULES ; do
26
	do
25
	    if ! loaded $i ; then
27
	    /sbin/modprobe $i >/dev/null
26
		if ! blacklisted $i ; then
27
		    /sbin/modprobe $i >/dev/null
28
		fi
29
	    fi
28
	done
30
	done
29
	modprobe ac >/dev/null
30
}
31
}
31
32
32
stop()
33
stop()
Lines 36-42 Link Here
36
	do
37
	do
37
	    /sbin/modprobe -r $i >/dev/null
38
	    /sbin/modprobe -r $i >/dev/null
38
	done
39
	done
39
	modprobe -r ac >/dev/null
40
}
40
}
41
41
42
status()
42
status()
(-)hotplug-2004_09_23.orig/etc/hotplug/block.rc (-2 / +7 lines)
Lines 19-26 Link Here
19
19
20
start()
20
start()
21
{
21
{
22
    for i in `storagescan -r 2>/dev/null|uniq`;do
22
    MODULES=`storagescan -r 2>/dev/null|uniq`
23
	modprobe $i
23
    for i in $MODULES ; do
24
	if ! loaded $i ; then
25
	    if ! blacklisted $i ; then
26
		/sbin/modprobe $i >/dev/null
27
	    fi
28
	fi
24
    done
29
    done
25
}
30
}
26
31
(-)hotplug-2004_09_23.orig/etc/hotplug/cpu.rc (-5 / +8 lines)
Lines 16-26 Link Here
16
16
17
start()
17
start()
18
{
18
{
19
	MODULES=`/usr/bin/cpuscan -r 2>/dev/null|sort -u`
19
    MODULES=`/usr/bin/cpuscan -r 2>/dev/null|sort -u`
20
	for i in $MODULES
20
    for i in $MODULES ; do
21
	do
21
	if ! loaded $i ; then
22
	    /sbin/modprobe $i >/dev/null
22
	    if ! blacklisted $i ; then
23
	done
23
		/sbin/modprobe $i >/dev/null
24
	    fi
25
	fi
26
    done
24
}
27
}
25
28
26
stop()
29
stop()
(-)hotplug-2004_09_23.orig/etc/hotplug/hotplug.functions (-5 / +35 lines)
Lines 83-88 Link Here
83
    mesg "$@"
83
    mesg "$@"
84
}
84
}
85
85
86
# check if module's already loaded
87
# if it's present return 1
88
# else return 0
89
90
loaded()
91
{
92
    local MODULE=$1
93
    if lsmod | grep -q "^$(echo $MODULE|sed -e 's/-/_/g') " > /dev/null 2>&1; then
94
	return 0;
95
    fi
96
    return 1;
97
}
98
99
# check if module is in blacklist
100
# if it's true return 1
101
# else return 0
102
103
blacklisted()
104
{
105
    if [ ! -f $HOTPLUG_DIR/blacklist.d/`uname -r`/blacklist ] ; then
106
	mkdir -p $HOTPLUG_DIR/blacklist.d/`uname -r`
107
	touch $HOTPLUG_DIR/blacklist.d/`uname -r`/blacklist
108
    fi
109
    local MODULE=$1
110
    if grep -q "^$(echo $MODULE|sed -e 's/[-_]/[-_]/g')\$" $HOTPLUG_DIR/blacklist \
111
	$HOTPLUG_DIR/blacklist.d/* \
112
	$HOTPLUG_DIR/blacklist.d/`uname -r`/blacklist \
113
        >/dev/null 2>&1; then
114
	    debug_mesg "blacklisted module ... $MODULE"
115
    	    return 0
116
    fi
117
    return 1
118
}
86
119
87
#
120
#
88
# Not "modprobe --autoclean" ... one driver module can handle many
121
# Not "modprobe --autoclean" ... one driver module can handle many
Lines 149-159 Link Here
149
    do
182
    do
150
	# maybe driver modules need loading
183
	# maybe driver modules need loading
151
        LOADED=false
184
        LOADED=false
152
	if ! lsmod | grep -q "^$(echo $MODULE|sed -e 's/-/_/g') " > /dev/null 2>&1; then
185
	if ! loaded $MODULE ; then
153
	    if grep -q "^$(echo $MODULE|sed -e 's/[-_]/[-_]/g')\$" $HOTPLUG_DIR/blacklist \
186
	    if blacklisted $MODULE ; then
154
	    	    $HOTPLUG_DIR/blacklist.d/* \
155
		    >/dev/null 2>&1; then
156
		debug_mesg "... blacklisted module:  $MODULE"
157
		continue
187
		continue
158
	    fi
188
	    fi
159
	    
189
	    
(-)hotplug-2004_09_23.orig/etc/hotplug/scsi.agent (-1 / +3 lines)
Lines 61-67 Link Here
61
    esac
61
    esac
62
    if [ "$MODULE" != "" ]; then
62
    if [ "$MODULE" != "" ]; then
63
	mesg "$TYPE at $DEVPATH"
63
	mesg "$TYPE at $DEVPATH"
64
	modprobe $MODULE
64
	if ! blacklisted $MODULE ; then 
65
	    modprobe $MODULE
66
	fi
65
    else
67
    else
66
	debug_mesg "how to add device type=$TYPE at $DEVPATH ??"
68
	debug_mesg "how to add device type=$TYPE at $DEVPATH ??"
67
    fi
69
    fi
(-)hotplug-2004_09_23.orig/etc/hotplug/usb.rc (-3 / +15 lines)
Lines 141-147 Link Here
141
    # if distro hasn't already done part of this ... load core,
141
    # if distro hasn't already done part of this ... load core,
142
    # and mount usbfs before the first hotplug agent fires
142
    # and mount usbfs before the first hotplug agent fires
143
    # (so it'll be available to the agents).
143
    # (so it'll be available to the agents).
144
    modprobe -q usbcore >/dev/null 2>&1
144
    if ! blacklisted usbcore ; then
145
	modprobe -q usbcore >/dev/null 2>&1
146
    fi
145
    if [ -d /proc/bus/usb ]; then
147
    if [ -d /proc/bus/usb ]; then
146
	# if it's not mounted, try to mount it
148
	# if it's not mounted, try to mount it
147
	if [ -z "`grep " /proc/bus/usb " /proc/mounts`" ]; then
149
	if [ -z "`grep " /proc/bus/usb " /proc/mounts`" ]; then
Lines 163-169 Link Here
163
    # is enabled on this system, initting a root hub will cause hotplug
165
    # is enabled on this system, initting a root hub will cause hotplug
164
    # events to fire for every device on the tree at that root.
166
    # events to fire for every device on the tree at that root.
165
    
167
    
166
    for i in `/usr/bin/pciscan -r -c 00c:03 2>/dev/null|sort -u`;do modprobe $i;done >/dev/null 2>&1
168
    for i in `/usr/bin/pciscan -r -c 00c:03 2>/dev/null|sort -u`; do
169
	if ! loaded $i ; then
170
	    if ! blacklisted $i ; then
171
		modprobe $i >/dev/null
172
	    fi
173
	fi
174
    done
167
    
175
    
168
    # ... add any non-PCI HCDS here.  Examples include the
176
    # ... add any non-PCI HCDS here.  Examples include the
169
    # CRIS usb-host, Philips ISP-1161, Symlogic 811HS, and so on.
177
    # CRIS usb-host, Philips ISP-1161, Symlogic 811HS, and so on.
Lines 201-207 Link Here
201
    # Some modules are statically loaded, perhaps because they are
209
    # Some modules are statically loaded, perhaps because they are
202
    # needed to activate filesystem device nodes.
210
    # needed to activate filesystem device nodes.
203
    for MODULE in $STATIC_MODULE_LIST; do
211
    for MODULE in $STATIC_MODULE_LIST; do
204
	modprobe $MODULE
212
	if ! loaded $MODULE ; then
213
	    if ! blacklisted $MODULE ; then
214
		modprobe $MODULE
215
	    fi
216
	fi
205
    done
217
    done
206
218
207
    # we did everything we could ...
219
    # we did everything we could ...

Return to bug 9581