SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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)
#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..
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
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......
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 "
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.
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
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!
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!!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.