LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (http://www.linuxquestions.org/questions/debian-26/)
-   -   Compiling a Kernel for the first time? (http://www.linuxquestions.org/questions/debian-26/compiling-a-kernel-for-the-first-time-373386/)

RodWC 10-15-2005 02:31 PM

Compiling a Kernel for the first time?
 
Hello all, I am a very fresh newbie to Linux, and have reached the very scary conclusion that I should recompile. I have a few questions.

I have kernel 2.6.8.something or other (Debian 3.1, sarge), and I was wondering if I should download a later one like 2.6.13? Or if I have to download one at all to recompile? If these questions seem dumb, it's probably because I'm still dumb with Linux! Not that I'm trying to make excuses for myself or anything . . .

I also run my Debian on a laptop, and I would like to be able to "hibernate" as booting takes longer than Windows did! I downloaded software suspend 2, but apparently have to compile it into the kernel along with ACPI or APM (or something like that). I am clueless as to how to do this. And "compile" and "recompile" are still very scary words in my Linux vocabulary. Yup, I guess I'm that green. I think I should really know how to do this though, and I can't make head or tail of many of the instructions I have come across.

Any advice?

Somewhat unrelated question, but why does "Starting MTA:" take so long during the boot?

debianmike 10-15-2005 02:37 PM

www.debian-administration/articles/202

MTA is the mail transport agent...i think it takes a while 'cause i think its looking for mail servers for the domain its in, which it cant' find, so it finally gives up...i think

RodWC 10-16-2005 07:35 AM

Okay, I got as far as "make-kpkg" in the case of which my computer tells me "command not found". So, I'm a little stuck there.

I accidentally entered "make" by itself once and it started doing something which took a lot of CPU and a long time, but it ended with a bunch of errors and never did make any file. Is 'make-kpgk' a standard thing in Debian? Cause it's not in mine!

cybrog 10-16-2005 08:05 AM

Here'a a link to Debian-Kernel-Compile-Howto (Kernel 2.6). Maybe this will be of some help.

RodWC 10-16-2005 08:17 AM

Thanks! yes both of these articles are helpful. Once I get done, I can tell I will think it is very easy.

Anyway, I found the 'kernel-package' thing on the Debian site, so I am able to use "make-kpkg".

Whoopsie, looks like I did something wrong. It stopped while building my kernel:

KSYM .tmp_kallsyms2.S
AS .tmp_kallsyms2.o
LD vmlinux
SYSMAP System.map
SYSMAP .tmp_System.map
Inconsistent kallsyms data
Try setting CONFIG_KALLSYMS_EXTRA_PASS
make[1]: *** [vmlinux] Error 1
make[1]: Leaving directory `/usr/src/linux-2.6.13.4'
make: *** [stamp-build] Error 2
CPX:/usr/src/linux-2.6.13.4#

Could this have anything to do with it telling me that it won't compile cleanly when I patched it with the Software Suspend 2 patch? Rats, and I really wanted to be able to hibernate.
Well I guess this will have to wait as it's time for church. l

cybrog 10-16-2005 09:01 AM

See if the information in this link helps. inconsistent kallsyms data

RodWC 10-18-2005 02:36 PM

Thank you, that did help.
I successfully compiled my first kernel in Sarge (2.6.13.4), but now it stopped detecting my network PC card on my laptop (Netgear, PCMCIA, 16bit, 100mbps, “FA411”). I did disable the ISA support in the kernel, as well as most SCSI and perhaps a few PCI. I'm almost positive I did not undo anything having to do with PC card or PCMCIA. I even compiled a second time and enabled more PCMCIA and network/ethernet stuff. Still no luck. What did I do wrong?

Any more advice?

Thanks again.

jlinkels 10-18-2005 07:01 PM

RodWC:

Some advice to a newbie:

1. Read this: how to compile a kernel in Debian until you can memorize large parts by heart.

2. Using a Debian kernel is OK. Have a recent kernel image installed, or use the one which came with the distribution (binary, not source)

3. Copy the configuration which came with your kernel to /usr/src/linux/.config (note the dot in front of config). Run make menuconfig, look around in the config program, save your new configuration. Don't change anything in the config or your source!

4. Compile the kernel according to the directions in the manual, and install the new image.

5. Try to boot from the new image, and make sure everything works as before.

If you work like this, you start from a safe point where you know that you are compiling the kernel in the correct way. Otherwise, you are trying to solve 3 problems (patching, compiling, finding the errors) at the same time. That's impossible.

I have installed many different machines which required patches, including laptops, and I always started this way. Just to make sure that the _standard_ unpatched kernel compiled and installed correctly.

Some notes on swsuspend2: It doesn't patch correctly on all kernels. Debian kernels are even more difficult. You'd might have to use a pristine kernel. Refer to the manual how to do that. Scrap making initrd, you don't need it. Using intitrd in swsusp2 is complicated.

2.6.13 didn't work on my laptop, I stuck with 2.6.12.

WARNING: Debian uses initrd as a standard. As soon as you don't use it, you get a kenrel panic because the IDE drivers are not compiled in. Make sure you add IDE drivers to the kernel in make menuconfig, and NOT as a module. This is a config file for 2.6.12 on my laptop

Take a look at http://www.tuxmobile.org and see if your laptop is mentioned there.

jlinkels

RodWC 10-18-2005 09:13 PM

Thanks, I will read through that ASAP. The thing is, I really didn't change much in the configuration (I could probably find everything I changed). When I boot the kernel, I get the message "cardmgr[I forget what number is here, would that help?]:no sockets found!" That is the only bug in the whole system as far as I can tell. It would be nice if I only had to recompile once instead of twice or more, but hey, what use is being a newbie without a little "experience"? :)

I will gladly accept a short-cut to fixing this, however, if anyone has experienced a similar problem.

RodWC 10-29-2005 08:00 AM

failed to load pcmcia_core
 
Okay, I finally got around to recompiling again. I loaded the old configuration file (from 2.6.8), and didn't change anything except to remove 3Dlabs, which was causing an error in compilation. It took nearly three hours to compile since I didn't remove anything.

But NOW I get the message (on boot up) saying that it "failed to load pcmcia_core". What now? Is it a problem with the 2.6.13.4 kernel itself?

mrcheeks 10-29-2005 10:16 AM

maybe pcmcia is built-in now and not compiled as a module.
If it is working but the message bothers you edit the file /etc/modules and remove the reference to pcmcia.

RodWC 10-29-2005 12:40 PM

No, pc card still is not working. :(

RodWC 10-31-2005 06:55 AM

Problem solved! Used the new 2.6.14 kernel. Everything is working fine now.


All times are GMT -5. The time now is 05:17 PM.