Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 66504 | Differences between
and this patch

Collapse All | Expand All

(-)modules-update (-19 / +60 lines)
Lines 20-25 Link Here
20
TMPFILE="${CFGFILE}.$$"
20
TMPFILE="${CFGFILE}.$$"
21
CFGFILE2="/etc/modprobe.conf"
21
CFGFILE2="/etc/modprobe.conf"
22
TMPFILE2="${CFGFILE2}.$$"
22
TMPFILE2="${CFGFILE2}.$$"
23
TMPFILE2B="${CFGFILE2}B.$$"
23
CFGFILE3="/etc/modules.devfs"
24
CFGFILE3="/etc/modules.devfs"
24
TMPFILE3="${CFGFILE3}.$$"
25
TMPFILE3="${CFGFILE3}.$$"
25
CFGFILE4="/etc/modprobe.devfs"
26
CFGFILE4="/etc/modprobe.devfs"
Lines 54-59 Link Here
54
	KERNEL_2_6=false
55
	KERNEL_2_6=false
55
fi
56
fi
56
57
58
# Check if $CONF is valid
59
[[ ! -r ${CONF} ]] && CONF=
60
57
set -e
61
set -e
58
62
59
# Reset the sorting order since we depend on it
63
# Reset the sorting order since we depend on it
Lines 110-136 Link Here
110
	fi
114
	fi
111
fi
115
fi
112
116
113
for cfg in "${MODDIR}"/* "${CONF}" ; do
117
generate_config() {
114
	[[ -d ${cfg} ]] && continue
118
	local cfg=
115
119
	local conf="$1"
116
	[[ ! -r ${cfg} ]] && continue
120
	local moddir="$2"
117
121
	local tmpfile="$3"
118
	# Skip backup and RCS files; fixes bug 20597 (07 May 2004 agriffis)
122
	local do_mprobe="$4"
119
	[[ ${cfg} == *~ || ${cfg} == *.bak || ${cfg} == *,v ]] && continue
123
	
124
	for cfg in "${moddir}"/* "${conf}" ; do
125
		[[ -d ${cfg} ]] && continue
126
127
		[[ ! -r ${cfg} ]] && continue
128
129
		# Skip backup and RCS files; fixes bug 20597 (07 May 2004 agriffis)
130
		[[ ${cfg} == *~ || ${cfg} == *.bak || ${cfg} == *,v ]] && continue
131
132
		[[ ${do_mprobe} -eq 1 && -e "/etc/modprobe.d/${x##*/}" ]] && continue
133
134
		echo "### modules-update: start processing ${cfg}" >> "${tmpfile}"
135
136
		if [[ -x ${cfg} ]] ; then
137
			# $cfg can be executable; nice touch, Wichert! :)
138
			"${cfg}" >> "${tmpfile}"
139
		else
140
			cat "${cfg}" >> "${tmpfile}"
141
		fi
120
142
121
	echo "### modules-update: start processing ${cfg}" >> "${TMPFILE}"
143
		echo >> "${tmpfile}"
144
		echo "### modules-update: end processing ${cfg}" >> "${tmpfile}"
145
		echo >> "${tmpfile}"
146
	done
122
147
123
	if [[ -x ${cfg} ]] ; then
148
	return 0
124
		# $cfg can be executable; nice touch, Wichert! :)
149
}
125
		"${cfg}" >> "${TMPFILE}"
126
	else
127
		cat "${cfg}" >> "${TMPFILE}"
128
	fi
129
150
130
	echo >> "${TMPFILE}"
151
generate_config "${CONF}" "${MODDIR}" "${TMPFILE}" 0
131
	echo "### modules-update: end processing ${cfg}" >> "${TMPFILE}"
132
	echo >> "${TMPFILE}"
133
done
134
152
135
mv -f "${TMPFILE}" "${CFGFILE}"
153
mv -f "${TMPFILE}" "${CFGFILE}"
136
154
Lines 150-157 Link Here
150
	then
168
	then
151
		mv -f "${TMPFILE2}" "${CFGFILE2}"
169
		mv -f "${TMPFILE2}" "${CFGFILE2}"
152
	else
170
	else
153
		ewarn "Warning: could not generate ${CFGFILE2}!"
171
172
		#
173
		# If we made it here, it means either generate-modprobe.conf 
174
		# bombed on us, or the user doesn't have modutils installed.
175
		# If the latter is true, then we should generate modprobe.conf 
176
		# ourselves with any old files laying around in /etc/modules.d.
177
		#
154
		rm -f "${TMPFILE2}"
178
		rm -f "${TMPFILE2}"
179
		if type -p modprobe.old > /dev/null ; then
180
			ewarn "Warning: could not generate ${CFGFILE2}!"
181
		else
182
			rm -f "${CFGFILE}"
183
			echo "${FULLHEADER/modules.d/modprobe.d}" > "${TMPFILE2B}"
184
			generate_config "${CONF}" "${MODDIR}" "${TMPFILE2}" 1
185
			export TESTING_MODPROBE_CONF="${TMPFILE2}"
186
			if /sbin/generate-modprobe.conf ${ASSUME_KV:+--assume-kernel=${KV}} \
187
				 >> "${TMPFILE2B}" 2> /dev/null
188
			then
189
				mv -f "${TMPFILE2B}" "${CFGFILE2}"
190
			else
191
				ewarn "Warning: could not generate ${CFGFILE2}!"
192
				rm -f "${TMPFILE2B}"
193
			fi
194
			rm -f "${TMPFILE2}"
195
		fi
155
	fi
196
	fi
156
197
157
	if [[ -f ${CFGFILE3} ]] ; then
198
	if [[ -f ${CFGFILE3} ]] ; then

Return to bug 66504