LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-02-2004, 12:39 PM   #1
necbrownie
Member
 
Registered: Jul 2004
Location: Cambridge, Massachusets, USA
Distribution: Slackware 10.0 Suse 9.2
Posts: 47

Rep: Reputation: 15
recompile configuration question


I have a question about recompiling

The first time I compiled, I went from my 2.4.26 kernel to the 2.6.9 kernel using the following steps…..

downloaded the Kernel source from kernel.org
opened the tarball into the /usr/src directory
edited the lilo.conf file by making a second linux section and adding ".old" to the end of vmlinuz and the label
edited the Makefile in the 2.6.9 directory by uncommenting "export INSTALL_PATH=/boot"
opened terminal and changed directory to /usr/src
fixed the symbolic link by typing
rm -f linux
ln -s linux-2.6.9 linux
then changed directory to /usr/src/linux
typed "make mrproper"
typed "cp /usr/src/linux-2.4.26 /usr/src/linux" to import my old kernel's config
typed "make gconfig" (the only changes I made were the ones that optimized the kernel to run on an Athlon processor)
typed "make clean"
typed "make dep" (got a message saying I didn't need to do this)
typed "make"
typed "su -c "make modules_install""
typed "make install"
typed "/sbin/lilo"

Lilo recognized the new Kernel and the old kernel. I am able to boot both up except I can't get my Nvidia drivers to work on the 2.6.9 kernel.

I found that the problem is that a line must be added to the kernel source code and the code must be recompiled.

And now for my question.....

How do I recompile so that my recompiled 2.6.9 kernel overwrites my old 2.6.9 kernel that doesn't work? Currently there are three choices in my lilo menu....

Windows
Linux.old (my old 2.4.26 kernel which works fine)
Slackware 2.6.9 (my new kernel which won't load x because of the nvidia module)

When I recompile will my lilo menu look something like this?

Windows
Linux.old (my old 2.4.26 kernel which works fine)
Slackware 2.6.9 (my new kernel which won't load x because of the nvidia module)
Slackware 2.6.9 (my recompiled kernel with the proper nvidia module)

I just don't want more than one 2.6.9 kernel and I want to have a lilo menu that links to my windows partition, linux 2.4.26, and linux 2.6.9 kernelt with the nvidia working properly.

If you can explain how to recompile in layman's terms I would appreciate it. Thanks!

 
Old 11-02-2004, 12:55 PM   #2
Courthold
Member
 
Registered: Nov 2003
Posts: 58

Rep: Reputation: Disabled
When recompiling 2.6 kernels, I do make, make modules_install, and make install
This process ends up by copying vmlinuz and system.map to /boot , so I just delete the existing files before I do this.

If you want to be a bit more organised you can use vmlinuz-2.6.9 and symlink vmlinuz to the newest one.
This process also updates your lilo.conf.
 
Old 11-02-2004, 03:08 PM   #3
necbrownie
Member
 
Registered: Jul 2004
Location: Cambridge, Massachusets, USA
Distribution: Slackware 10.0 Suse 9.2
Posts: 47

Original Poster
Rep: Reputation: 15
Quote:
This process also updates your lilo.conf.
Do I still have to run /sbin/lilo

Also does the make, make module_install, and make install overwrite my existing 2.6.9 kernel? Should I run "make clean" before or after any of these?
 
Old 11-02-2004, 03:20 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Yes, you need to run/sbin/lilo after changing the symbolic links that lilo.conf uses, but lilo.conf doesn't need to be edited.
When you run /sbin/lilo, the starting locations on the device for the target are recorded.

On your first message:
> typed "cp /usr/src/linux-2.4.26 /usr/src/linux" to import my old kernel's config

On this step, you should of:
"cp /usr/src/linux-2.4.26/.config /usr/src/linux/"

Maybe that's what you meant to type in your message. Depending on whether you have the '-i' flag set in an alias for 'cp', you could be copying over the 2.6 Makefile with the 2.4 Makefile. The other files are text notes.

If the Makefile was replaced, then you may need to reinstall the 2.6 kernel-source and start again.


Last edited by jschiwal; 11-02-2004 at 03:32 PM.
 
Old 11-02-2004, 03:23 PM   #5
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
For my part with 2.6.9 kernel compile (I compiled it 3 times with sucess, it was to add features in it), I
used :

The first time :
make mrproper
make xconfig
make
make modules_install
cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.9
cp System.map /boot/System.map-2.6.9

and the 2nd and 3rd time :
make xconfig
make
make modules_install
cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.9
cp System.map /boot/System.map-2.6.9

All went fine, just updated the bootloader config at the first time to add an entry for vmlinuz-2.6.9

Last edited by Cedrik; 11-02-2004 at 03:25 PM.
 
Old 11-02-2004, 03:44 PM   #6
mcd
Member
 
Registered: Aug 2003
Location: Denver, CO
Distribution: CentOS, Debian
Posts: 825

Rep: Reputation: 33
i just went through a lot of recompiling also.

basically, there are 3 files that you create when you compile a kernel. you need a .config file (created by make xconfig, or make menuconfig) that lists which options you want compiled into the kernel and which you want loaded later as modules. (notice that before you run menuconfig there should not be a .config file in ./linux-2.6.9/ because you haven't created one yet.

after you create a .config file, then you run make bzImage to create the kernel image. when this is done, you have your new kernel: ~./arch/i386/boot/bzImage

now, you need to build the module tree, which means you have to run make modules, and make modules_install.

so the 4 steps are just

make xconfig
make bzImage
make modules
make modules_install <-- you must be root to issue this command


you can make clean or make mrproper to clean out stuff you may have compiled from an earlier session before you begin, but the first time it isn't neccessary.


so after these commands have finished, you will have 3 new important files:

~./linux-2.6.9/System.map
~./linux-2.6.9/.config
~./linux-2.6.9/arch/i386/boot/bzImage

you need to copy all three into your /boot directory, ideally with nice, new, descriptive names:

cp System.map /boot/System.map-2.6.9
cp .config /boot/config-2.6.9
cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.9


now it's probably a good idea to

cd /boot
ls -al


and check out which kernels you currently have. typically, you'll have

vmlinuz -> vmlinuz-2.4.26

which means you have a symbolic link, and everything directed to vmlinuz gets forwarded to vmlinuz-2.4.26. you can leave this if you want, or change it if you prefer. when you open /etc/lilo.conf you'll see how it works:

# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/sda1
label = Slack-2.4.26
read-only
image = /boot/vmlinuz-2.6.9
root = /dev/sda1
label = Slack-2.6.9
read-only
# Linux bootable partition config ends


you can arrange it however you like, just make sure that you don't have both images pointing to the same place. ie, if you make vmlinuz point to vmlinuz-2.6.9, then both of those will boot your new (possibly broken) kernel, and you would have to use a rescue cd to change lilo before you could get back into your sytem. i like just using the real names of my images, and leaving the sym-link vmlinuz out altogether...it just seems confusing to me. anyway, you can also make new symlinks for System.map and .config in your /boot folder, in the same manner.

ln -s System.map-2.6.9 System.map

is how you do that. oh, and don't forget, when you're done changing lilo.conf, _make sure you run lilo_!! i forget to do this all the time and it sucks! from a command line, just type

lilo

and you should see
*added Slack-2.4.26
added Slack-2.6.9


if you get errors, do not reboot!! fix lilo.conf and try again. so anyway, that's about it. the only time you should worry about writing over your old kernel stuff is if you're recompiling the same kernel version. if you're using 2.6.9, then everything is done in the linux-2.6.9 folder, and exists separately from the linux-2.4.26 folder. same thing goes for modules. it's up to you to copy the image over to /boot and set up lilo to boot it though, and that's where you could accidentally overwrite things. that's why i recommend naming everything using -2.6.9.

so anyway, hopefully that cleared some of it up. post up if you have more questions!
 
Old 11-02-2004, 04:27 PM   #7
jturnbul
Member
 
Registered: Sep 2004
Location: Toronto, Canada
Distribution: Fedora 4 - Slackware 10 - PHLAK
Posts: 92

Rep: Reputation: 15
Re: recompile configuration question

Quote:
Originally posted by necbrownie
Lilo recognized the new Kernel and the old kernel. I am able to boot both up except I can't get my Nvidia drivers to work on the 2.6.9 kernel.

I found that the problem is that a line must be added to the kernel source code and the code must be recompiled.
I'm having the same problem... can I ask what exactly you added to the source code?
thanks
 
Old 11-03-2004, 06:53 PM   #8
necbrownie
Member
 
Registered: Jul 2004
Location: Cambridge, Massachusets, USA
Distribution: Slackware 10.0 Suse 9.2
Posts: 47

Original Poster
Rep: Reputation: 15
jturnbul

Sure dude no problem. I have actually encountered two possible solutions. Here they are.....

#1 Alter the Nvidia driver source code. This is the one I tried and it worked. I am not sure what this modification does or the "unknown" effects but I can tell you that it worked.

As a root, download the latest Nvidia driver to your /root directory (you can find the latest Nvidia driver here.... http://www.nvidia.com/object/linux_d..._1.0-6111.html

Then extract the source code by opening a terminal and typing "bash NVIDIA-Linux-x86-1.0-6111-pkg1.run -x" (ignore quotations of course). Go to the extracted source code directory NVIDIA-Linux-x86-1.0-6111-pkg1/usr/src/nv/nv.c and open the nv.c file with a text editior and add this line just after the includes section.

unsigned int __VMALLOC_RESERVE = 128 << 20;


The includes section is right at the top of the file, it looks like this....

#include "nv-misc.h"
#include "os-interface.h"
#include "nv-linux.h"
#include "nv_compiler.h"
#include "os-agp.h"

All you have to do is add this line

unsigned int __VMALLOC_RESERVE = 128 << 20;

So that it looks like this........

#include "nv-misc.h"
#include "os-interface.h"
#include "nv-linux.h"
#include "nv_compiler.h"
#include "os-agp.h"

unsigned int __VMALLOC_RESERVE = 128 << 20;

Then get out of graphical mode and run the nvidia-installer file in the source code folder by typing
"cd /root/NVIDIA-Linux-x86-1.0-6111-pkg1" (ignore quotes, this changes directory to the Nvidia folder where the nvidia-installer is)

Then type
"./nvidia-installer" (runs nvidia-installer)

Now when you boot up your new kernel, you should be able to enter graphical mode (or at least I was)

Sorry to if I sound condescending but I just want to make sure I didn't leave anything out.


#2 Your second option is to alter the Kernel 2.6.9 code and recompile. I was going to try this but when the easier solution (the one above) worked, so I didn't pursue it. If you want to try it you can follow the instructions here........
http://www.linuxquestions.org/questi...hreadid=237932


Woo Hoo! I actually helped someone for once. YAAAA!!

Oh, before I forget, let me know if this worked out for you.
 
Old 11-03-2004, 07:06 PM   #9
necbrownie
Member
 
Registered: Jul 2004
Location: Cambridge, Massachusets, USA
Distribution: Slackware 10.0 Suse 9.2
Posts: 47

Original Poster
Rep: Reputation: 15
The guy who told me how to alter the Nvdia source code thread is here....

http://www.linuxquestions.org/questi...hreadid=250076
 
  


Reply



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
Newbie kernel recompile question johngcarlsson Mandriva 8 12-06-2004 03:45 PM
Recompile question, again. whishkah Slackware 2 08-15-2004 03:56 AM
kernel recompile question Danforth Linux - General 2 04-26-2004 12:36 AM
kernel recompile question akshunj Linux - Software 7 09-21-2003 09:05 AM
Kernel recompile question... phishman3579 Slackware 2 06-27-2003 10:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:41 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
Open Source Consulting | Domain Registration