Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 45288 Details for
Bug 55329
don't do modules-update on every boot, just when needed
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
modules-update.patch
modules-update.patch (text/plain), 7.08 KB, created by
Paul Pacheco
on 2004-12-04 13:06:49 UTC
(
hide
)
Description:
modules-update.patch
Filename:
MIME Type:
Creator:
Paul Pacheco
Created:
2004-12-04 13:06:49 UTC
Size:
7.08 KB
patch
obsolete
>--- /sbin/modules-update.orig 2004-12-04 13:44:16.000000000 -0600 >+++ /sbin/modules-update 2004-12-04 14:27:14.000000000 -0600 >@@ -94,121 +94,164 @@ > exit 2 > fi > >-if [ -e "${CFGFILE}" ] >+# this section generates ${CFGFILE} if needed >+if $FORCE || is_older_than "${CFGFILE}" "${MODDIR}" > then >- cp -f "${CFGFILE}" "${CFGFILE}".old >-fi >-if ${KERNEL_2_5}; then >- if [ -e "${CFGFILE2}" ] >- then >- cp -f "${CFGFILE2}" "${CFGFILE2}".old >- fi >- if [ -e "${CFGFILE4}" ] >- then >- cp -f "${CFGFILE4}" "${CFGFILE4}".old >- fi >-fi >- >- >-echo "${HEADER}" > "${TMPFILE}" >-cat <<EOF >> "${TMPFILE}" >+ ebegin "Updating ${CFGFILE}" >+ >+ echo "${HEADER}" > "${TMPFILE}" >+ cat <<EOF >> "${TMPFILE}" > # > # Please do not edit this file directly. If you want to change or add > # anything please take a look at the files in ${MODDIR} and read > # the manpage for modules-update. > # > EOF >-if [ -x /sbin/generate-modprobe.conf -a "${KERNEL_2_5}" = "true" ] >-then >- sed -e "s:the files in ${MODDIR}:${CFGFILE}:" \ >- "${TMPFILE}" > "${TMPFILE2}" >- >- if [ -f "${CFGFILE3}" ] >- then >- sed -e "s:the files in ${MODDIR}:${CFGFILE3}:" \ >- "${TMPFILE}" > "${TMPFILE4}" >- fi >-fi >- >-for cfg in "${MODDIR}"/* "${CONF}" >-do >- [ -d "${cfg}" ] && continue >- >- [ ! -r "${cfg}" ] && continue >- >- # Skip backup and RCS files; fixes bug 20597 (07 May 2004 agriffis) >- [[ ${cfg} == *~ || ${cfg} == *.bak || ${cfg} == *,v ]] && continue >+ for cfg in "${MODDIR}"/* >+ do >+ [ -d "${cfg}" ] && continue > >- echo "### modules-update: start processing ${cfg}" >> "${TMPFILE}" >+ [ ! -r "${cfg}" ] && continue > >- if [ -x ${cfg} ] >+ # Skip backup and RCS files; fixes bug 20597 (07 May 2004 agriffis) >+ [[ ${cfg} == *~ || ${cfg} == *.bak || ${cfg} == *,v ]] && continue >+ >+ echo "### modules-update: start processing ${cfg}" >> "${TMPFILE}" >+ >+ if [ -x ${cfg} ] >+ then >+ # $cfg can be executable; nice touch, Wichert! :) >+ "${cfg}" >> "${TMPFILE}" >+ else >+ cat "${cfg}" >> "${TMPFILE}" >+ fi >+ >+ echo >> "${TMPFILE}" >+ echo "### modules-update: end processing ${cfg}" >> "${TMPFILE}" >+ echo >> "${TMPFILE}" >+ done >+ >+ # back up the current file >+ if [ -e "${CFGFILE}" ] > then >- # $cfg can be executable; nice touch, Wichert! :) >- "${cfg}" >> "${TMPFILE}" >- else >- cat "${cfg}" >> "${TMPFILE}" >+ cp -f "${CFGFILE}" "${CFGFILE}".old > fi > >- echo >> "${TMPFILE}" >- echo "### modules-update: end processing ${cfg}" >> "${TMPFILE}" >- echo >> "${TMPFILE}" >-done >+ mv -f "${TMPFILE}" "${CFGFILE}" >+ >+ eend "$?" >+fi >+ > >-mv -f "${TMPFILE}" "${CFGFILE}" > >-if [ -x /sbin/generate-modprobe.conf -a "${KERNEL_2_5}" = "true" ] >+# this section generates ${CFGFILE2} if CFGFILE is newer >+ >+if [ "${CFGFILE}" -nt "${CFGFILE2}" ] || $FORCE > then >- # Make sure that generate-modprobe.conf can handle --assume-kernel >- # if we were called with it. >- if [[ -n ${ASSUME_KV} ]] && ! grep -qe --assume-kernel \ >- /sbin/generate-modprobe.conf >- then >- eerror "Error: modules-update called with --assume-kernel flag, but" >- eerror "generate-modprobe.conf doesn't understand it. You need to" >- eerror "install >=module-init-tools-3.0-r2" >- exit 3 >- fi >- if /sbin/generate-modprobe.conf ${ASSUME_KV:+--assume-kernel=${KV}} \ >- >> "${TMPFILE2}" 2> /dev/null >- then >- mv -f "${TMPFILE2}" "${CFGFILE2}" >- else >- ewarn "Warning: could not generate ${CFGFILE2}!" >- rm -f "${TMPFILE2}" >- fi > >- if [ -f "${CFGFILE3}" ] >+ if [ -x /sbin/generate-modprobe.conf -a "${KERNEL_2_5}" = "true" ] > then >- gawk '$0 !~ /^[[:space:]]*include/ { print $0 }' "${CFGFILE3}" \ >- > "${TMPFILE3}" >+ ebegin "Updating ${CFGFILE2}" > >- export TESTING_MODPROBE_CONF="${TMPFILE3}" >+ echo "${HEADER}" > "${TMPFILE2}" >+ cat <<EOF >> "${TMPFILE2}" >+# >+# Please do not edit this file directly. If you want to change or add >+# anything please take a look at ${CFGFILE} and read >+# the manpage for modules-update. >+# >+EOF >+ # Make sure that generate-modprobe.conf can handle --assume-kernel >+ # if we were called with it. >+ if [[ -n ${ASSUME_KV} ]] && ! grep -qe --assume-kernel \ >+ /sbin/generate-modprobe.conf >+ then >+ eerror "Error: modules-update called with --assume-kernel flag, but" >+ eerror "generate-modprobe.conf doesn't understand it. You need to" >+ eerror "install >=module-init-tools-3.0-r2" >+ exit 3 >+ fi > if /sbin/generate-modprobe.conf ${ASSUME_KV:+--assume-kernel=${KV}} \ >- >> "${TMPFILE4}" 2> /dev/null >+ >> "${TMPFILE2}" 2> /dev/null > then >- mv -f "${TMPFILE4}" "${CFGFILE4}" >- >- echo >> "${CFGFILE4}" >- echo "include /etc/modprobe.conf" >> "${CFGFILE4}" >+ # back up the current file >+ if [ -e "${CFGFILE2}" ] >+ then >+ cp -f "${CFGFILE2}" "${CFGFILE2}".old >+ fi >+ mv -f "${TMPFILE2}" "${CFGFILE2}" > else >- ewarn "Warning: could not generate ${CFGFILE4}!" >- rm -f "${TMPFILE4}" >+ ewarn "Warning: could not generate ${CFGFILE2}!" >+ rm -f "${TMPFILE2}" >+ fi >+ >+ eend "$?" >+ fi >+fi >+ >+ >+if [ "${CFGFILE3}" -nt "${CFGFILE4}" ] || $FORCE >+then >+ >+ if [ -x /sbin/generate-modprobe.conf -a "${KERNEL_2_5}" = "true" ] >+ then >+ if [ -f "${CFGFILE3}" ] >+ then >+ ebegin "Updating ${CFGFILE4}" >+ >+ echo "${HEADER}" > "${TMPFILE4}" >+ cat <<EOF >> "${TMPFILE4}" >+# >+# Please do not edit this file directly. If you want to change or add >+# anything please take a look at ${CFGFILE3} and read >+# the manpage for modules-update. >+# >+EOF >+ >+ gawk '$0 !~ /^[[:space:]]*include/ { print $0 }' "${CFGFILE3}" \ >+ > "${TMPFILE3}" >+ >+ export TESTING_MODPROBE_CONF="${TMPFILE3}" >+ if /sbin/generate-modprobe.conf ${ASSUME_KV:+--assume-kernel=${KV}} \ >+ >> "${TMPFILE4}" 2> /dev/null >+ then >+ echo >> "${TMPFILE4}" >+ echo "include /etc/modprobe.conf" >> "${TMPFILE4}" >+ >+ # backup the current file >+ if [ -e "${CFGFILE4}" ] >+ then >+ cp -f "${CFGFILE4}" "${CFGFILE4}".old >+ fi >+ >+ mv -f "${TMPFILE4}" "${CFGFILE4}" >+ else >+ ewarn "Warning: could not generate ${CFGFILE4}!" >+ rm -f "${TMPFILE4}" >+ fi >+ rm -f "${TMPFILE3}" >+ >+ eend "$?" > fi >- rm -f "${TMPFILE3}" > fi > fi > > # We also call depmod here to stop insmod from complaining that modules.conf > # is more recent then modules.dep > # >-if [ -d "`depdir`" -a -f /proc/modules ] >+ >+if [ "${CFGFILE2}" -nt /lib/modules/${KV}/modules.dep ] || $FORCE > then >- if [ -f /usr/src/linux/System.map ]; then >- depmod -a -F /usr/src/linux/System.map ${KV} >- else >- depmod -a ${KV} >+ if [ -d "`depdir`" -a -f /proc/modules ] >+ then >+ ebegin "Updating /lib/modules/${KV}/modules.dep" >+ if [ -f /usr/src/linux/System.map ]; then >+ depmod -a -F /usr/src/linux/System.map ${KV} >+ else >+ depmod -a ${KV} >+ fi >+ eend "$?" > fi > fi > >- > # vim:ts=4 >--- /etc/init.d/modules.orig 2004-12-04 13:52:56.000000000 -0600 >+++ /etc/init.d/modules 2004-12-04 14:00:30.000000000 -0600 >@@ -81,11 +81,11 @@ > return 1 > fi > >- if [ -z "${CDBOOT}" ] && touch /etc/modules.conf 2> /dev/null >+ if [ -z "${CDBOOT}" ] 2> /dev/null > then >- ebegin "Calculating module dependencies" >+ #ebegin "Calculating module dependencies" > /sbin/modules-update &>/dev/null >- eend $? "Failed to calculate module dependencies" >+ #eend $? "Failed to calculate module dependencies" > fi > > if [ -f /etc/modules.autoload -a ! -L /etc/modules.autoload ]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 55329
:
34274
|
37630
|
39398
|
39435
|
40449
|
42697
|
43295
|
43725
|
44151
| 45288