LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   rc.modules looks to need a little attention. (http://www.linuxquestions.org/questions/slackware-14/rc-modules-looks-to-need-a-little-attention-4175483641/)

GazL 11-06-2013 03:32 PM

rc.modules looks to need a little attention.
 
While I was reviewing the rc.* files I noticed that rc.modules seems a little outdated. I suspect this has been wrong for quite a while.

Code:

RELEASE=$(uname -r)

### Update module dependencies ###
# If /usr is mounted and we have 'find', we can try to take a shortcut:
if [ -x /usr/bin/find -a -e /lib/modules/$RELEASE/modules.dep \
    -a /lib/modules/$RELEASE/modules.dep -nt /etc/modules.conf ]; then
  NEWMODS="$(/usr/bin/find /lib/modules/$RELEASE -mindepth 2 -type f -newer /lib
/modules/$RELEASE/modules.dep)"
  # Only rebuild dependencies if new module(s) are found:
  if [ ! "" = "$NEWMODS" ]; then
    echo "Updating module dependencies for Linux $RELEASE:"
    /sbin/depmod -a
  else
    echo "Module dependencies up to date (no new kernel modules found)."
  fi
else # we don't have find, or there is no existing modules.dep, or it is out of
date.
  echo "Updating module dependencies for Linux $RELEASE:"
  /sbin/depmod -A
fi

Firstly, there isn't a /etc/modules.conf anymore.

Secondly, the -a and -A options seem to have been reversed. According to the man pages, depmod -a will probe for all modules, where as -A will just process new ones.

All that stuff with find looks a little tortured too. I'm thinking that this section should probably be changed to a simple:
Code:


### Update module dependencies #########################################

# Determine the version of the running kernel:
RELEASE=$(uname -r)

if [ -e /lib/modules/$RELEASE/modules.dep ]; then
  echo "Updating $RELEASE module dependencies for NEW modules (if any)."
  /sbin/depmod -A
else
  echo "Updating $RELEASE module dependencies for ALL modules."
  /sbin/depmod -a
fi

########################################################################


Also, IMO all the lines in this file that modprobe various modules should reviewed for suitability and potentially commented out. For example, why would I want "/sbin/modprobe e_powersaver 2>/dev/null" or "/sbin/modprobe longrun 2>/dev/null" running on my X86_64?

ReaperX7 11-06-2013 03:36 PM

It's mostly for systems I suppose that will be ran without udev and still use those individual modprobes for devices. The rc.modules file still works, but it's just very unused on a majority of systems because of what it's intended for.

GazL 11-06-2013 03:43 PM

I think my point was that "# Enhanced PowerSaver driver for VIA C7 CPUs" isn't much use in the rc.modules-3.10.17 shipped with the X86_64 kernel. I know the 2>/dev/null is going to hide the failures, but it just seems untidy.

Anyway, my main reason for posting was to draw attention to the depmod stuff, which I believe to be wrong.


All times are GMT -5. The time now is 07:45 AM.