LinuxQuestions.org
Help answer threads with 0 replies.
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 07-14-2014, 08:03 AM   #1
slacker_et
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 140

Rep: Reputation: 27
Question Ran into a little trouble compiling a new kernel a couple days ago.


With my Slackware machines I usualy compile my own kernel to get rid of features I don't need and build in modules that I do need.
In my boot loader I usually have two entries. One for a working kernel and one for a test kernel.

When building my kernels I have always run:
1) make dep
2) make clean
3) make bzImage

and then copy the newly built kernel to the location of the test kernel as specified in the boot loader.
ie. /boot/vmlinuz.tst

Well I don't directly copy it directly to that location.
I actually copy it to /boot/vmlinuz.tst.new
and then use the mv command to rename /boot/vmlinuz.tst to /boot/vmlinuz.tst.sav
and use mv to rename /boot/vmlinuz.tst.new to /boot/vmlinuz.tst

Anyway. The other day I decided to build in some of the modules used by my Slackware64 14.1 desktop machine into the kernel.
I did my usual steps for compiling a new kernel. WITH one difference.
I've noticed that within the past year or so. That when running "make dep" I would get a message that "make dep" is no longer required.
So this time I only ran "make clean" and "make bzImage". And then did my usual steps for booting with the test kernel I just built.

Using this new kernel I noticed that many programs were not running. Because they were failing to find required modules running.
Modules that I just built into this new kernel. So I tried loading them with modprobe.
But they failed to load with "ERROR: could not insert Exec format error" and something about owned by the kernel.

So I then rebooted with my working kernel. BUT it had the exact same issues.
Since it was late at night I was afraid I accidently overwrote my working kernel and restored it from backup.
But even the restored kernel had the same issues.

So I rebuilt my working kernel by using the .config that was saved from when it was first built.
But even that kernel had the same issues.

I finally resorted to rebuilding my working kernel AND rebuilding all modules with "make modules module_install".
That solved the issue.
But now I am right back to where I was before I attempted to build needed module into the kernel.

So my questions are:
1) What happened and why did the modules have to be rebuilt ?
2) Is "make dep" truly needed ? And that message about it not being needed; is bogus ?


Thanks;
--ET
 
Old 07-14-2014, 10:17 AM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,184

Rep: Reputation: Disabled
make dep have been obsoleted a long time ago (since Linux 2.6 IIRC).

Of course you need to build and install the modules every time you compile a kernel.

to know the available targets for "make" type "make help" in /usr/src/linux-<version>.

Just follow Pat's instructions: see in the installation media the file /source/k/README.TXT, but in addition do not forget make modules && make modules_install

Or if you want more details, see these instructions provided by Eric Hameleers.
 
Old 07-14-2014, 04:52 PM   #3
Uncle Lumpy
Member
 
Registered: Feb 2010
Posts: 63

Rep: Reputation: 48
My steps for building a Linux kernel:

1) download source from kernel.org and uncompress the downloaded file
2) cd into the kernel directory
3) run make mrproper
4) prepare a .config file in the kernel directory (I typically cp the config file from the running kernel into the kernel directory and then run make olddefconfig)
5) then i run make -j7 (to take advantage of my multicore processor)
6) then i su into root
7) next i run make modules_install
8) then i copy the bzImage, System.map, and .config files to the their respective files in the /boot directory
9) modify /etc/lilo.conf properly
10) finally run /sbin/lilo -v and reboot to the new kernel

So basically for me it's:
make mrproper
make olddefconfig
make -j7
make modules_install

Lumpy
 
Old 07-16-2014, 08:28 AM   #4
slacker_et
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 140

Original Poster
Rep: Reputation: 27
Thanks for the replies.

But I'm still curious as to why I had to rebuild the modules this time.
In the past I've never had to rebuild modules when rebuilding a kernel. And never encountered any issues during those times.
 
Old 07-16-2014, 08:54 AM   #5
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,184

Rep: Reputation: Disabled
Compatibility of an old module with a more recent kernel vary. But it's useless to take a risk, so you should _always_ rebuild and install the modules when you compile and install a new kernel. Recommended reading:
Code:
man modprobe
 
  


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
Azureus freezing up, was running fine a couple of days ago. ChootarLaal Ubuntu 1 03-13-2008 09:56 PM
Passed CNE two days ago sundri Linux - Certification 1 10-17-2006 12:03 PM
Signed up a couple weeks ago penguinkid LinuxQuestions.org Member Intro 1 04-04-2006 01:37 PM
remove a folder created 3 days ago. eduac Linux - Software 4 10-17-2005 11:15 AM

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

All times are GMT -5. The time now is 09:52 PM.

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