Questions about building a new kernel - using /usr/src/linux and rc.modules
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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:
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.