From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 875CB198005 for ; Fri, 22 Mar 2013 08:25:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5CF01E075C; Fri, 22 Mar 2013 08:24:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 62016E0757 for ; Fri, 22 Mar 2013 08:24:22 +0000 (UTC) Received: from [10.170.25.195] (85-76-21-26-nat.elisa-mobile.fi [85.76.21.26]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: ssuominen) by smtp.gentoo.org (Postfix) with ESMTPSA id DACB033BE6E for ; Fri, 22 Mar 2013 08:24:20 +0000 (UTC) Message-ID: <514C14FC.3070304@gentoo.org> Date: Fri, 22 Mar 2013 10:23:24 +0200 From: Samuli Suominen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130309 Thunderbird/17.0.4 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-dev Subject: [gentoo-dev] rfc: linux-mod.eclass: review patch for kmod compat Content-Type: multipart/mixed; boundary="------------080208060202000705070509" X-Archives-Salt: 4c7464a9-7c5c-495d-a7aa-9ea7d95bb442 X-Archives-Hash: 9739634a229d0c9bfc7f848170a02451 This is a multi-part message in MIME format. --------------080208060202000705070509 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit update-modules is a script in files/ directory of module-init-tools for Linux 2.4, but using 2.4 is not really possible for a long time now without pulling stuff out from CVS Attic kmod doesn't have it the patch drops references to 2.4, modules.d directory, and the /sbin/update-modules command --------------080208060202000705070509 Content-Type: text/x-patch; name="kmod.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kmod.patch" --- /tmp/linux-mod.eclass.orig 2013-03-22 10:14:42.281368081 +0200 +++ gentoo-x86/eclass/linux-mod.eclass 2013-03-22 10:14:46.353367755 +0200 @@ -77,12 +77,12 @@ # insinto /lib/modules/${KV_FULL}/usb # doins module_usb.${KV_OBJ} -# There is also support for automated modprobe.d/modules.d(2.4) file generation. +# There is also support for automated modprobe.d file generation. # This can be explicitly enabled by setting any of the following variables. # @ECLASS-VARIABLE: MODULESD__ENABLED # @DESCRIPTION: -# This is used to disable the modprobe.d/modules.d file generation otherwise the file will be +# This is used to disable the modprobe.d file generation otherwise the file will be # always generated (unless no MODULESD__* variable is provided). Set to "no" to disable # the generation of the file and the installation of the documentation. @@ -91,7 +91,7 @@ # This is a bash array containing a list of examples which should # be used. If you want us to try and take a guess set this to "guess". # -# For each array_component it's added an options line in the modprobe.d/modules.d file +# For each array_component it's added an options line in the modprobe.d file # # options array_component # @@ -101,7 +101,7 @@ # @DESCRIPTION: # This is a bash array containing a list of associated aliases. # -# For each array_component it's added an alias line in the modprobe.d/modules.d file +# For each array_component it's added an alias line in the modprobe.d file # # alias array_component # @@ -235,27 +235,6 @@ # internal function # -# FUNCTION: update_modules -# DESCRIPTION: -# It calls the update-modules utility. -update_modules() { - debug-print-function ${FUNCNAME} $* - - if [ -x /sbin/update-modules ] && \ - grep -v -e "^#" -e "^$" "${D}"/etc/modules.d/* >/dev/null 2>&1; then - ebegin "Updating modules.conf" - /sbin/update-modules - eend $? - elif [ -x /sbin/update-modules ] && \ - grep -v -e "^#" -e "^$" "${D}"/etc/modules.d/* >/dev/null 2>&1; then - ebegin "Updating modules.conf" - /sbin/update-modules - eend $? - fi -} - -# internal function -# # FUNCTION: move_old_moduledb # DESCRIPTION: # It updates the location of the database used by the module-rebuild utility. @@ -355,9 +334,9 @@ # # FUNCTION: # USAGE: /path/to/the/modulename_without_extension -# RETURN: A file in /etc/modules.d/ (kernel < 2.6) or /etc/modprobe.d/ (kernel >= 2.6) +# RETURN: A file in /etc/modprobe.d # DESCRIPTION: -# This function will generate and install the neccessary modprobe.d/modules.d file from the +# This function will generate and install the neccessary modprobe.d file from the # information contained in the modules exported parms. # (see the variables MODULESD__ENABLED, MODULESD__EXAMPLES, # MODULESD__ALIASES, MODULESD__ADDITION and MODULESD__DOCS). @@ -402,13 +381,13 @@ [[ -z ${!module_*} ]] && return 0 # OK so now if we have got this far, then we know we want to continue - # and generate the modules.d file. + # and generate the modprobe.d file. module_modinfo="$(modinfo -p ${currm_path}.${KV_OBJ})" module_config="${T}/modulesd-${currm}" - ebegin "Preparing file for modules.d" + ebegin "Preparing file for modprobe.d" #----------------------------------------------------------------------- - echo "# modules.d configuration file for ${currm}" >> "${module_config}" + echo "# modprobe.d configuration file for ${currm}" >> "${module_config}" #----------------------------------------------------------------------- [[ -n ${module_docs} ]] && \ echo "# For more information please read:" >> "${module_config}" @@ -494,11 +473,7 @@ #----------------------------------------------------------------------- # then we install it - if kernel_is ge 2 6; then - insinto /etc/modprobe.d - else - insinto /etc/modules.d - fi + insinto /etc/modprobe.d newins "${module_config}" "${currm_path//*\/}.conf" # and install any documentation we might have. @@ -687,7 +662,7 @@ # It install the modules specified in MODULES_NAME. The modules should be inside the ${objdir} # directory and they are installed inside /lib/modules/${KV_FULL}/${libdir}. # -# The modprobe.d/modules.d configuration file is automatically generated if the +# The modprobe.d configuration file is automatically generated if the # MODULESD__* variables are defined. The only way to stop this process is by # setting MODULESD__ENABLED=no. At the end the documentation specified via # MODULESD__DOCS is also installed. @@ -727,27 +702,24 @@ debug-print-function ${FUNCNAME} $* [ -d "${D}lib/modules" ] && UPDATE_DEPMOD=true || UPDATE_DEPMOD=false - [ -d "${D}etc/modules.d" ] && UPDATE_MODULES=true || UPDATE_MODULES=false [ -d "${D}lib/modules" ] && UPDATE_MODULEDB=true || UPDATE_MODULEDB=false } # @FUNCTION: linux-mod_pkg_postinst # @DESCRIPTION: # It executes /sbin/depmod and adds the package to the /var/lib/module-rebuild/moduledb -# database (if ${D}/lib/modules is created) and it runs /sbin/update-modules -# (if ${D}/etc/modules.d is created). +# database (if ${D}/lib/modules is created)" linux-mod_pkg_postinst() { debug-print-function ${FUNCNAME} $* ${UPDATE_DEPMOD} && update_depmod; - ${UPDATE_MODULES} && update_modules; ${UPDATE_MODULEDB} && update_moduledb; } # @FUNCTION: linux-mod_pkg_postrm # @DESCRIPTION: # It removes the package from the /var/lib/module-rebuild/moduledb database but it doens't -# call /sbin/depmod and /sbin/update-modules because the modules are still installed. +# call /sbin/depmod because the modules are still installed. linux-mod_pkg_postrm() { debug-print-function ${FUNCNAME} $* remove_moduledb; --------------080208060202000705070509--