Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
My mind is boggled. I'm playing with Linux at work and yesterday I compiled my first kernel (I am using RH 7.1). I copied the kernel to the /boot directory and edited /etc/lilo.conf to point to the new kernel. When I rebooted, it just loads the old kernel still. I DELETED the old kernel, moved the new one to /vmlinuz/ and edited lilo.conf to reflect this, and when I rebooted it STILL loaded the old kernel even though I deleted it. Can anyone tell me, step by step, how to compile a new kernel and install it? Basically I want to install iptables 1.2.4. Thanks in advance
You edited the lilo.conf file, but did you run lilo to install the new details?
I was lead to believe (and I still do things in this fashion):
make xconfig (or menuconfig, or config - whichever you prefer) make dep
make clean
make bzImage
make modules
make modules_install
-I edit my lilo.conf file before this last step make bzlilo
The last step basically (AFAIK) checks that all is OK and then runs lilo to ensure that the lilo.conf file is correct. When I reboot, the appropriate entries are in the menu (I use graphical lilo - I'm quite shallow and I like fancy GUI stuff ) and I can boot from the new kernel.
As long as you're not trying to install the kernel image onto a floppy, then make bzImage should do the trick. When booting from an image on the HDD, it shouldn't really make much difference on how large the file is. If you're really stuck, and you want to make the image smaller, then when you make xconfig, instead of clicking [Y] to certain things (like sound 'drivers'), you could click [M] (if present) to make them loadable modules. This is a bit of a tricky concept for very recent converts from Windows, but it's very useful:
Once the kernel is loaded, the loadable modules (like sound) can be inserted so that you can use them, and removed so that you can't. If, for example, you have one of those weird HAM-Radio modem things (there's some documentation on it under the documentation directory of your kernel source, which I suppose is the most obvious place to put documentation), and you're not likely to be using it very much, then there's not a lot of point in building it into the kernel, you should build it as a module and then insert it later when you want to use it. I believe that the NT family of windows has similar options, but I'm not entirely sure.
As I said above though, if booting from an image on the HDD, it really shouldn't matter that the image is 2.4Mb.
If you can, could you post exactly what the error message is.
I could post the exact error, but I just finished destroying the upgrade and now it won't boot ...Hehehe it's ok, as it's just a play machine and I'll re-install. Essentially, here is my process:
1. I get the latest kernel from kernel.org
2. unzip it to /usr/src/linux
3. make xconfig and leave everything at the defaults and save config
4. then I perform every step listed above (make dep, etc etc)
5. I copy the kernel and the System.dat file to /boot
6. edit lilo.conf to point to new kernel
7. Then I run lilo and it tells me the image is too large.
8. Instead I run make bzlilo and it appears to be working, but then gives me a fatal error: image too big.
9. I rebooted and now it says loading Linux................. and sits there...reinstall time.
BTW The machine is a P3-1000 with 384MB RAM and a 30 gig drive.
I'm now re-installing Redhat 7.1 on the machine. I chose "full" install and will post the steps I take, step-by-step, when it's done and hopefully I can get a hand :/
symlink /usr/src/linux-2.x.x to /usr/src/linux (just coz I do)
make xconfig
save config-file to somewhere on my windows partition, so should I have to re-install, at least I've got a copy to change.
save and exit
make (everything that I said above)
leave the new kernel image under / and simply edit the lilo.conf file to look there (I have the original under /boot, so I don't want to confuse the two)
run lilo
reboot
If you're not dualbooting, may I suggest that you save a copy of the config data to a floppy as it will be easier to sort things if you have a refernce file to go back to.
1. login as root --> startx --> netscape --> download kernel from kernel.org into /root
2. gzip -dv linux-2.4.13.tar.gz
3. tar -xvf linux-2.4.13.tar -C /usr/src/
4. renamed /usr/src/linux to /usr/src/linux-2.4.13
5. cd /usr/src/linux-2.4.13
6. make xconfig
7. i took the defaults and saved configuration without any changes
8. make dep
* At this point I logged out of gnome
9. make clean
10. make bzImage
11. Warning: Kernel is too big for stand alone floppy..checked size, it's 2.7 megs
12. make modules
13. make modules_install
14. mkdir /boot2
15. cp vmlinux /boot2/
16. cp System.dat /boot2/
17. edit lilo.conf
* point to new kernel location (image=/boot2/vmlinux), save, exit
18. lilo
Fatal: Kernel /boot2/vmlinux is too big
19. cd /usr/src/linux-2.4.13
20. make bzlilo
Fatal: Kernel /boot2/vmlinux is too big
When I reboot, it successfully boots the OLD kernel
that's one heck of a big kernel... i've never even seen one over a meg before. are you sure you're not compiling too many modules? i'd go through the config and get rid of anything you don't really need... like nls codes... arbitrary sound drivers... ect.
Interestingly enough, when I pointed the vmlinuz symbolic link BACK to the OLD kernel, lilo told me that's its too big....go figure, as the original kernel is 2.4 megs. God I hate Linux, but I want to run it./
i know nothing about compiling kernels.. never needed to, but the one time i did try, i had a file abuot that size, and tried to bot it, but found out that it wasn't the kernel, but some other file, vmlinux / vmlinuz .. think i got those two confused. one was 2.5mb is the other, the actually kernel image, was only 800kb ish.
oh yeah.. look, you're trying to use vmlinux as the kernel, which it isn't, you need vmlinuz.
Your kernel image will be located at /usr/src/linux/arch/i386/boot/bzImage. As long as your kernel didn't have any errors during compilation, copying this file and editing lilo.conf by hand should do the trick.
Well thank you Paavaka! Kernel 2.4.13 successfully installed. I'm shocked that all those newbie HOW-TO's and RedHat documents are incorrect. Now I need to figure out how to install iptables 1.2.4...thanks again!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.