LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-17-2005, 06:00 PM   #1
Jesterace
LQ Newbie
 
Registered: Aug 2003
Location: Nova Scotia, Canada
Distribution: Ubuntu
Posts: 26

Rep: Reputation: 15
Kernel Compilation


I have read quite a few different pages and faqs about recompiling a kernel. shilo says to remove the linux symlink and create a new one however the README included with the 2.6.10 kernel says not to do that since there are valuable header information and whatnot. So I'm wondering what is the best way of compiling a kernel from source. I mean I could do it in a home directory then copy it over but then when apps need some of those files for compiling what would be the best to do in this situation? I followed shilo's guide and managed to get a working kernel compiled however when I went to install the nvidia drivers it said the source was not where it was supposed to be and didn't seem to work even when I forced it to use the source directory.
 
Old 02-17-2005, 07:36 PM   #2
kodon
Member
 
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796

Rep: Reputation: 31
iirc, that statement in the readme is meant to keep you from
building a new kernel inside an existing kernel source tree.
 
Old 02-18-2005, 01:02 AM   #3
JoannesX
Member
 
Registered: Dec 2004
Location: Brazil
Distribution: Slackware
Posts: 99

Rep: Reputation: 15
oohh the old kernel keeps scarying..

so...
you have your linux-2.6.10.tar.gz (or bz2) package..
unpack it to /usr/src/, enter this directory, and try this:>

PREPARATION

#rm -f linux (to remove the existent kernel symbolic link)

#ln -s linux-2.6.10 linux (to rebuild that link, but now pointing to the new kernel)

#cp /usr/src/linux-2.4.29/.config /usr/src/linux/ (to copy your old kernel configuration to the new kernel. I assume linux-2.4.29 is your old kernel, right?)

#cd linux (to enter the linux directory link ihihihihi)

COMPILATION AND INSTALLATION

#make xconfig or make menuconfig (if you're running X use xconfig, a user friendly interface. If in console, menuconfig)

#if you chose xconfig, go to File>Load. Load the file /usr/src/linux/.config, just to make sure.

#if you chose menuconfig, choose the option "Load an alternate configuration file" at the end of the list. Load the file /usr/src/linux/.config, just to make sure.

#when it's loaded, just take a look at everything to see if all is well (Sound, Network, Video, etc).

#quit

#save (to save your changes.)

# now in the console type: "make bzImage" (to prepare the image)

#then "make modules" (to compile the modules. go take a nap..)

#then "make modules_install" (to install the modules)

REMOVALS, SUBSTITUTIONS AND CREATION OF LINKS

#cp /usr/src/linux/arch/i386/boot/bzImage /boot/mykernel (to copy the image to the right place. I assume "mykernel" is the name you wish)

#cp /usr/src/linux/System.map /boot/System.map-2.6.10
#cp /usr/src/linux/.config /boot/config-2.6.10

#cd /boot

#rm System.map
#rm config

#ln -s System.map-2.6.10 System.map
#ln -s config-2.6.10 config

LILO CONFIGURATION

#edit /etc/lilo.conf and put the new image there:
image = /boot/mykernel
root = /dev/hda6
label = Linux-2.6.10

#the above is an example..

#just to prevent it from fails, don't enable framebuffer consoles (just do it if you're sure what you're doing), because if framebuffer consoles are not supported, you get nothing but a black screen at the start-up..
prefer the normal console for now:
uncomment the line "vga = normal"
and comment all the others related to vesa or vga

#save and exit

#run "lilo"

#reboot and load your new kernel...

#don't forget: boot disks are VERY worth of creation...

This is my way of doing it, ok? I wouldn't even be writing this post if my 2.6.10 wasn't loaded right now..

Last edited by JoannesX; 02-18-2005 at 09:02 AM.
 
Old 02-18-2005, 01:02 PM   #4
Jesterace
LQ Newbie
 
Registered: Aug 2003
Location: Nova Scotia, Canada
Distribution: Ubuntu
Posts: 26

Original Poster
Rep: Reputation: 15
Thank you so much
 
Old 02-18-2005, 02:29 PM   #5
mdarby
Member
 
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30
My method:

Code:
tar jxf linux-2.6.10.tar.bz2 /usr/local/src
cd /usr/local/src
ln -s /usr/local/src/linux.2.6.10 linux
cd linux-2.6.10
make oldconfig
make menuconfig
make bzImage && make modules && make modules_install
cp arch/i386/boot/bzImage /boot/bzImage-2.6.10
cp System.map /boot/System.map-2.6.10
nano /etc/lilo.conf
lilo
reboot

Last edited by mdarby; 02-18-2005 at 02:30 PM.
 
Old 02-18-2005, 03:42 PM   #6
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
well....and here's the fastest....
(mostly copied from above...)

------------
tar jxf linux-2.6.10.tar.bz2 /home/<me>/kernels
cd ~/kernels/linux-2.6.10
make xconfig
make bzImage && make modules && make modules_install
cp arch/i386/boot/bzImage /boot/bzImage-2.6.10
cp System.map /boot/System.map-2.6.10
nano /etc/lilo.conf
lilo
reboot
--------

you do not need any symlink to your sources.
when you run make modules_install, a symlink "/lib/modules/build" will be created
pointing to your source.
also, keeping it in your home-dir works more easy, as a user cannot copy a file to /usr/src......

read the words of Linus himself on this...

http://uwsg.iu.edu/hypermail/linux/k...07.3/0587.html

egag

Last edited by egag; 02-18-2005 at 07:09 PM.
 
Old 02-18-2005, 07:02 PM   #7
Jesterace
LQ Newbie
 
Registered: Aug 2003
Location: Nova Scotia, Canada
Distribution: Ubuntu
Posts: 26

Original Poster
Rep: Reputation: 15
What does make oldconfig do?
 
Old 02-18-2005, 07:08 PM   #8
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
yeah..good Q. ( i copied it but i never used it ? ).
and also, i always use " make xconfig" wich has a nice gui, with info and advice.
( i'll edit my list...... ).

edit: to start with a basic kernel-config file, copy the config file from cd ( the 2.6.10 kernel ) to .../linux-2.6.10
as " .config "


egag

Last edited by egag; 02-18-2005 at 07:12 PM.
 
Old 02-18-2005, 07:19 PM   #9
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Make oldconfig take your old.config file, enable features/drivers from it and each time it sees a new driver/feature it ask you if you want it (Y/m/N) enabled.
This is faster than other configure styles if you don't want change too much thing.
 
Old 02-18-2005, 10:15 PM   #10
mdarby
Member
 
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30
Quote:
Originally posted by egag
well....and here's the fastest....

you do not need any symlink to your sources.
also, keeping it in your home-dir works more easy, as a user cannot copy a file to /usr/src......
I have found that certain compilations won't work if the symlink isn't in place (I never used to link it as well)
I would never need / want a user to compile a kernel; plus the source in a home directory would just add to backup archive size. I can backup the .config
 
Old 02-25-2005, 10:21 AM   #11
zeca_pedra
Member
 
Registered: Nov 2003
Location: Funchal, Madeira, Portugal
Distribution: Linux Mint 13
Posts: 37

Rep: Reputation: 15
what about if you can't run make xconfig?

this is the error that I got while running make xconfig
Code:
HOSTCC  scripts/basic/fixdep
In file included from /usr/include/sys/socket.h:35,
                 from /usr/include/netinet/in.h:24,
                 from /usr/include/arpa/inet.h:23,
                 from scripts/basic/fixdep.c:115:
/usr/include/bits/socket.h:305:24: asm/socket.h: No such file or directory
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2
and a similar error when I do make menuconfig
Code:
HOSTCC  scripts/basic/fixdep
In file included from /usr/include/sys/socket.h:35,
                 from /usr/include/netinet/in.h:24,
                 from /usr/include/arpa/inet.h:23,
                 from scripts/basic/fixdep.c:115:
/usr/include/bits/socket.h:305:24: asm/socket.h: No such file or directory
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2
I've been reading a lot, I found that I needed ncurses-devel, searched for it, instaled it, no better results!
I also found out that I needed Qt libraries, I have all that installed so this is not the problem. But them, what sort of error is this? What is that fixdep and all those /usr/include whatsoever errors about?

I really need help because I searched all the way and I can't find anything similar for what it's happening to me!
So, please, can anyone help me? Thank you so much...

This maybe out of topic but I need to compile the kernel in order to have the NVidia drivers properly installed and configured. And I think this can be the best place to get help!
 
Old 02-25-2005, 10:30 AM   #12
kodon
Member
 
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796

Rep: Reputation: 31
'make xconfig' has errored out on me before.
i don't remember the actual error messages right now,
but it was related to qt.

i removed qt, installed the old version off my cd,
removed that version, then manually installed the new version
and 'make xconfig' worked again
 
Old 02-25-2005, 10:33 AM   #13
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Have you kernel-headers package installed ?
 
Old 02-25-2005, 11:44 AM   #14
zeca_pedra
Member
 
Registered: Nov 2003
Location: Funchal, Madeira, Portugal
Distribution: Linux Mint 13
Posts: 37

Rep: Reputation: 15
which kernel-headers should I got?

ok, I found that I don't have kernel-headers package installed! now my question is: should I got the package according to the kernel I have on my machine? I'm assuming the answer will be Yes (the kernel on my machine is the linux-2.4.27 kernel!!

thanks for your help!
 
Old 02-25-2005, 12:30 PM   #15
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Yes or you could take the 2.4.29, it does not matter.
Just make sure you don't take a 2.6.* kernel-headers package
 
  


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
kernel compilation-From where it should be started for already compiled kernel b0nd Linux - Newbie 11 08-17-2005 01:08 PM
kernel compilation : to remove a kernel which files should be deleted b0nd Linux - Newbie 2 08-17-2005 11:35 AM
Kernel compilation problems, distorted video and kernel panic shamrock_uk Linux - Laptop and Netbook 5 08-12-2005 10:53 PM
does kernel-source installs with the compilation cum installtion of a new kernel? luqman Linux - General 18 03-04-2005 07:33 AM
kernel 2.6.0 compilation help need talha Linux - Software 2 12-18-2003 07:36 AM

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

All times are GMT -5. The time now is 09:06 PM.

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