LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 08-24-2003, 07:41 PM   #1
Moszer
LQ Newbie
 
Registered: Aug 2003
Location: Fargo, ND
Posts: 25

Rep: Reputation: 15
Custom Compile Problems


Hello All,

I am trying to do a custom compile (never done this before) with Slackware 9.0. I'm just trying to setup a simple nat server. Please bare with me, this is long but I would really appreciate the help.

I started with a default Slackware full install which gave me 2.4.20 but not everything for NAT (from what I could tell). I went through some of the docs and it looked like I needed to custom compile a kernel. They all pointed to having the source for your current kernel in /usr/src/kernel so I snagged that from the 'k' directory on the cd and did a

installpkg kernel-source-2.4.20-noarch-5.tgz

Which gave me the source for 2.4.20 in /usr/src/kernel

I then downloaded 2.4.21(newer is better I'm told), untar'd it into /usr/src/kernel/linux-2.4.21. Then setup a link by doing

ln /usr/src/kernel/linux-2.4.21 /usr/src/kernel/linux
(which points all commands from /usr/src/kernel/linux to /usr/src/kernel/linux-2.4.21 right?)

I then installed iptables 1.2.7a by doing

make KERNEL_DIR=/usr/src/kernel/linux

and

make install KERNEL_DIR=/usr/src/kernel/linux

from the directory created when I untarred iptables.

I then followed the "Kernel compiling guide for newbies"
from the top of this wonderful forum exactly and
edited lilo,
went to /usr/src/kernel/linux and
edited the make file,
ran make menuconfig
make dep
make clean
make bzImage
make
make install
make modules
make modules_install

and then rebooted. My new kernel boots just past the first line after lilo clears the screen and then real quick says something about the bios data (it's so fast I can't tell) then reboots it's self. My old kernel works fine though.

I tried this once and this happened, I wrote zero's to my drive, repeated the exact same steps again and it did the same thing.

So I am at an impass. Any help would be greatly appreciated.
I'm know I'm doing something wrong but I just can't figure out what it is..

Thanks!
 
Old 08-24-2003, 10:38 PM   #2
Blindsight
Member
 
Registered: Mar 2003
Distribution: Slackware
Posts: 234

Rep: Reputation: 30
You got the Kernel Source, good. Newer is not always better. For home use, it is because they have more drivers, bug fixes, etc. But in a business environment, sometimes there are horrendous bugs that spring out of the newest kernel, so it's a good idea to wait until there's a stable one out there that people aren't having many problems with, it fits your hardware, and there aren't bugs in it that really concern you much.

For organizations sake, I would delete the /usr/src/kernel directory, mkdir /usr/src/linux-2.4.21, ln /usr/src/linux-2.4.21 /usr/src/linux, mv /where-ever/linux-2.4.21.tar.gz /usr/src, tar xzvf linux-2.4.21.tar.gz . Catch all that?

This will put your linux kernel source in linux-2.4.21, and make a symbolic link (shortcut) called "linux" that points to linux-2.4.21. This comes in handy later when you compile things because, by default, when you compile programs it'll look in /usr/src/linux for certain header files.

Now, where your problem lies.. You compiled something into your kernel, or left something out (more probable) that's causing your system to freak out. When you follow the second paragraph's instructions, this'll clear out what you selected in 'make menuconfig', which is good, cause your selections jacked something up (it's normal, you're learning.)

Now, how to fix it.. A very very important rule is.. when in doubt, just hit enter. (For 'make config'.) I suggest you run through 'make config' instead of 'menuconfig' because it'll step you through everything (in text mode). There's a lot of junk there. If you don't know what something is, type ?, push enter, it'll tell you about most of the stuff that's in there.

I strongly suggest running through it this way because you learn exactly what all's in your kernel, and what's not in it. That's important too because, down the road, you'll be installing linux on other machines and you'll need other features or drivers. Some stuff is old, and you'll learn, in time, that you'll probably never use it.

When I compile my kernel, I do it in the following way..
make mrproper
make config
make dep
make bzImage
make modules
make modules_install

Then I copy the compiled kernel arch/i386/boot/bzImage to /vmlinuz or /vmlinuz.new. It's important you keep your working kernel, in case the new one doesn't work (as you found out.) Then I edit my lilo.conf, add a new entry for the new kernel, save, and run /sbin/lilo . Reboot and cross your fingers ;)

Some people have other variations for compiling their kernel, but I stick with my old ways because it works.

Compile in RAID support, if it's a newer board. If you don't know what IDE controller your motherboard has on it, try making a kernel with all or most of the RAID controllers compiled in until you figure out exactly what RAID driver your board uses. I've seen it produce freaky bios errors like that before, so that's one thing to try.

Try this and post with your results. If you get the same results, How far through booting the kernel does it get? try pushing "pause" on your keyboard right as the error comes up. Sometimes you can catch it and copy the error down. push any key to unhalt it, which'll probably prompt it to reboot.

Hope this helps.
 
Old 08-25-2003, 04:41 PM   #3
Moszer
LQ Newbie
 
Registered: Aug 2003
Location: Fargo, ND
Posts: 25

Original Poster
Rep: Reputation: 15
WOW, Thanks!

I'll give it a try..

I really appreciate the advice....
 
Old 08-26-2003, 04:38 PM   #4
Astro
Member
 
Registered: Jan 2003
Location: Ballston Lake, NY
Distribution: Slackware, Debian
Posts: 665

Rep: Reputation: 30
I still think it's unnecessary to run all the make install_this and make install_that commands..... I use make dep; make clean; make bzImage and thats all and my kernels never have a problem. I posted the same stuff in the newbie guide as well.
 
Old 08-26-2003, 07:17 PM   #5
Blindsight
Member
 
Registered: Mar 2003
Distribution: Slackware
Posts: 234

Rep: Reputation: 30
'make modules' makes the modules you selected in your kernel configuration.

'make modules_install' creates the directory in /lib/modules and "installs" them for you so you can just type "modprobe <module>" or use insmod to install your modules.

This is very important if you have a modular kernel. I don't think I've made a kernel that didn't have module support, I do a lot of playing.

In short, if you're using linux to learn, modularize your kernel.

An example of where you wouldn't want to use a modular kernel would be a paranoid environment, like maybe an ISP. I ran an ISP with 12 Linux servers and all of them had modular kernels. If you know what you're doing, you won't have problems.

Like I said, everyone has their kernel compilation quirks. I just wanted to explain what Astro threw out there to anyone that doesn't know. I like to stimulate thinking rather than "this is how I do it, you should do it this way too".
 
  


Reply



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
Slackware-Current & Custom Compile slaxnoob Slackware 2 01-12-2010 01:40 PM
questions about custom compile byte.chaser Debian 36 07-14-2005 06:51 PM
Does anyone custom compile xorg? dhave Slackware 11 03-07-2005 03:06 AM
custom geforce video card--custom module? bandofmercy Linux - Hardware 3 10-14-2004 06:52 PM
Problems trying to compile custom ATI binary driver guerilla fighta Linux - Software 0 02-13-2003 04:53 PM

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

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