LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 11-06-2013, 04:32 PM   #1
GazL
Senior Member
 
Registered: May 2008
Posts: 3,503

Rep: Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026
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?
 
Old 11-06-2013, 04:36 PM   #2
ReaperX7
Senior Member
 
Registered: Jul 2011
Location: California
Distribution: LFS-7.6, Slackware 14.1, FreeBSD 10.1
Posts: 3,849
Blog Entries: 15

Rep: Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189
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.
 
Old 11-06-2013, 04:43 PM   #3
GazL
Senior Member
 
Registered: May 2008
Posts: 3,503

Original Poster
Rep: Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026
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.
 
1 members found this post helpful.
Old 11-10-2014, 07:45 PM   #4
qweasd
Member
 
Registered: May 2010
Posts: 486

Rep: Reputation: Disabled
What's the decree on this one? Can rc.modules be simply removed on systems with 3.* kernel?
 
Old 11-10-2014, 08:13 PM   #5
bobzilla
Member
 
Registered: Nov 2005
Location: Serbia
Distribution: Slackware
Posts: 211

Rep: Reputation: Disabled
Quote:
Originally Posted by qweasd View Post
What's the decree on this one? Can rc.modules be simply removed on systems with 3.* kernel?
Doesn't have much to do with a kernel version. It's there for people not wanting to use udev (as Reaper pointed out before me). That makes sense in some uses (for example closed or rarely changing systems) and it would be nice to keep it possible.

Depmod thing, if correct, is an issue though. Everything else Gazl commented on can be fixed manually.
 
Old 11-10-2014, 10:13 PM   #6
ReaperX7
Senior Member
 
Registered: Jul 2011
Location: California
Distribution: LFS-7.6, Slackware 14.1, FreeBSD 10.1
Posts: 3,849
Blog Entries: 15

Rep: Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189
The script and listing of modules does need to be updated badly, but Patrick probably hasn't had time yet.

If you wish to update it and share it, that would be helpful as well.
 
Old 11-11-2014, 07:03 AM   #7
GazL
Senior Member
 
Registered: May 2008
Posts: 3,503

Original Poster
Rep: Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026
I've also emailed him about the depmod -a/-A switcharoo, so he should already be aware. Didn't get a response, but you sometimes don't with Pat unless he has a specific point to make or discuss with you.


FWIW, since I posted this thread, I've been using this as a /etc/rc.d/rc.modules.local:
Code:
#!/bin/sh
# /etc/rc.d/rc.modules.local
#
# This file loads extra drivers into the Linux kernel.


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

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

if [ -e "/lib/modules/$RELEASE/modules.dep" ]; then 
  echo "Updating module dependency list for $RELEASE:"
  /sbin/depmod --quick
else 
  echo "Creating module dependency list for $RELEASE:"
  /sbin/depmod --all
fi

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

/sbin/modprobe sg             # Generic SCSI support for SATA DVD-RW
/sbin/modprobe loop           # loop block device

########################################################################
(It's pretty much the same as the one at the top of this thread, except I decided to use the long options for added clarity)

IMO there's no point maintaining a complete list of commented out modules as that information is available in the kernel documentation and Pat has better things to do with his time than maintain a list of kernel modules/descriptions that people could just look up elsewhere if they need to.
 
3 members found this post helpful.
Old 11-11-2014, 11:04 AM   #8
qweasd
Member
 
Registered: May 2010
Posts: 486

Rep: Reputation: Disabled
Thanks, GazL. I found this thread because I was rewriting build scripts for kernel, modules, and firmware, and I couldn't figure out what, if anything, rc.modules does. I like your depmod fix.
 
Old 11-11-2014, 02:21 PM   #9
ReaperX7
Senior Member
 
Registered: Jul 2011
Location: California
Distribution: LFS-7.6, Slackware 14.1, FreeBSD 10.1
Posts: 3,849
Blog Entries: 15

Rep: Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189
True. Perhaps a document might be better for listing modules and purpose?
 
Old 11-11-2014, 09:36 PM   #10
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 1,971

Rep: Reputation: Disabled
I like it. I'd suggest a couple of minor changes, making it look something like this:
Code:
#!/bin/sh
# /etc/rc.d/rc.modules.local
#
# This file loads extra drivers into the Linux kernel.


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

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

if [ -e "/lib/modules/$RELEASE/modules.dep" ]; then 
  echo "Updating module dependency list for $RELEASE:"
  /sbin/depmod --quick
else 
  echo "Creating module dependency list for $RELEASE:"
  /sbin/depmod --all
fi

# Almost all necessary modules are automatically loaded when needed,
# but there are a few exceptions. Here's a (not all-inclusive) list:

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

#/sbin/modprobe tun            # Universal TUN/TAP device driver
#/sbin/modprobe sg             # Generic SCSI support for SATA DVD-RW

########################################################################
Note that loop was removed, as there's /etc/rc.d/rc.loop for that. I don't like it, but it's there.
 
3 members found this post helpful.
Old 11-11-2014, 10:36 PM   #11
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 1,808

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally Posted by GazL View Post
IMO there's no point maintaining a complete list of commented out modules as that information is available in the kernel documentation and Pat has better things to do with his time than maintain a list of kernel modules/descriptions that people could just look up elsewhere if they need to.
Just on that point, would it be worth creating a separate list of modules which is referenced by the rc.modules script when it looks for modules to load?

It'd keep the script nice and neat, and you could simply add module names to it as necessary.

Edit: Further to Robbie's point about extraneous rc scripts which only load one module (such as rc.loop and rc.netdevice), you could simply add the modules to this list during installation.

Last edited by rkelsen; 11-11-2014 at 10:44 PM.
 
Old 11-11-2014, 10:44 PM   #12
qweasd
Member
 
Registered: May 2010
Posts: 486

Rep: Reputation: Disabled
Robby, are you guys saying everything else in that script is not needed?
 
Old 11-12-2014, 12:12 AM   #13
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 1,971

Rep: Reputation: Disabled
qweasd: pretty much, yes :-)
rkelson: I don't think there are enough non-autoloaded modules remaining to make it worth doing that.
 
1 members found this post helpful.
Old 11-12-2014, 02:29 AM   #14
ReaperX7
Senior Member
 
Registered: Jul 2011
Location: California
Distribution: LFS-7.6, Slackware 14.1, FreeBSD 10.1
Posts: 3,849
Blog Entries: 15

Rep: Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189
A simplified script would be beneficial, however having a known-list would be helpful to system admins.
 
Old 11-12-2014, 04:24 AM   #15
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad W520
Posts: 4,676

Rep: Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237
Quote:
Originally Posted by ReaperX7 View Post
A simplified script would be beneficial, however having a known-list would be helpful to system admins.
Feel free to provide one and maintain it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Attention to Guild..... Sparks_ITCS Linux - Wireless Networking 8 02-16-2005 09:05 PM
How Can I Get Rolledoats Attention? benm89 General 3 12-12-2003 05:14 PM
Re: modprobe: Note: /etc/modules.conf is more recent than lib/modules/2.4.9/modules.d Andy.M Linux - General 1 01-24-2002 02:50 AM
Re: modprobe: Note: /etc/modules.conf is more recent than lib/modules/2.4.9/modules.d Andy.M Linux - Newbie 2 01-24-2002 02:40 AM


All times are GMT -5. The time now is 01:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration