Kernel Compilation Questions

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
There are some points in the Readme to the Kernel source that I'm not sure on. Specifically:
INSTALLING the kernel:

- If you install the full sources, put the kernel tarball in a
directory where you have permissions (eg. your home directory) and
unpack it:

gzip -cd linux-2.6.XX.tar.gz | tar xvf -

Replace "XX" with the version number of the latest kernel.

Do NOT use the /usr/src/linux area! This area has a (usually
incomplete) set of kernel headers that are used by the library header
files. They should match the library, and not get messed up by
whatever the kernel-du-jour happens to be.

....[snip]....

BUILD directory for the kernel:

When compiling the kernel all output files will per default be
stored together with the kernel source code.
Using the option "make O=output/dir" allow you to specify an alternate
place for the output files (including .config).
Example:
kernel source code: /usr/src/linux-2.6.N
build directory: /home/name/build/kernel

To configure and build the kernel use:
cd /usr/src/linux-2.6.N
make O=/home/name/build/kernel menuconfig
make O=/home/name/build/kernel
sudo make O=/home/name/build/kernel modules_install install

Please note: If the 'O=output/dir' option is used then it must be
used for all invocations of make.

Now, did the authour (don't know if it was Linus or not), mean in the first case not to extract the kernel sources to /usr/src area, but instead extract them into your /home/insertname instead?? This flies in the face of all documentation I've seen (Running Linux, Gentoo, and what is written later on by the same authour). Or was it a case that the user is expected to extrapolate that the "/usr/src/linux area" would mean (in concrete terms) /usr/src/linux-2.6.14 and that the sources should go in /usr/src/linux-2.6.15. In other words, is he saying -- > Don't put them in /usr/src/linux-2.6.N ! Put them in /usr/src/linux-2.6.N+1 ??

Here's a little break down of my compiling story so far:

I'm using Suse 10.0 which has kernel "2.6.13-15-default"

The previous weekend I attempted to build and install 2.6.14. At that time, I recall /usr/src containing a /usr/src/linux-2.6.13-15-obj directory, in which it looked like the kernel source stuff was there (i.e. many subdirectories like arch etc...). Now, in terms of order of operations, I:
- extacted the 2.6.14 kernel sources to /usr/src/linux-2.6.14. Then from /usr/src/linux-2.6.14 I ran:
- make O=/home/CityK/zkernel xconfig.
- (after making driver and module selections from the previous step) make O=/home/CityK/zkernel
- (after compiling - which didn't seem to take that long, but did generate errors or warnings) sudo make O=/home/name/build/kernel modules_install install

Upon reboot, (not surprisingly) a gazillion errors. So I booted back to the 2.6.13-15 kernel and removed the 2.6.14 crud (kernel, initrd, menu, etc..) from /boot, the sources from /usr/src, and the other stuff from /home/CityK/zkernel

This past weekend I made my second attempt. This time I
- extracted the 2.6.14 kernel sources to /usr/src/linux-2.6.14. Then from /usr/src/linux-2.6.14, I:
- patched the kernel sources with 2.6.14.1
- make xconfig
- (after making very few changes to driver and module selections from the previous step) make
- (after compiling - which took a long time, and again generated some errors and warnings) sudo make modules_install install

Upon reboot I successfully was logged in under 2.6.14.1 (verified by u name -a *). Hurray for me :D

It was at this point in time (I think) that I noticed that the old /usr/src/linux-2.6.13-15-obj directory no longer contained much data (just a slight understatement here on my part ... ie. now only contains one file embedded in /usr/src/linux-2.6.13-15-obj/i386/default). The good news is that /usr/src/linux-2.6.14 looks exactly like what /usr/src/linux....13-15-obj used to. ... at least, I suppose that's good news. Anyways, this is when I began to wonder whether not heading that warning in the Kernel sources Readme file ["Do NOT use the /usr/src/linux area! This area has a (usually
incomplete) set of kernel headers that are used by the library header
files. They should match the library, and not get messed up by
whatever the kernel-du-jour happens to be."] had anything to do with it. Anyone?

Now my success with 2.6.14.1 was rather short lived. As things would be, I happened to notice some delay in a HD transport stream file I was playing back. Checking CPU utilization showed it pegged near the top. Sax confirmed what I suspected -- video acceleration was turned off. Yet now I was unable to turn it back on (nVidia proprietary drivers). seemed to provide the answer. Unfortunately, the next time the computer was booted resulted X failing to start or something. Not ready to deal with such disasters, I simply ending up nuking 2.6.14.1 and reverting back to 2.6.13-15.

The next go around, I repeated my steps except patched 2.6.14 with 2.6.14.2 this time and took my time going through the make xconfig portion for the drivers and loadable device modules (still noticed error and warning messages while compiling). Upon reboot --> blank screen, no disk activity. Sigh. Back to 2.6.13-15

So that's where I be today (batting 1 for 3...which I suppose is pretty good). I don't know if (during my first compiling adventure) I messed up some object files or headers (or what not) and that is why I'm seeing so many errors while compiling or what. Anyone have any suggestions here? I was really careful last time with make xconfig (i.e. it should have worked.....took bloody forever making the selections....compiling still took ~30 mins too!).

* See [url=http://www.storageforum.net/forum/viewtopic.php?p=76408#76408]apache bork
 

Mercutio

Fatwah on Western Digital
Joined
Jan 17, 2002
Messages
21,600
Location
I am omnipresent
Many Linux systems symlink /usr/src/linux to /usr/src/linux-2.6.whatever.the.shipping.version.was.

Putting your stuff there would overwrite the files that came with the system.
I intrepret that as "make a different directory to put your stuff in", which isn't usually a problem.
 

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
Mercutio said:
Many Linux systems symlink /usr/src/linux to /usr/src/linux-2.6.whatever.the.shipping.version.was.
Yep, that and apparently /usr/include/asm so says Oreilly's Running Linux.

Putting your stuff there would overwrite the files that came with the system.
by there do you mean /usr/src or /usr/src/linux-whatever ? As I certainly didn't do the later.

I intrepret that as "make a different directory to put your stuff in", which isn't usually a problem.
Exactly. And the O'Reilly book even makes mention of saving the old kernel source tree by

cd /usr/src
mv linux linux.old
tar xzf v2.6.xx.y.tar.gz

I skipped the mv (because I thought I was getting around this step by -->), but I did extract the new kernel sources to its own directory. So, before I did anything else, my /usr/src contained the two very full directories of
/usr/src/linux-2.6.N
/urs/src/linux-2.6.N+1

And as I said, somewhere along the line, /usr/src/linux-2.6.N became a ghosttown (♫ ♪ ♫ ♪ this towwwwwnnnnnn, coming like a ghosttown ...do you remember the good ol days before the ghosttown ♫ ♪ ♫ ♪)

Some finer point got lost on me. And I'm uncertain whether that is leading to the errors and warnings being recieved during compilation (although they were there the first time too).
 
Top