1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 # @ECLASS: linux-mod.eclass
7 # kernel-misc@gentoo.org
9 # John Mylchreest <johnm@gentoo.org>,
10 # Stefan Schweizer <genstef@gentoo.org>
11 # @BLURB: It provides the functionality required to install external modules against a kernel source tree.
13 # This eclass is used to interface with linux-info.eclass in such a way
14 # to provide the functionality and initial functions
15 # required to install external modules against a kernel source
18 # A Couple of env vars are available to effect usage of this eclass
19 # These are as follows:
21 # @ECLASS-VARIABLE: MODULES_OPTIONAL_USE
23 # A string containing the USE flag to use for making this eclass optional
24 # The recommended non-empty value is 'modules'
26 # @ECLASS-VARIABLE: KERNEL_DIR
28 # A string containing the directory of the target kernel sources. The default value is
31 # @ECLASS-VARIABLE: ECONF_PARAMS
33 # It's a string containing the parameters to pass to econf.
34 # If this is not set, then econf isn't run.
36 # @ECLASS-VARIABLE: BUILD_PARAMS
38 # It's a string with the parameters to pass to emake.
40 # @ECLASS-VARIABLE: BUILD_TARGETS
42 # It's a string with the build targets to pass to make. The default value is "clean module"
44 # @ECLASS-VARIABLE: MODULE_NAMES
46 # It's a string containing the modules to be built automatically using the default
47 # src_compile/src_install. It will only make ${BUILD_TARGETS} once in any directory.
49 # The structure of each MODULE_NAMES entry is as follows:
51 # modulename(libdir:srcdir:objdir)
55 # modulename = name of the module file excluding the .ko
56 # libdir = place in system modules directory where module is installed (by default it's misc)
57 # srcdir = place for ebuild to cd to before running make (by default it's ${S})
58 # objdir = place the .ko and objects are located after make runs (by default it's set to srcdir)
60 # To get an idea of how these variables are used, here's a few lines
61 # of code from around line 540 in this eclass:
63 # einfo "Installing ${modulename} module"
64 # cd ${objdir} || die "${objdir} does not exist"
65 # insinto /lib/modules/${KV_FULL}/${libdir}
66 # doins ${modulename}.${KV_OBJ} || die "doins ${modulename}.${KV_OBJ} failed"
69 # MODULE_NAMES="module_pci(pci:${S}/pci:${S}) module_usb(usb:${S}/usb:${S})"
71 # what this would do is
74 # make ${BUILD_PARAMS} ${BUILD_TARGETS}
76 # insinto /lib/modules/${KV_FULL}/pci
77 # doins module_pci.${KV_OBJ}
80 # make ${BUILD_PARAMS} ${BUILD_TARGETS}
82 # insinto /lib/modules/${KV_FULL}/usb
83 # doins module_usb.${KV_OBJ}
85 # There is also support for automated modprobe.d file generation.
86 # This can be explicitly enabled by setting any of the following variables.
88 # @ECLASS-VARIABLE: MODULESD_<modulename>_ENABLED
90 # This is used to disable the modprobe.d file generation otherwise the file will be
91 # always generated (unless no MODULESD_<modulename>_* variable is provided). Set to "no" to disable
92 # the generation of the file and the installation of the documentation.
94 # @ECLASS-VARIABLE: MODULESD_<modulename>_EXAMPLES
96 # This is a bash array containing a list of examples which should
97 # be used. If you want us to try and take a guess set this to "guess".
99 # For each array_component it's added an options line in the modprobe.d file
101 # options array_component
103 # where array_component is "<modulename> options" (see modprobe.conf(5))
105 # @ECLASS-VARIABLE: MODULESD_<modulename>_ALIASES
107 # This is a bash array containing a list of associated aliases.
109 # For each array_component it's added an alias line in the modprobe.d file
111 # alias array_component
113 # where array_component is "wildcard <modulename>" (see modprobe.conf(5))
115 # @ECLASS-VARIABLE: MODULESD_<modulename>_ADDITIONS
117 # This is a bash array containing a list of additional things to
118 # add to the bottom of the file. This can be absolutely anything.
119 # Each entry is a new line.
121 # @ECLASS-VARIABLE: MODULESD_<modulename>_DOCS
123 # This is a string list which contains the full path to any associated
124 # documents for <modulename>. These files are installed in the live tree.
126 # @ECLASS-VARIABLE: KV_OBJ
128 # It's a read-only variable. It contains the extension of the kernel modules.
130 inherit eutils linux-info multilib
131 EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst src_install src_compile pkg_postrm
133 IUSE="kernel_linux ${MODULES_OPTIONAL_USE}"
135 RDEPEND="${MODULES_OPTIONAL_USE}${MODULES_OPTIONAL_USE:+? (} kernel_linux? ( virtual/modutils ) ${MODULES_OPTIONAL_USE:+)}"
137 ${MODULES_OPTIONAL_USE}${MODULES_OPTIONAL_USE:+? (}
139 kernel_linux? ( virtual/linux-sources )
140 ${MODULES_OPTIONAL_USE:+)}"
143 # ----------------------------------
146 debug-print-function ${FUNCNAME} $*
148 local curr_gcc_ver=$(gcc -dumpversion)
149 local tmpfile old_chost old_gcc_ver result=0
150 [ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return
152 tmpfile=`find "${KV_DIR}/" -iname "*.o.cmd" -exec grep usr/lib/gcc {} \; -quit`
153 tmpfile=${tmpfile//*usr/lib}
154 tmpfile=${tmpfile//\/include*}
155 old_chost=${tmpfile//*gcc\/}
156 old_chost=${old_chost//\/*}
157 old_gcc_ver=${tmpfile//*\/}
159 if [[ -z ${old_gcc_ver} || -z ${old_chost} ]]; then
161 ewarn "Unable to detect what version of GCC was used to compile"
162 ewarn "the kernel. Build will continue, but you may experience problems."
163 elif [[ ${curr_gcc_ver} != ${old_gcc_ver} ]]; then
165 ewarn "The version of GCC you are using (${curr_gcc_ver}) does"
166 ewarn "not match the version of GCC used to compile the"
167 ewarn "kernel (${old_gcc_ver})."
169 elif [[ ${CHOST} != ${old_chost} ]]; then
171 ewarn "The current CHOST (${CHOST}) does not match the chost"
172 ewarn "used when compiling the kernel (${old_chost})."
176 if [[ ${result} -gt 0 ]]; then
178 ewarn "Build will not continue, because you will experience problems."
179 ewarn "To fix this either change the version of GCC you wish to use"
180 ewarn "to match the kernel, or recompile the kernel first."
181 die "GCC Version Mismatch."
186 # @RETURN: true or false
188 # It checks if the kernel version is greater than 2.6.5.
190 debug-print-function ${FUNCNAME} $*
192 # if we haven't determined the version yet, we need too.
195 # if the kernel version is greater than 2.6.6 then we should use
196 # M= instead of SUBDIRS=
197 [ ${KV_MAJOR} -eq 3 ] && return 0
198 [ ${KV_MAJOR} -eq 2 -a ${KV_MINOR} -gt 5 -a ${KV_PATCH} -gt 5 ] && \
202 # @FUNCTION: convert_to_m
203 # @USAGE: /path/to/the/file
205 # It converts a file (e.g. a makefile) to use M= instead of SUBDIRS=
207 debug-print-function ${FUNCNAME} $*
212 die "convert_to_m() requires a filename as an argument"
213 ebegin "Converting ${1/${WORKDIR}\//} to use M= instead of SUBDIRS="
214 sed -i 's:SUBDIRS=:M=:g' "${1}"
221 # FUNCTION: update_depmod
223 # It updates the modules.dep file for the current kernel.
225 debug-print-function ${FUNCNAME} $*
227 # if we haven't determined the version yet, we need too.
230 ebegin "Updating module dependencies for ${KV_FULL}"
231 if [ -r "${KV_OUT_DIR}"/System.map ]
233 depmod -ae -F "${KV_OUT_DIR}"/System.map -b "${ROOT}" ${KV_FULL}
237 ewarn "${KV_OUT_DIR}/System.map not found."
238 ewarn "You must manually update the kernel module dependencies using depmod."
246 # FUNCTION: move_old_moduledb
248 # It updates the location of the database used by the module-rebuild utility.
249 move_old_moduledb() {
250 debug-print-function ${FUNCNAME} $*
252 local OLDDIR="${ROOT}"/usr/share/module-rebuild/
253 local NEWDIR="${ROOT}"/var/lib/module-rebuild/
255 if [[ -f "${OLDDIR}"/moduledb ]]; then
256 [[ ! -d "${NEWDIR}" ]] && mkdir -p "${NEWDIR}"
257 [[ ! -f "${NEWDIR}"/moduledb ]] && \
258 mv "${OLDDIR}"/moduledb "${NEWDIR}"/moduledb
266 # FUNCTION: update_moduledb
268 # It adds the package to the /var/lib/module-rebuild/moduledb database used by the module-rebuild utility.
270 debug-print-function ${FUNCNAME} $*
272 local MODULEDB_DIR="${ROOT}"/var/lib/module-rebuild/
275 if [[ ! -f "${MODULEDB_DIR}"/moduledb ]]; then
276 [[ ! -d "${MODULEDB_DIR}" ]] && mkdir -p "${MODULEDB_DIR}"
277 touch "${MODULEDB_DIR}"/moduledb
280 if ! grep -qs ${CATEGORY}/${PN}-${PVR} "${MODULEDB_DIR}"/moduledb ; then
281 einfo "Adding module to moduledb."
282 echo "a:1:${CATEGORY}/${PN}-${PVR}" >> "${MODULEDB_DIR}"/moduledb
288 # FUNCTION: remove_moduledb
290 # It removes the package from the /var/lib/module-rebuild/moduledb database used by
291 # the module-rebuild utility.
293 debug-print-function ${FUNCNAME} $*
295 local MODULEDB_DIR="${ROOT}"/var/lib/module-rebuild/
298 if grep -qs ${CATEGORY}/${PN}-${PVR} "${MODULEDB_DIR}"/moduledb ; then
299 einfo "Removing ${CATEGORY}/${PN}-${PVR} from moduledb."
300 sed -i -e "/.*${CATEGORY}\/${PN}-${PVR}.*/d" "${MODULEDB_DIR}"/moduledb
304 # @FUNCTION: set_kvobj
306 # It sets the KV_OBJ variable.
308 debug-print-function ${FUNCNAME} $*
316 # Do we really need to know this?
318 # einfo "Using KV_OBJ=${KV_OBJ}"
322 debug-print-function ${FUNCNAME} $*
324 if [[ -n ${KERNEL_CC} ]] ; then
330 if [ -n "${KERNEL_ABI}" ]; then
331 # In future, an arch might want to define CC_$ABI
332 #kernel_cc="$(get_abi_CC)"
333 #[ -z "${kernel_cc}" ] &&
334 kernel_cc="$(tc-getCC $(ABI=${KERNEL_ABI} get_abi_CHOST))"
336 kernel_cc=$(tc-getCC)
344 # USAGE: /path/to/the/modulename_without_extension
345 # RETURN: A file in /etc/modprobe.d
347 # This function will generate and install the neccessary modprobe.d file from the
348 # information contained in the modules exported parms.
349 # (see the variables MODULESD_<modulename>_ENABLED, MODULESD_<modulename>_EXAMPLES,
350 # MODULESD_<modulename>_ALIASES, MODULESD_<modulename>_ADDITION and MODULESD_<modulename>_DOCS).
352 # At the end the documentation specified with MODULESD_<modulename>_DOCS is installed.
353 generate_modulesd() {
354 debug-print-function ${FUNCNAME} $*
355 [ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return
357 local currm_path currm currm_t t myIFS myVAR
358 local module_docs module_enabled module_aliases \
359 module_additions module_examples module_modinfo module_opts
361 for currm_path in ${@}
363 currm=${currm_path//*\/}
364 currm=$(echo ${currm} | tr '[:lower:]' '[:upper:]')
366 while [[ -z ${currm_t//*-*} ]]; do
367 currm_t=${currm_t/-/_}
370 module_docs="$(eval echo \${MODULESD_${currm_t}_DOCS})"
371 module_enabled="$(eval echo \${MODULESD_${currm_t}_ENABLED})"
372 module_aliases="$(eval echo \${#MODULESD_${currm_t}_ALIASES[*]})"
373 module_additions="$(eval echo \${#MODULESD_${currm_t}_ADDITIONS[*]})"
374 module_examples="$(eval echo \${#MODULESD_${currm_t}_EXAMPLES[*]})"
376 [[ ${module_aliases} -eq 0 ]] && unset module_aliases
377 [[ ${module_additions} -eq 0 ]] && unset module_additions
378 [[ ${module_examples} -eq 0 ]] && unset module_examples
380 # If we specify we dont want it, then lets exit, otherwise we assume
381 # that if its set, we do want it.
382 [[ ${module_enabled} == no ]] && return 0
384 # unset any unwanted variables.
385 for t in ${!module_*}
387 [[ -z ${!t} ]] && unset ${t}
390 [[ -z ${!module_*} ]] && return 0
392 # OK so now if we have got this far, then we know we want to continue
393 # and generate the modprobe.d file.
394 module_modinfo="$(modinfo -p ${currm_path}.${KV_OBJ})"
395 module_config="${T}/modulesd-${currm}"
397 ebegin "Preparing file for modprobe.d"
398 #-----------------------------------------------------------------------
399 echo "# modprobe.d configuration file for ${currm}" >> "${module_config}"
400 #-----------------------------------------------------------------------
401 [[ -n ${module_docs} ]] && \
402 echo "# For more information please read:" >> "${module_config}"
403 for t in ${module_docs}
405 echo "# ${t//*\/}" >> "${module_config}"
407 echo >> "${module_config}"
409 #-----------------------------------------------------------------------
410 if [[ ${module_aliases} -gt 0 ]]
412 echo "# Internal Aliases - Do not edit" >> "${module_config}"
413 echo "# ------------------------------" >> "${module_config}"
415 for((t=0; t<${module_aliases}; t++))
417 echo "alias $(eval echo \${MODULESD_${currm}_ALIASES[$t]})" \
418 >> "${module_config}"
420 echo '' >> "${module_config}"
423 #-----------------------------------------------------------------------
424 if [[ -n ${module_modinfo} ]]
426 echo >> "${module_config}"
427 echo "# Configurable module parameters" >> "${module_config}"
428 echo "# ------------------------------" >> "${module_config}"
430 IFS="$(echo -en "\n\b")"
432 for t in ${module_modinfo}
434 myVAR="$(echo ${t#*:} | grep -o "[^ ]*[0-9][ =][^ ]*" | tail -1 | grep -o "[0-9]")"
437 module_opts="${module_opts} ${t%%:*}:${myVAR}"
439 echo -e "# ${t%%:*}:\t${t#*:}" >> "${module_config}"
442 echo '' >> "${module_config}"
445 #-----------------------------------------------------------------------
446 if [[ $(eval echo \${MODULESD_${currm}_ALIASES[0]}) == guess ]]
448 # So lets do some guesswork eh?
449 if [[ -n ${module_opts} ]]
451 echo "# For Example..." >> "${module_config}"
452 echo "# --------------" >> "${module_config}"
453 for t in ${module_opts}
455 echo "# options ${currm} ${t//:*}=${t//*:}" >> "${module_config}"
457 echo '' >> "${module_config}"
459 elif [[ ${module_examples} -gt 0 ]]
461 echo "# For Example..." >> "${module_config}"
462 echo "# --------------" >> "${module_config}"
463 for((t=0; t<${module_examples}; t++))
465 echo "options $(eval echo \${MODULESD_${currm}_EXAMPLES[$t]})" \
466 >> "${module_config}"
468 echo '' >> "${module_config}"
471 #-----------------------------------------------------------------------
472 if [[ ${module_additions} -gt 0 ]]
474 for((t=0; t<${module_additions}; t++))
476 echo "$(eval echo \${MODULESD_${currm}_ADDITIONS[$t]})" \
477 >> "${module_config}"
479 echo '' >> "${module_config}"
482 #-----------------------------------------------------------------------
485 insinto /etc/modprobe.d
486 newins "${module_config}" "${currm_path//*\/}.conf"
488 # and install any documentation we might have.
489 [[ -n ${module_docs} ]] && dodoc ${module_docs}
497 # FUNCTION: find_module_params
498 # USAGE: A string "NAME(LIBDIR:SRCDIR:OBJDIR)"
499 # RETURN: The string "modulename:NAME libdir:LIBDIR srcdir:SRCDIR objdir:OBJDIR"
501 # Analyze the specification NAME(LIBDIR:SRCDIR:OBJDIR) of one module as described in MODULE_NAMES.
502 find_module_params() {
503 debug-print-function ${FUNCNAME} $*
505 local matched_offset=0 matched_opts=0 test="${@}" temp_var result
508 for((i=0; i<=${#test}; i++))
510 case ${test:${i}:1} in
511 \() matched_offset[0]=${i};;
512 \:) matched_opts=$((${matched_opts} + 1));
513 matched_offset[${matched_opts}]="${i}";;
514 \)) matched_opts=$((${matched_opts} + 1));
515 matched_offset[${matched_opts}]="${i}";;
519 for((i=0; i<=${matched_opts}; i++))
521 # i = offset were working on
523 # z = current offset - last offset
524 # temp_var = temporary name
526 0) tempvar=${test:0:${matched_offset[0]}};;
527 *) y=$((${matched_offset[$((${i} - 1))]} + 1))
528 z=$((${matched_offset[${i}]} - ${matched_offset[$((${i} - 1))]}));
530 tempvar=${test:${y}:${z}};;
534 0) result="${result} modulename:${tempvar}";;
535 1) result="${result} libdir:${tempvar}";;
536 2) result="${result} srcdir:${tempvar}";;
537 3) result="${result} objdir:${tempvar}";;
544 # default ebuild functions
545 # --------------------------------
547 # @FUNCTION: linux-mod_pkg_setup
549 # It checks the CONFIG_CHECK options (see linux-info.eclass(5)), verifies that the kernel is
550 # configured, verifies that the sources are prepared, verifies that the modules support is builtin
551 # in the kernel and sets the object extension KV_OBJ.
552 linux-mod_pkg_setup() {
553 debug-print-function ${FUNCNAME} $*
554 [ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return
556 local is_bin="${MERGE_TYPE}"
558 # If we are installing a binpkg, take a different path.
559 # use MERGE_TYPE if available (eapi>=4); else use non-PMS EMERGE_FROM (eapi<4)
560 if has ${EAPI} 0 1 2 3; then
561 is_bin=${EMERGE_FROM}
564 if [[ ${is_bin} == binary ]]; then
565 linux-mod_pkg_setup_binary
569 linux-info_pkg_setup;
570 require_configured_kernel
573 [[ -n ${MODULE_NAMES} ]] && check_modules_supported
575 # Commented out with permission from johnm until a fixed version for arches
576 # who intentionally use different kernel and userland compilers can be
577 # introduced - Jason Wever <weeve@gentoo.org>, 23 Oct 2005
581 # @FUNCTION: linux-mod_pkg_setup_binary
583 # Perform all kernel option checks non-fatally, as the .config and
584 # /proc/config.gz might not be present. Do not do anything that requires kernel
586 linux-mod_pkg_setup_binary() {
587 debug-print-function ${FUNCNAME} $*
588 local new_CONFIG_CHECK
589 # ~ needs always to be quoted, else bash expands it.
590 for config in $CONFIG_CHECK ; do
592 [[ ${config:0:1} == "~" ]] && optional=''
593 new_CONFIG_CHECK="${new_CONFIG_CHECK} ${optional}${config}"
595 export CONFIG_CHECK="${new_CONFIG_CHECK}"
596 linux-info_pkg_setup;
599 strip_modulenames() {
600 debug-print-function ${FUNCNAME} $*
603 for i in ${MODULE_IGNORE}; do
604 MODULE_NAMES=${MODULE_NAMES//${i}(*}
608 # @FUNCTION: linux-mod_src_compile
610 # It compiles all the modules specified in MODULE_NAMES. For each module the econf command is
611 # executed only if ECONF_PARAMS is defined, the name of the target is specified by BUILD_TARGETS
612 # while the options are in BUILD_PARAMS (all the modules share these variables). The compilation
613 # happens inside ${srcdir}.
615 # Look at the description of these variables for more details.
616 linux-mod_src_compile() {
617 debug-print-function ${FUNCNAME} $*
618 [ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return
620 local modulename libdir srcdir objdir i n myABI="${ABI}"
624 BUILD_TARGETS=${BUILD_TARGETS:-clean module}
628 for i in ${MODULE_NAMES}
630 unset libdir srcdir objdir
631 for n in $(find_module_params ${i})
633 eval ${n/:*}=${n/*:/}
635 libdir=${libdir:-misc}
636 srcdir=${srcdir:-${S}}
637 objdir=${objdir:-${srcdir}}
639 if [ ! -f "${srcdir}/.built" ];
642 ln -s "${S}"/Module.symvers Module.symvers
643 einfo "Preparing ${modulename} module"
644 if [[ -n ${ECONF_PARAMS} ]]
646 econf ${ECONF_PARAMS} || \
647 die "Unable to run econf ${ECONF_PARAMS}"
650 # This looks messy, but it is needed to handle multiple variables
651 # being passed in the BUILD_* stuff where the variables also have
652 # spaces that must be preserved. If don't do this, then the stuff
653 # inside the variables gets used as targets for Make, which then
655 eval "emake HOSTCC=\"$(tc-getBUILD_CC)\" \
656 CROSS_COMPILE=${CHOST}- \
657 LDFLAGS=\"$(get_abi_LDFLAGS)\" \
661 || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" CROSS_COMPILE=${CHOST}- LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}"
663 touch "${srcdir}"/.built
671 # @FUNCTION: linux-mod_src_install
673 # It install the modules specified in MODULES_NAME. The modules should be inside the ${objdir}
674 # directory and they are installed inside /lib/modules/${KV_FULL}/${libdir}.
676 # The modprobe.d configuration file is automatically generated if the
677 # MODULESD_<modulename>_* variables are defined. The only way to stop this process is by
678 # setting MODULESD_<modulename>_ENABLED=no. At the end the documentation specified via
679 # MODULESD_<modulename>_DOCS is also installed.
681 # Look at the description of these variables for more details.
682 linux-mod_src_install() {
683 debug-print-function ${FUNCNAME} $*
684 [ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return
686 local modulename libdir srcdir objdir i n
689 for i in ${MODULE_NAMES}
691 unset libdir srcdir objdir
692 for n in $(find_module_params ${i})
694 eval ${n/:*}=${n/*:/}
696 libdir=${libdir:-misc}
697 srcdir=${srcdir:-${S}}
698 objdir=${objdir:-${srcdir}}
700 einfo "Installing ${modulename} module"
701 cd "${objdir}" || die "${objdir} does not exist"
702 insinto /lib/modules/${KV_FULL}/${libdir}
703 doins ${modulename}.${KV_OBJ} || die "doins ${modulename}.${KV_OBJ} failed"
706 generate_modulesd "${objdir}/${modulename}"
710 # @FUNCTION: linux-mod_pkg_preinst
712 # It checks what to do after having merged the package.
713 linux-mod_pkg_preinst() {
714 debug-print-function ${FUNCNAME} $*
715 [ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return
717 [ -d "${D}lib/modules" ] && UPDATE_DEPMOD=true || UPDATE_DEPMOD=false
718 [ -d "${D}lib/modules" ] && UPDATE_MODULEDB=true || UPDATE_MODULEDB=false
721 # @FUNCTION: linux-mod_pkg_postinst
723 # It executes /sbin/depmod and adds the package to the /var/lib/module-rebuild/moduledb
724 # database (if ${D}/lib/modules is created)"
725 linux-mod_pkg_postinst() {
726 debug-print-function ${FUNCNAME} $*
727 [ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return
729 ${UPDATE_DEPMOD} && update_depmod;
730 ${UPDATE_MODULEDB} && update_moduledb;
733 # @FUNCTION: linux-mod_pkg_postrm
735 # It removes the package from the /var/lib/module-rebuild/moduledb database but it doens't
736 # call /sbin/depmod because the modules are still installed.
737 linux-mod_pkg_postrm() {
738 debug-print-function ${FUNCNAME} $*
739 [ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return