LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   kernel for newbies (https://www.linuxquestions.org/questions/debian-26/kernel-for-newbies-92887/)

robojerk 09-15-2003 12:13 AM

kernel for newbies
 
Okay, if there were a book called "Linux kernel compiling for dummies" I'd buy it. I installed Debian with the 2.4 bf kernel and wanted to try to compile a kernel. I followed the instructions " how to compile a kernel the debian way" and now I get lots of errors when I boot up wih the new kernel and my NIC no longer works. If anyone could direct me to some link or something on how to correctly make a config for a new kernel using menuconfig I'd appreciate it. I've been looking all over google and there's little detail on how to config. If I could use the kernel config as a guide to making my own I'd like to know how.

LSD 09-15-2003 01:27 AM

Personally, I'd avoid the "Debian Way" of compiling the kernel as it just seems like it overcomplicates the procedure to a ridiculous extreme without returning any real benefit. Just compile it the old fashioned way:

Quote:

make dep && make clean && make bzImage && make modules && make modules_install
cp arch/i386/bzImage /boot/bzImage-whatever

and make the necessary edits to your bootloader config files before recomitting it to the MBR if it needs it.

Configuration depends largely on your system configuration which is why most tutorials gloss over it, they can't provide tips for every conceivable system so they leave it up to the user. A bit harsh perhaps, but it really isn't practical to do it any other way. If you can post a log of the errors you're getting (like say, piping the output of the dmesg command into a file and then linking it somewhere on the net), along with a summary of your system specs then perhaps someone here can help you out.

robojerk 09-15-2003 03:15 AM

Getting internet is probably my #1 goal but when I boot up I see tons of modules failing to load. I am a complete newbie at compiling a kernel so I do appreciate your honesty on how no one goes into configuration, but compiling it was easy, to bad I need a correct configuration to have the compiled kernel to even work right. I've read the steps on how to compile the kernel several different ways, I just need the darn thing configured. =)

My system specs are:
Soyo P4x400 Ultra Mainboard
VIA P4X400/8235 chipset
NIC = RTL8139 chipset
Audio = CMI 8738
USB 2.0
Not using RAID
Not using spdif sound connector, just 2.1 stereo sound =)
Geforce fx 5200 Ultra
P4 2.26
1GB Ram
VIA OHCI compliant 1394/Firewire card
CD-RW
DVD
DVD+/- R (on USB 2.0 Connection)

BittaBrotha 09-15-2003 03:32 AM

You first need to download two packages, so run apt-get install kernel-package and then apt-get install libncurses5-dev.

You may already have these.

Now you need to decide which version of the kernel you want to build. You can go to www.kernel.org and have the pick of the litter. Here, we're going to build 2.4.20. You can download it with apt-get install kernel-source-2.4.20.

You may use the latest kernel which is 2.4.22

After this has completed, change directories to /usr/src. Next you need to link the kernel version directory to Linux with ln -s kernel-source-2.4.20 linux . Now, change directories to Linux, and run make menuconfig. This presents you with a text-based menu where you can switch between kernel parameters. A help menu even is available for assistance if you are not sure what something means. To complete this step successfully, it is imperative that you know the intricate components that make up your laptop. Many kernel parameters are extremely specific. Be prepared to know minute details, for example, which AGP controller, sound card chipset, video card chipset, USB controller or ATA Bus adapter your laptop has.

After you have gone through the lengthy process of selecting the parameters you like, there are a few different ways to compile the kernel. One way is to run make-kpkg clean and then make-kpkg --revision yourname.1 kernel_image. This uses the make-kpkg utility, a Debian tool used to assist you with compiling kernels. It compiles the kernel and all associated modules and puts them in a .deb package one directory below your kernel source. After you have built the package you can install it with the dpkg utility. I like this because it's easy to keep multiple kernel compiles around. Especially if you are troubleshooting a problem, your latest compile may not be the best. If you're having a problem, all you have to is install an older, more successful one.

The make-kpkg method replaces the more standard six step method of


make dep
make
make bzImage
make modules
make install
make modules_install

Both techniques work, but if you are trying a kernel recompile on a non-Debian system, you do not have the make-kpkg utility at your disposal.

After you have compiled and installed your new kernel, reboot to see how its working. Don't fret if you get some random errors here and there. You can always chase those down. Your main worry is if you get to a valid prompt and the system is coming up in multi-user mode. If the system boots completely, you have jumped the first big hurdle. You can run uname -a to verify that you are indeed running the latest kernel.


This was taken from the

Debian Install on a Laptop article.

It may give you a better idea on how to do it.

robojerk 09-15-2003 03:53 PM

Need config help
 
I can get it to complile fine and it boots up fine, I just have no internet. I do see my NIC as a list of choices in the menuconfig so I select it, but it doesn't work.

subnet 09-16-2003 02:33 AM

Net:
To fix your net use

modconf

select the kernel/drivers/net

and find the NIC you have

Hit Enter and see if the module is properly installed, else try another one..

Kernel issues:
Now that you are posting this thread under Debian distributions, why not use the apt-get to get and install the kernel..?

apt-cache search kernel-image-2.4.

Find the image that fits ur box

apt-get install kernel-image-2.4.(the one u selected)

after the compile, if you are using lilo as a bootloader, i know that you have to add the line

initrd=/initrd.img

to the image=/wmlinuz

And done..

Maybe write cat /proc/version to check your kernel version..

BittaBrotha 09-21-2003 12:51 AM

Re: Need config help
 
Quote:

Originally posted by robojerk
I just have no internet. I do see my NIC as a list of choices in the menuconfig so I select it, but it doesn't work.
Did you get it working?

johnMG 09-22-2003 12:46 PM

Well, I guess I'm a little late to this thread. I totally see what you mean rj. It would be great if someone wrote an app to help you (ie. give you advice) to get your .config together.

My guess is that, the current way it's done is:

- make sure you know what components and chipsets are in your system

- look at the output of 'dmesg'

- look at your /var/log/XFree86.0.log

- note the output of 'lspci'

- note ouput of other commands I'm missing here (like maybe glxinfo)

- and finally, read the little help sections in 'make menuconfig' for each (yes, there's a ton) option.


All times are GMT -5. The time now is 07:36 AM.