LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 10-11-2006, 12:23 AM   #1
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Questions about building a new kernel - using /usr/src/linux and rc.modules


Hi people, I'm planning to get the source from kernel.org and build myself a kernel. I'm currently using the default 2.4.33.3 and /etc/rc.d/rc.modules is a symlink to /etc/rc.d/rc.modules-2.4.33.3. If I do build my own kernel, what do I do? Do I need to write a new rc.modules-2.6.x.y and then symlink rc.modules to it? :/.

While I'm here, I might as well ask about what it says in the README. It says not to use /usr/src/linux, because "has a (usually incomplete) set of kernel headers that are used by the library header files. They should match the library, and not get messed up by whatever the kernel-du-jour happens to be". It advises you to put the source in, e.g. your home directory. That doesn't seem very "natural" to me, /usr/src/2.6.x.y seems more "proper". I'm just a bit confused by what it says. Can someone explain please?

Thanks.
 
Old 10-11-2006, 12:51 AM   #2
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
Quote:
Hi people, I'm planning to get the source from kernel.org and build myself a kernel. I'm currently using the default 2.4.33.3 and /etc/rc.d/rc.modules is a symlink to /etc/rc.d/rc.modules-2.4.33.3. If I do build my own kernel, what do I do? Do I need to write a new rc.modules-2.6.x.y and then symlink rc.modules to it?
Unless there is a newer way to kernel compile, you will need to make your own rc.modules (or if you're lazy like me, grab the one for Slax).

Quote:
While I'm here, I might as well ask about what it says in the README. It says not to use /usr/src/linux, because "has a (usually incomplete) set of kernel headers that are used by the library header files. They should match the library, and not get messed up by whatever the kernel-du-jour happens to be". It advises you to put the source in, e.g. your home directory. That doesn't seem very "natural" to me, /usr/src/2.6.x.y seems more "proper". I'm just a bit confused by what it says. Can someone explain please?
The kernel headers that were used to compile gcc/glibc are provided as a seperate package. Keep these headers installed and you shouldn't have any problems building in src. I don't know of any programs that still use the /usr/src/linux sim link, but you can always just delete the link if you're worried about it.

enjoy the new kernel!
...drkstr

Last edited by drkstr; 10-11-2006 at 12:52 AM.
 
Old 10-11-2006, 03:48 AM   #3
Steve50
Member
 
Registered: Nov 2004
Location: Coventry, UK
Distribution: Debian Lenny, Ubuntu Feisty
Posts: 121

Rep: Reputation: 15
Quote:
Hi people, I'm planning to get the source from kernel.org and build myself a kernel. I'm currently using the default 2.4.33.3 and /etc/rc.d/rc.modules is a symlink to /etc/rc.d/rc.modules-2.4.33.3. If I do build my own kernel, what do I do? Do I need to write a new rc.modules-2.6.x.y and then symlink rc.modules to it? :/.
Hi, I hadn't noticed that rc.modules was a symlink to the 2.4 rc.modules config file. However, it's never caused me any problems. When I've added new modprobe commands to rc.modules it still works with my custom 2.6 kernel. I just followed Alien Bob's how to here:

http://alien.slackbook.org/dokuwiki/...kernelbuilding
 
Old 10-11-2006, 09:19 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Original Poster
Rep: Reputation: Disabled
Thanks both, especially for that link to Eric's kernel building page.

Nice one.
 
Old 10-11-2006, 10:49 AM   #5
zetabill
Member
 
Registered: Oct 2005
Location: Rhode Island, USA
Distribution: Slackware, Xubuntu
Posts: 348

Rep: Reputation: 32
I'm with Steve50. It had never occurred to me that I should create my own rc.modules file for my custom kernel. Within the first hour of running Slackware 11 I was compiling my own custom kernel. I still keep the "huge" 2.6.17.13 kernel in there for emergencies, however. So I figured that just adding my own modprobes to that rc file was just fine?

So here's my other question about this. If for some reason that people start going around making their own rc.modules files should we reinclude certain things? Here are a few examples of what I mean from rc.modules-2.6.17.13:
Code:
# Determine the version of the running kernel:
RELEASE=$(uname -r)
# Also determine a "short release" such as 2.4, 2.6, etc.
SHORTREL=$(echo $RELEASE | cut -f 1,2 -d .)

### 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 -type f -mindepth 2 -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
Code:
# Determine the filename for kernel symbols under /proc.
# (this is ksyms on 2.4 kernels and kallsyms on newer kernels)
if [ -r /proc/ksyms ]; then
  KERNEL_SYMBOLS=/proc/ksyms
elif [ -r /proc/kallsyms ]; then
  KERNEL_SYMBOLS=/proc/kallsyms
fi
Code:
# First, if setup probing found a network card, there may be an 'rc.netdevice'
# file that we should run to load the network module:
if [ -x /etc/rc.d/rc.netdevice ]; then
  . /etc/rc.d/rc.netdevice
fi
I can see how that last one... the rc.netdevice call... could be either ignored or included in rc.local or something.

It seems to me, though, that the first two look pretty important. When you compile a new kernel yourself, does the new kernel take care of that stuff already? And if so then why would this type of "script" be necessary at all?

I personally just don't really see the need to create a new rc.modules. It seems just too simple to comment out the few modprobes that aren't necessary than to create something entirely new...

Now if it's done to be different... then by all means be different...

The only reason why I don't compile in /usr/src is because my user doesn't have the permissions for that folder and I don't feel very comfortable having a root console open the whole time. The other thing I don't really like is that I usually make xconfig more now than make menuconfig and that root console doesn't have an xserver. It's just easier to create a directory where I have permissions to do my work and then just su to install.
 
Old 10-11-2006, 11:09 AM   #6
Steve50
Member
 
Registered: Nov 2004
Location: Coventry, UK
Distribution: Debian Lenny, Ubuntu Feisty
Posts: 121

Rep: Reputation: 15
Hi zetabill, you might be interested in this post:

http://www.linuxquestions.org/questi...ght=rc.modules

In /etc/rc.d/rc.S there's a good explanation of the the rc.module files:

Quote:
# This loads any kernel modules that are needed. These might be required to
# use your ethernet card, sound card, or other optional hardware.
# Priority is given first to a script named "rc.modules.local", then
# to "rc.modules-$FULL_KERNEL_VERSION", and finally to the plain "rc.modules".
# Note that if /etc/rc.d/rc.modules.local is found, then that will be the ONLY
# rc.modules script the machine will run, so make sure it has everything in
# it that you need.
So my interpretation would be that udev loads any essential drivers at startup from /lib/modules/<kernel version number> and the kernel specific rc.modules files are just for additional drivers that you want to load - and rather than uncommenting them in rc.modules-<kernel version number> you could also add the modprobe command to rc.modules. So on that basis it isn't necessary to create a new rc.modules file each time you compile a new kernel.
 
  


Reply



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
kernel includes at /usr/src/linux/include do not match current kernel. blanny Red Hat 1 03-09-2006 07:53 AM
Building new kernel in /usr/src/linux is WRONG? jisse Linux - Software 3 09-14-2003 04:57 AM
kernel recompilation: /usr/src/linux orca Linux - Distributions 5 03-04-2003 08:53 AM
Creating /usr/src/linux-<xx> from kernel.<xx>.src.rpm jmourik Linux - Newbie 2 02-19-2003 03:24 PM
no kernel in usr/src/Linux elite Linux - General 11 10-28-2002 05:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:17 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
Open Source Consulting | Domain Registration