LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices



Reply
 
Search this Thread
Old 12-27-2010, 06:09 AM   #1
darkstarbyte
Member
 
Registered: May 2010
Location: 3 planets away from the sun.
Distribution: Linux mint, Slackware
Posts: 234

Rep: Reputation: 2
I am really nervous about compiling my own kernel on Slackware and...


I am really nervous about this compiling of my kernel on Slackware. I have never built a kernel on Slackware before and I am wondering what to do. I have been following instructions on Alien Bob's site and because it's some what out dated I am wondering what has changed and what I should be doing? I compiled it in the /usr/src/ as he has advised for Slackware and I am in the middle of compiling it right now. How should I update Lilo for this new kernel? I am using Slackware 13.1 Please can some one help me or give me reassurance about this. Thanks for your help.

PS.
I am compiling my own kernel for speed, and to cut out support for hardware I don't have. (In the hopes of saving ram like in my Gentoo desktop where I cut down 100 megs of unnecessary ram usage.) I am using the latest stable vanilla kernel from www.kernel.org. One more thing thanks for reading this and the help you may provide to me in this dying matter.
 
Old 12-27-2010, 07:50 AM   #2
mudangel
Member
 
Registered: May 2008
Location: Ohio
Distribution: Slackware
Posts: 267

Rep: Reputation: 48
It's really not that big a deal; if it doesn't work right, just use the stock kernel and try again 'til it does. Alien Bob's guide looks pretty much like the way I do it, so you should be fine with that(it covers the lilo thing too, btw).
Good luck, and if you run into trouble, just ask... there are plenty of folks here who will be happy to help.
 
Old 12-27-2010, 09:06 AM   #3
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,176
Blog Entries: 4

Rep: Reputation: 430Reputation: 430Reputation: 430Reputation: 430Reputation: 430
I have followed Alien Bob's guide many times and it has never steered me wrong. Just take your time, follow all of the steps and think about what you are doing. Don't be afraid to google some of the options to ensure that they match your hardware. And, as mudangel says, if it goes wrong just boot into an existing known working kernel and try to fix the compile.
 
Old 12-28-2010, 12:08 AM   #4
comet.berkeley
Member
 
Registered: Dec 2009
Location: California
Distribution: Slackware current
Posts: 153

Rep: Reputation: Disabled
Save the old kernel and the kernel modules first before installing a new kernel.

Then if something goes wrong and the system will not boot, then these files can be put back by booting the slackware install cdrom (or dvd).

The old kernel comprises the kernel itself and the /lib/modules directory
that goes with the kernel.

For me they are:

1) /boot/vmlinuz-huge-smp-2.6.33.4-smp

2) /lib/modules/2.6.33.4-smp/

And the config and the System.map (but they are not essential)

3) /boot/config-huge-smp-2.6.33.4-smp

4) /boot/System.map-huge-smp-2.6.33.4-smp

It is okay to have multiple /lib/modules/... kernel modules sub directories, so I leave the old one alone until you have tested the new kernel for a while.

But the /boot files and symbolic links often get overwritten by the install process:

/boot/vmlinuz
/boot/config
/boot/System.map

So for example to back up my system I might create a "/boot-save" directory and copy the old kernel files there from the /boot directory:

mkdir /boot-save
cp -a /boot/vmlinuz-huge-smp-2.6.33.4-smp /boot-save
cp -a /boot/config-huge-smp-2.6.33.4-smp /boot-save
cp -a /boot/System.map-huge-smp-2.6.33.4-smp /boot-save
 
Old 12-29-2010, 06:15 AM   #5
mudangel
Member
 
Registered: May 2008
Location: Ohio
Distribution: Slackware
Posts: 267

Rep: Reputation: 48
Quote:
Originally Posted by comet.berkeley View Post
But the /boot files and symbolic links often get overwritten by the install process:

/boot/vmlinuz
/boot/config
/boot/System.map
It's easier to to do make install_modules, then manually cp the kernel and System.map, rather than doing make install- then the old kernel remains in place, and can be selected at boot if needed.
 
