LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 10-25-2001, 07:40 AM   #1
phil1076
Member
 
Registered: Oct 2001
Location: Grand Cayman
Distribution: RH 9.0
Posts: 96

Rep: Reputation: 16
Question Help compiling and running new kernel please


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
 
Old 10-25-2001, 08:26 AM   #2
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 64
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.
 
Old 10-25-2001, 08:28 AM   #3
phil1076
Member
 
Registered: Oct 2001
Location: Grand Cayman
Distribution: RH 9.0
Posts: 96

Original Poster
Rep: Reputation: 16
x

When I tried to run lilo, it said the image files was too large...it's 2.4 megs
 
Old 10-25-2001, 08:38 AM   #4
WindozBytes
Member
 
Registered: Aug 2001
Location: CT, USA
Distribution: Mandriva 2008
Posts: 105

Rep: Reputation: 15
Thymox is correct; you have to run lilo once you edit lilo.conf

/sbin/lilo

or is it

/bin/lilo

one of those should get you there
 
Old 10-25-2001, 08:56 AM   #5
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 64
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.
 
Old 10-25-2001, 09:25 AM   #6
phil1076
Member
 
Registered: Oct 2001
Location: Grand Cayman
Distribution: RH 9.0
Posts: 96

Original Poster
Rep: Reputation: 16
doh

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.

The image size is 2.7 megs.
 
Old 10-25-2001, 09:30 AM   #7
phil1076
Member
 
Registered: Oct 2001
Location: Grand Cayman
Distribution: RH 9.0
Posts: 96

Original Poster
Rep: Reputation: 16
a

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 :/
 
Old 10-25-2001, 09:36 AM   #8
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 64
I always do this:
  • untar to /usr/src/linux-2.x.x

    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.
 
Old 10-25-2001, 10:42 AM   #9
phil1076
Member
 
Registered: Oct 2001
Location: Grand Cayman
Distribution: RH 9.0
Posts: 96

Original Poster
Rep: Reputation: 16
ok

Ok here is what i did exactly:

Fresh install of RH 7.1. *Full Install*

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
 
Old 10-25-2001, 11:54 AM   #10
phil1076
Member
 
Registered: Oct 2001
Location: Grand Cayman
Distribution: RH 9.0
Posts: 96

Original Poster
Rep: Reputation: 16
g

I re-compiled the kernel and it's the same size. this time when i run lilo it just says "Skipping /usr/src/newimage"
 
Old 10-25-2001, 02:06 PM   #11
isajera
Senior Member
 
Registered: Jun 2001
Posts: 1,635

Rep: Reputation: 45
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.
 
Old 10-25-2001, 02:09 PM   #12
phil1076
Member
 
Registered: Oct 2001
Location: Grand Cayman
Distribution: RH 9.0
Posts: 96

Original Poster
Rep: Reputation: 16
aa

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./
 
Old 10-25-2001, 02:15 PM   #13
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.

i guess.

right, i'm definitely gonna compile 2.4.15 definitely...

that'll be in.. 3 days?

----------------------
at teh risk of making this thread stupid, does anyone else like or dislike numbers?

2.4.x sounds nice, 2.2.x was ok, 2.0.x sounds really... skinny(?). and 2.6 sounds fat and ugly to me, think 2.8 will sound nice tho.
 
Old 10-25-2001, 02:46 PM   #14
paavaka
Member
 
Registered: Jun 2001
Location: Virginia
Distribution: Slackware,Debian,SuSE
Posts: 43

Rep: Reputation: 15
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.
 
Old 10-25-2001, 03:25 PM   #15
phil1076
Member
 
Registered: Oct 2001
Location: Grand Cayman
Distribution: RH 9.0
Posts: 96

Original Poster
Rep: Reputation: 16
!

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!
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
compiling sata driver for new non-running kernel krazyjase Linux - General 0 01-19-2005 06:19 PM
compiling & running java using gcc kiran_kondru17 Linux - Newbie 1 01-04-2005 11:49 AM
Kernel compiling and module compiling tarballed Linux - General 1 12-22-2002 05:31 PM
compiling modules for a running kernel bass Linux - Newbie 3 11-16-2002 04:24 AM
Running a program after compiling - How? halem Linux - Newbie 2 02-24-2001 10:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:32 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