--- trunk/magellan-initscripts/sbin/modules-update 2011/05/12 15:36:59 1277 +++ trunk/magellan-initscripts/sbin/modules-update 2011/05/12 16:03:35 1278 @@ -31,7 +31,9 @@ # Setup some variables # -HEADER="### This file is automatically generated by update-modules" +HEADER="### This file is automatically generated by modules-update" +HEADER_OLD="### This file is automatically generated by update-modules" +VERSION="1.5" # # Parse command-line @@ -49,10 +51,10 @@ -f|--force|force) FORCE="true";; -v|--verbose) ((VERBOSE+=1));; -d|--debug) ((DEBUG+=1));; - -V|--version) exec echo "${argv0}$Revision: 1.4 $ $Date: 2008-03-25 21:41:22 $";; + -V|--version) exec echo "${argv0}: ${VERSION}";; -h|--help) cat <<-EOF - Usage: update-modules [options] + Usage: modules-update [options] Options: --assume-kernel=KV Assume the kernel is at least version KV @@ -117,13 +119,14 @@ x="./etc/${x}" [ -r ${x} ] || continue - if [ "$(sed -ne 1p ${x})" != "${HEADER}" ] ; then + _header="$(sed -ne 1p ${x})" + if [ "${_header}" != "${HEADER}" ] && [ "${_header}" != "${HEADER_OLD}" ]; then echo "Warning: ${x#.} has not been automatically generated" if ${FORCE} ; then echo "--force specified, (re)generating file anyway" else - echo "Use \"update-modules force\" to force (re)generation" + echo "Use \"modules-update force\" to force (re)generation" exit 1 fi fi @@ -173,7 +176,7 @@ # # 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 update-modules(8). + # the manpage for modules-update(8). # EOF } @@ -206,7 +209,7 @@ [ -n "${refdir}" ] && [ -e "${refdir}/${cfg##*/}" ] && continue ( - echo "### update-modules: start processing ${cfg#.}" + echo "### modules-update: start processing ${cfg#.}" if [ -x "${cfg}" ] ; then # $cfg can be executable; nice touch, Wichert! :) "${cfg}" @@ -214,7 +217,7 @@ cat "${cfg}" fi echo - echo "### update-modules: end processing ${cfg#.}" + echo "### modules-update: end processing ${cfg#.}" echo ) >> "${tmpfile}" done @@ -297,6 +300,10 @@ elif ! ${FORCE} && ! is_older_than ./etc/modprobe.conf ./etc/modules.d ./etc/modprobe.d ; then veinfo "modprobe.conf: already up-to-date nutness" +elif [ ! -e ./etc/modules.conf -a ! -e ./etc/modules.d ] ; then + veinfo "No need to generate modprobe.conf :)" + rm -f ./etc/modprobe.conf + else # # First, bitch like crazy @@ -370,9 +377,9 @@ ( echo - echo "### update-modules: start processing ${cfg#.}" + echo "### modules-update: start processing ${cfg#.}" cat "${cfg}" - echo "### update-modules: end processing ${cfg#.}" + echo "### modules-update: end processing ${cfg#.}" ) >> "./etc/modprobe.conf" done fi