| Linux - Kernel This forum is for all discussion relating to the Linux kernel. |
| 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-27-2010, 05:09 AM
|
#1
|
|
Member
Registered: May 2010
Location: 3 planets away from the sun.
Distribution: Linux mint, Slackware
Posts: 228
Rep:
|
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.
|
|
|
|
12-27-2010, 06:50 AM
|
#2
|
|
Member
Registered: May 2008
Location: Ohio
Distribution: Slackware
Posts: 267
Rep:
|
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.
|
|
|
|
12-27-2010, 08:06 AM
|
#3
|
|
Moderator
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,088
|
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.
|
|
|
|
12-27-2010, 11:08 PM
|
#4
|
|
Member
Registered: Dec 2009
Location: California
Distribution: Slackware,OpenBSD
Posts: 96
Rep:
|
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
|
|
|
|
12-29-2010, 05:15 AM
|
#5
|
|
Member
Registered: May 2008
Location: Ohio
Distribution: Slackware
Posts: 267
Rep:
|
Quote:
Originally Posted by comet.berkeley
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.
|
|
|
|
12-29-2010, 08:45 PM
|
#6
|
|
Member
Registered: Dec 2010
Location: California, USA
Distribution: Slackware
Posts: 84
Rep:
|
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
|
|
|
|
01-01-2011, 02:36 PM
|
#7
|
|
Member
Registered: Dec 2009
Location: California
Distribution: Slackware,OpenBSD
Posts: 96
Rep:
|
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.
|
|
|
|
01-02-2011, 06:43 PM
|
#8
|
|
Member
Registered: May 2010
Location: 3 planets away from the sun.
Distribution: Linux mint, Slackware
Posts: 228
Original Poster
Rep:
|
Quote:
Originally Posted by comet.berkeley
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
|
|
|
|
01-10-2011, 10:11 AM
|
#9
|
|
Member
Registered: Dec 2009
Location: California
Distribution: Slackware,OpenBSD
Posts: 96
Rep:
|
Quote:
Originally Posted by darkstarbyte
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
|
|
|
|
01-10-2011, 10:43 AM
|
#10
|
|
Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,610
|
I don't see 'bzlilo' in the makefile, is this option only in newer kernels or something ?
|
|
|
|
01-11-2011, 12:59 AM
|
#11
|
|
Member
Registered: Dec 2009
Location: California
Distribution: Slackware,OpenBSD
Posts: 96
Rep:
|
Quote:
Originally Posted by H_TeXMeX_H
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.
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:30 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|