Old 12-29-2010, 09:45 PM   #6
EdGr
Member
 
Registered: Dec 2010
Location: California, USA
Distribution: Slackware
Posts: 117

Rep: Reputation: 22
The easiest way to cut down on kernel bloat in Slackware is to switch from the huge kernel to the generic kernel. The generic kernel requires an "initial ramdisk" as described in /boot/README.initrd

The second easiest way (which is still easy and is my preferred method) is to compile a custom kernel based on config-generic-2.6.35.7, but has built-in support for the filesystems in use on your machine. The custom kernel won't require an initrd.

sdiff -s /boot/config-generic-2.6.35.7 /boot/config-huge-2.6.35.7

will give you an idea of what doesn't need to be built-in to the kernel.
Ed
 
Old 01-01-2011, 03:36 PM   #7
comet.berkeley
Member
 
Registered: Dec 2009
Location: California
Distribution: Slackware current
Posts: 153

Rep: Reputation: Disabled
mudangel wrote:
Quote:
It's easier to to do make install_modules, then manually cp the kernel and System.map, rather than doing make install- then the old kernel remains in place, and can be selected at boot if needed.
12-27-10 09:08 PM
After doing "make install_modules" I do this:

make bzlilo

which builds the bzImage, installs it into the /boot directory and then runs lilo.
 
Old 01-02-2011, 07:43 PM   #8
darkstarbyte
Member
 
Registered: May 2010
Location: 3 planets away from the sun.
Distribution: Linux mint, Slackware
Posts: 234

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by comet.berkeley View Post
mudangel wrote:


After doing "make install_modules" I do this:

make bzlilo

which builds the bzImage, installs it into the /boot directory and then runs lilo.
Thanks for your comment, but I have this question do run it like this.

make && make install_modules
make bzlilo
 
Old 01-10-2011, 11:11 AM   #9
comet.berkeley
Member
 
Registered: Dec 2009
Location: California
Distribution: Slackware current
Posts: 153

Rep: Reputation: Disabled
Quote:
Originally Posted by darkstarbyte View Post
Thanks for your comment, but I have this question do run it like this.

make && make install_modules
make bzlilo
Sure, there are lots of ways to build a kernel.

the "&&" in make and make install_modules is shorthand for "and"

So it says to run "make" and if it works okay then run "make install_modules"

You could just do it like this which is what I usually do:

make
make install_modules
make bzlilo

Or as others such as Alien Bob suggest:

make
make install_modules

copy the bzImage to /boot/vmlinuz
copy the System.map to /boot/System.map

lilo

One of the ways I learned about all this was by reading the /usr/src/linux/README
 
Old 01-10-2011, 11:43 AM   #10
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
I don't see 'bzlilo' in the makefile, is this option only in newer kernels or something ?
 
Old 01-11-2011, 01:59 AM   #11
comet.berkeley
Member
 
Registered: Dec 2009
Location: California
Distribution: Slackware current
Posts: 153

Rep: Reputation: Disabled
Quote:
Originally Posted by H_TeXMeX_H View Post
I don't see 'bzlilo' in the makefile, is this option only in newer kernels or something ?
bzlilo is actually old but out of fashion as many Linux distributions use grub now instead of lilo.

It is in the /usr/src/linux/arch/x86/Makefile

There are some other interesting targets there including: bzImage and isoimage
 
1 members found this post helpful.
  


Reply

Tags
compiling, kernel, lilo, slackware, vanilla


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
Re-compiling the Slackware kernel bogzab Slackware 12 04-10-2008 06:53 PM
slackware 10.2 compiling kernel sharathg786 Slackware 3 07-31-2006 05:08 PM
slackware 10.2: compiling the kernel? sharathg786 Slackware 2 07-31-2006 09:14 AM
Errors Compiling Kernel 2.6 on Slackware 10.2 - Old kernel headers required? Dave S. Slackware 8 03-04-2006 01:15 AM
Compiling new kernel with Slackware 10 madhatter2 Linux - Newbie 2 07-29-2004 05:08 PM


All times are GMT -5. The time now is 05:09 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration