LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Building my first kernel : Couple of Problems (https://www.linuxquestions.org/questions/linux-newbie-8/building-my-first-kernel-couple-of-problems-408332/)

koodoo 01-26-2006 03:08 PM

Building my first kernel : Couple of Problems
 
Hi,

I am working on Slackware 10.0 The kernel version is 2.4.26 I downloaded the 2.6.14.2 kernel and tried to build and install it. The source tree I used for installation was kept in ~/insight/linux-2.6.14.2. This is what I did :
Code:

koodoo@knapsacker:~/insight/linux-2.6.14.2$ make defconfig
So that it would chose the default configurations for my architecture. I then did :
Code:

koodoo@knapsacker:~/insight/linux-2.6.14.2$ make
After that I copied arch/i386/boot/bzImage to /boot/vmlinuz (after backing up my old kernel image). I then ran lilo. For installing the kernel modules I ran as root :
Code:

root@knapsacker:/home/koodoo/insight/linux-2.6.14.2# make modules_install
Now while booting I am experiencing a few problems :

1) Its taking a very long time at :
Code:

Kjournald starting. Commit interval 5 seconds
INIT: version 2.84 booting
proc on /proc type proc(rw)
sysfs on /sys
Initializing udev dyanamic device directory

*********** Takes a very long time ********************

Adding 1028120k swap on /dev/hda6. Priority:-1 extents:1 across:1028120k

So I guess it has something to do with the swap space. But I don't know what ?

2) Some modules don't load. For example, I get the following errors :
Code:

FATAL: Module apm not found.
FATAL: Module agpart not found.
FATAL: Module ide_scsi not found.
*******************************************************
*******************************************************
Loading OSS compatibility modules for ALSA
FATAL: Module snd_pcm_oss not found.
FATAL: Module snd_mixer_oss not found.

Some of these I think I understand. For example the agpart module was a part of the Graphics driver for my Intel 845 machine. I think the drivers have to be compiled against this new kernel. So I tried to install the drivers against this new kernel. While installing the drivers I got the following errors :
Code:

Compiling new agpart module.........
Compiling new drm module............
ERROR: Kernel modules did not compile

The DRI drivers cannot be installed without the latest kernel modules. Installation aborted. See the dri.log file for information on what went wrong.

In the dri.log file I found the following things :
Code:

*******************************************************
make[2]: Entering directory `/home/koodoo/insight/linux-2.6.14.2'

lots of errors

make[2]: Leaving directory `/home/koodoo/insight/linux-2.6.14.2'
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/home/koodoo/dripkg/drm'
make: *** [gdg.ko] Error 2

Now the kernel source tree from which I compiled this new kernel was kept in /home/koodoo/insight/linux-2.6.14..2
I know that I am doing something really stupid. I have so many things in mind as to what is happening, I am realy confused and am a n00b in this field.
Maybe it has something to do with where I have put my kernel source tree
Please help me.

Thanks in anticipation.

bosewicht 01-26-2006 03:13 PM

I would
make menuconfig

This will build a few programs and then pop up a window. The window menu lets you change or setup kernel configuration.

After you have made any necessary changes, save the configuration and follow these instructions--do a

make dep; make clean

The first of these commands builds the tree of interdependencies in the kernel sources. These dependencies may have been affected by the options you have choosen in the configure step. The make clean purges any now-unwanted files left from previous builds of the kernel.

Then after it is done run this command:

make zImage

When this is complete do a:

make modules

This will not take as long.
Installing a New Kernel
Now installing the new kernel. On an Intel-based system the kernel is installed to the right place in /boot with the command

cp /usr/Linux/src/arch/i386/boot/zImage /boot/newkernel

then

make modules_install

This will install the modules in /lib/modules. Next, edit /etc/lilo.conf to add a section like this

image = /boot/newkernel

label = new

read-only

koodoo 01-26-2006 03:39 PM

Thanks for your reply.
Okay, I have a few more questions. I am really a n00b at this so don't mind if I act stupid. I am studying this book Linux Kernel Development By Robert Love and it states :
Quote:

Unlike kernels before 2.6, you no longer need to run make dep before building the kernel---the dependency tree is maintained automatically. You also do not need to specify a specific build type, such as bzImage, or build modules seperately, as you did in old versions. the default Makefile rule will handle everything!
I don't know what a specific build type exactly means but I guess it refers to what kind of kernel you wish to build. Also you said :
Quote:

Now installing the new kernel. On an Intel-based system the kernel is installed to the right place in /boot with the command

cp /usr/Linux/src/arch/i386/boot/zImage /boot/newkernel

This means that you are using the source tree in /usr/src/linux for building the kernel. The book states :
Quote:

Where to Install and Hack on the Source
The kernel source is typically installed in /usr/src/linux. Note that you should not use this source tree for development. The kernel version that your C library is compiled against is often linked to this tree. Besides, you do not want to have to be root to make changes to your kernel---instead, work out of your home directory and use root only to install new kernels. Even when installing a new kernel, /usr/src/linux should remain untouched.

Again I may sound stupid and bookish, but please help me.
Thanks again.

bosewicht 01-26-2006 04:44 PM

did you get any errors during make modules_install? have you tried make modules before the make modules_install? The errors are caused b/c the modules aren't being installed or installed correctly. Another thing, you can boot multiple kernels. On one of my boxes I use both the 2.4 and 2.6 kernels(not at the same time for obvious reasons :) )



make modules <- This will not take long.


Installing a New Kernel
Now installing the new kernel. On an Intel-based system the kernel is installed to the right place in /boot with the command

cp arch/i386/boot/bzImage to /boot/vmlinuz

then

make modules_install

This will install the modules in /lib/modules.

koodoo 01-28-2006 03:49 AM

Thanks for replying

No, I did not get any errors during make modules_install.
No, I had not tried make modules before make modules_install

Ok, So I tried again. This time I did :
Code:

koodoo@knapsacker:~$ make gconfig
(and selected whatever I thought was appropriate)
koodoo@knapsacker:~$ make
(I then copied arch/i386/boot/bzImage to /boot/vmlinuz and ran lilo as root)
after that I did,
koodoo@knapsacker:~$ make modules
and then as root,
root@knapsacker:/home/koodoo/insight/linux-2.6.14.2# make modules_install

While doing all this I did not get any errors whatsoever. But on booting the new kernel the results were the same.

One thing that I would like to say here is that to me, the most irritating problem is that when I boot the new kernel it like hangs for about 5-7 minutes at this step.
Code:

Kjournald starting. Commit interval 5 seconds
INIT: version 2.84 booting
proc on /proc type proc(rw)
sysfs on /sys
Initializing udev dyanamic device directory

*********** Takes a very long time ********************

Adding 1028120k swap on /dev/hda6. Priority:-1 extents:1 across:1028120k

I think that something related to the swap space is not configured properly. When I boot the original 2.4 kernel I do not experience this problem. It's really very annoying that the P.C. takes that much time to boot.

Thanks in anticipation.

koodoo 01-30-2006 06:47 AM

Still no luck :(


All times are GMT -5. The time now is 02:14 PM.