LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 05:09 AM   #1
darkstarbyte
Member
 
Registered: May 2010
Location: 3 planets away from the sun.
Distribution: Slackware and Fedora
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, 06:50 AM   #2
mudangel
Member
 
Registered: May 2008
Location: Ohio
Distribution: Slackware
Posts: 267

Rep: Reputation: 56
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, 08:06 AM   #3
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
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-27-2010, 11:08 PM   #4
aaazen
Member
 
Registered: Dec 2009
Posts: 358

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, 05:15 AM   #5
mudangel
Member
 
Registered: May 2008
Location: Ohio
Distribution: Slackware
Posts: 267

Rep: Reputation: 56
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, 08:45 PM   #6
EdGr
Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 998

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
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, 02:36 PM   #7
aaazen
Member
 
Registered: Dec 2009
Posts: 358

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, 06:43 PM   #8
darkstarbyte
Member
 
Registered: May 2010
Location: 3 planets away from the sun.
Distribution: Slackware and Fedora
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, 10:11 AM   #9
aaazen
Member
 
Registered: Dec 2009
Posts: 358

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, 10:43 AM   #10
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
I don't see 'bzlilo' in the makefile, is this option only in newer kernels or something ?
 
Old 01-11-2011, 12:59 AM   #11
aaazen
Member
 
Registered: Dec 2009
Posts: 358

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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 05:55 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