LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-26-2006, 03:08 PM   #1
koodoo
Member
 
Registered: Aug 2004
Location: a small village faraway in the mountains
Distribution: Fedora Core 1, Slackware 10.0 | 2.4.26 | custom 2.6.14.2, Slackware 10.2 | 11.0, Slackware64-13
Posts: 345

Rep: Reputation: 32
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.

Last edited by koodoo; 01-26-2006 at 03:18 PM.
 
Old 01-26-2006, 03:13 PM   #2
bosewicht
Senior Member
 
Registered: Aug 2003
Location: Honolulu, HI
Distribution: Arch
Posts: 1,380

Rep: Reputation: 47
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
 
Old 01-26-2006, 03:39 PM   #3
koodoo
Member
 
Registered: Aug 2004
Location: a small village faraway in the mountains
Distribution: Fedora Core 1, Slackware 10.0 | 2.4.26 | custom 2.6.14.2, Slackware 10.2 | 11.0, Slackware64-13
Posts: 345

Original Poster
Rep: Reputation: 32
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.
 
Old 01-26-2006, 04:44 PM   #4
bosewicht
Senior Member
 
Registered: Aug 2003
Location: Honolulu, HI
Distribution: Arch
Posts: 1,380

Rep: Reputation: 47
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.

Last edited by bosewicht; 01-26-2006 at 05:57 PM.
 
Old 01-28-2006, 03:49 AM   #5
koodoo
Member
 
Registered: Aug 2004
Location: a small village faraway in the mountains
Distribution: Fedora Core 1, Slackware 10.0 | 2.4.26 | custom 2.6.14.2, Slackware 10.2 | 11.0, Slackware64-13
Posts: 345

Original Poster
Rep: Reputation: 32
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.

Last edited by koodoo; 01-28-2006 at 03:52 AM.
 
Old 01-30-2006, 06:47 AM   #6
koodoo
Member
 
Registered: Aug 2004
Location: a small village faraway in the mountains
Distribution: Fedora Core 1, Slackware 10.0 | 2.4.26 | custom 2.6.14.2, Slackware 10.2 | 11.0, Slackware64-13
Posts: 345

Original Poster
Rep: Reputation: 32
Still no luck
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Problems building the kernel movitto Linux - Software 39 01-29-2006 04:08 AM
Problems building a simple kernel module for kernel 2.6.7 atticman Linux - Software 2 12-13-2004 03:35 PM
building kernel RPM problems mindcry Linux - Software 1 08-12-2004 08:39 AM
Couple of kernel 2.6.6 problems mondaypickle Linux - Hardware 5 05-31-2004 07:37 PM
A couple of problems with the 2.6 kernel jspaceman Slackware 10 12-18-2003 05:57 PM


All times are GMT -5. The time now is 12:38 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration